Skip to main content Link Menu Expand (external link) Document Search Copy Copied

LP duality practice

Original practice questions (PDF)

Formulate the dual of each linear program. Multipliers below are named in the order of the displayed constraints.

1. Three constraint senses

maximize4x1+2x2subject tox1+x2≤5,−2x1+x2≥1,3x1−x2=2,x1,x2≥0. \begin{aligned} \text{maximize}\quad &4x_1+2x_2\\ \text{subject to}\quad &x_1+x_2\le5,\\ &-2x_1+x_2\ge1,\\ &3x_1-x_2=2,\qquad x_1,x_2\ge0. \end{aligned}

Solution to exercise 1

Minimize 5u+v+2w5u+v+2w subject to u−2v+3w≥4u-2v+3w\ge4 and u+v−w≥2u+v-w\ge2, with u≥0u\ge0, v≤0v\le0, and ww free. In this maximization primal, the first two multipliers make the corresponding rows upper bounds when combined. The equality multiplier is free.

2. A free primal variable

minimize3x1+x2+2x3subject tox1+4x2+2x3≥2,2x1−x2+3x3≤3,x1−x2+2x3=1,x1,x3≥0,x2 free. \begin{aligned} \text{minimize}\quad &3x_1+x_2+2x_3\\ \text{subject to}\quad &x_1+4x_2+2x_3\ge2,\\ &2x_1-x_2+3x_3\le3,\\ &x_1-x_2+2x_3=1,\qquad x_1,x_3\ge0,\quad x_2\text{ free}. \end{aligned}

Solution to exercise 2

Maximize 2u+3v+w2u+3v+w subject to u+2v+w≤3,4u−v−w=1,2u+3v+2w≤2,u+2v+w\le3,\qquad 4u-v-w=1,\qquad 2u+3v+2w\le2, with u≥0u\ge0, v≤0v\le0, and ww free. The column of the free variable x2x_2 gives an equality.

3. Upper bounds on variables

maximize2x1+5x2subject to3x1+x2≤8,x1+4x2≤9,0≤x1≤2,0≤x2≤3. \begin{aligned} \text{maximize}\quad &2x_1+5x_2\\ \text{subject to}\quad &3x_1+x_2\le8,\qquad x_1+4x_2\le9,\\ &0\le x_1\le 2,\qquad 0\le x_2\le3. \end{aligned}

Solution to exercise 3

Treat x1≤2x_1\le2 and x2≤3x_2\le3 as additional rows. Minimize 8u+9v+2w+3z8u+9v+2w+3z subject to 3u+v+w≥23u+v+w\ge2 and u+4v+z≥5u+4v+z\ge5, with u,v,w,z≥0u,v,w,z\ge0.

4. A nonpositive primal variable

maximize−x1+3x2subject to−x1+x2≤2,2x1+x2=1,x1≤0,x2≥0. \begin{aligned} \text{maximize}\quad &-x_1+3x_2\\ \text{subject to}\quad &-x_1+x_2\le2,\qquad 2x_1+x_2=1,\\ &x_1\le0,\qquad x_2\ge0. \end{aligned}

Solution to exercise 4

Minimize 2u+v2u+v subject to −u+2v≤−1-u+2v\le-1 and u+v≥3u+v\ge3, with u≥0u\ge0 and vv free. Since x1≤0x_1\le0, the first column inequality has the opposite direction from the second.

5. Matrix form

Maximize c⊺xc^\intercal x subject to Ax≤bAx\le b and x≥0x\ge0, where A=[1−12031],b=(4,5),c=(1,0,2). A=\begin{bmatrix}1&-1&2\\0&3&1\end{bmatrix},\qquad b=(4,5),\qquad c=(1,0,2).

Solution to exercise 5

The dual is min⁡{b⊺y:A⊺y≥c,y≥0}\min\{b^\intercal y:A^\intercal y\ge c,\ y\ge0\}. With y=(u,v)y=(u,v), minimize 4u+5v4u+5v subject to u≥1u\ge1, −u+3v≥0-u+3v\ge0, 2u+v≥22u+v\ge2, and u,v≥0u,v\ge0.

6. Three variable sign conventions

minimize5x1−x2+2x3subject to−x1+2x2+x3≥3,4x1+x2−2x3≥1,x1≥0,x2≤0,x3 free. \begin{aligned} \text{minimize}\quad &5x_1-x_2+2x_3\\ \text{subject to}\quad &-x_1+2x_2+x_3\ge3,\qquad 4x_1+x_2-2x_3\ge1,\\ &x_1\ge0,\qquad x_2\le0,\qquad x_3\text{ free}. \end{aligned}

Solution to exercise 6

Maximize 3u+v3u+v subject to −u+4v≤5-u+4v\le5, 2u+v≥−12u+v\ge-1, and u−2v=2u-2v=2, with u,v≥0u,v\ge0. The three column relations follow from the nonnegative, nonpositive, and free primal variables, respectively.

7. A feasibility problem

minimize0subject to2x1−x2≥1,−x1+3x2≥2,x1,x2≥0. \begin{aligned} \text{minimize}\quad &0\\ \text{subject to}\quad &2x_1-x_2\ge1,\qquad -x_1+3x_2\ge2,\qquad x_1,x_2\ge0. \end{aligned}

Solution to exercise 7

Maximize u+2vu+2v subject to 2u−v≤02u-v\le0 and −u+3v≤0-u+3v\le0, with u,v≥0u,v\ge0. In fact, the only feasible dual point is (0,0)(0,0), because v≥2uv\ge 2u and u≥3vu\ge 3v.

8. Equality constraints and variable signs

maximizex1−2x2+x3subject tox1+x2+x3=4,2x1−x2+3x3=1,x1≥0,x2 free,x3≤0. \begin{aligned} \text{maximize}\quad &x_1-2x_2+x_3\\ \text{subject to}\quad &x_1+x_2+x_3=4,\qquad 2x_1-x_2+3x_3=1,\\ &x_1\ge0,\qquad x_2\text{ free},\qquad x_3\le0. \end{aligned}

Solution to exercise 8

Minimize 4u+v4u+v subject to u+2v≥1u+2v\ge1, u−v=−2u-v=-2, and u+3v≤1u+3v\le1. The two equality rows make uu and vv free.