Menu Close

Linear programming: UPSC Statistics Optional PYQ Solutions (1995–2026)

All 68 questions UPSC has asked on linear programming in the Statistics Optional (Paper II, Optimization Techniques) from 1995 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Optimization Techniques topic-wise PYQs page.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SciPy) and matched.
  • ✓ Proof checked step by step for “prove that” and “examine whether” questions, every step was checked against the definitions and the standard theorems.
  • ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2026 · 3c(i) 2026 · 3c(ii) 2025 · 4b 2024 · 1d 2024 · 2c 2024 · 3a 2023 · 1c 2023 · 3a 2023 · 3b(ii) 2022 · 4a 2021 · 3c 2021 · 4a 2020 · 1c 2020 · 3c 2019 · 1d 2019 · 2a 2018 · 1a 2018 · 4b 2017 · 3c 2016 · 1e 2016 · 2a 2016 · 4c 2015 · 1e 2015 · 3a 2014 · 4a 2013 · 1e 2013 · 4c 2012 · 1e 2012 · 2a 2011 · 1d 2011 · 2a 2010 · 1d 2009 · 1b 2009 · 1f 2007 · 1d 2007 · 3a 2007 · 4d 2006 · 1d 2005 · 1f 2005 · 3a 2004 · 3a 2003 · 1d 2003 · 3a 2002 · 1d 2002 · 3a 2002 · 4c 2001 · 1d 2001 · 3a 2000 · 1e 2000 · 3a 2000 · 4c 1999 · 5b 1999 · 5c 1999 · 6b 1998 · 10b 1998 · 10c 1997 · 10a 1997 · 10b 1997 · 10c 1996 · 10a 1996 · 10b 1996 · 10c 1995 · 11a 1995 · 11b 1995 · 11c 1995 · 12a 1995 · 12b 1995 · 12c

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Distinguish between slack variables and surplus variables. Discuss how they are used in a linear programming problem.

2026 · Paper II · Q3c(i) · 5 marks

Solution

Slack variable. For a “less than or equal to” constraint ai1x1+…+ainxn≤bi,a_{i1}x_1+\dots+a_{in}x_n\le b_i , we add a non-negative variable sis_i to the left side: ai1x1+…+ainxn+si=bi,si≥0.a_{i1}x_1+\dots+a_{in}x_n+s_i=b_i,\qquad s_i\ge0 . sis_i is the unused amount of resource ii (e.g. idle machine hours). It is called a slack variable.

Surplus variable. For a “greater than or equal to” constraint ai1x1+…+ainxn≥bi,a_{i1}x_1+\dots+a_{in}x_n\ge b_i , we subtract a non-negative variable sis_i: ai1x1+…+ainxn−si=bi,si≥0.a_{i1}x_1+\dots+a_{in}x_n-s_i=b_i,\qquad s_i\ge0 . sis_i is the amount by which the requirement is exceeded (e.g. extra nutrient beyond the minimum). It is called a surplus variable.

Slack Surplus
Constraint type ≤\le ≥\ge
Sign in the equation +si+s_i −si-s_i
Meaning unused resource excess over requirement
Coefficient in objective 0 0
Can start the simplex basis? Yes (column of identity) No (coefficient −1); an artificial variable is added

How they are used.

  1. They convert all inequalities into equations, giving the standard form AX=bAX=b, X≥0X\ge0, needed by the simplex method.
  2. They carry zero cost in the objective function, so they do not change ZZ.
  3. Slack variables give an initial basic feasible solution at once (x=0x=0, s=bs=b) when all constraints are ≤\le with b≥0b\ge0.
  4. A surplus variable cannot form the starting basis, so for ≥\ge (and ==) constraints we add artificial variables and use the Big-M or two-phase method.
  5. In the optimal table, a basic slack (surplus) variable with a positive value shows a resource that is not fully used (a requirement over-met); a non-basic one shows a binding constraint, and its zj−cjz_j-c_j is the shadow price of that resource.

Example. 2x1+3x2≤122x_1+3x_2\le12 becomes 2x1+3x2+s1=122x_1+3x_2+s_1=12; x1+x2≥4x_1+x_2\ge4 becomes x1+x2−s2=4x_1+x_2-s_2=4.

✓ Answer checked step by step Every point was checked against the standard use of slack (≤) and surplus (≥) variables in converting an LPP to standard (equality) form.

↑ Back to the question list

Use the dual simplex method to solve the following Linear Programming Problem (LPP): Minimize Z=2x1+x2+3x3 subject to x1−2x2+x3≥4,2x1+x2+x3≤8,x1−x3≥0 and x1≥0,x2≥0,x3≥0

2026 · Paper II · Q3c(ii) · 15 marks

Solution

Setting up. Write Max Z′=−Z=−2x1−x2−3x3Z'=-Z=-2x_1-x_2-3x_3. Multiply the ≥\ge constraints by −1-1 so that every constraint is ≤\le, and add slacks: −x1+2x2−x3+s1=−42x1+x2+x3+s2=8−x1+x3+s3=0\begin{aligned}-x_1+2x_2-x_3+s_1&=-4\\ 2x_1+x_2+x_3+s_2&=8\\ -x_1+x_3+s_3&=0\end{aligned} With s1,s2,s3s_1,s_2,s_3 as the starting basis all zj−cj=2,1,3≥0z_j-c_j=2,1,3\ge0 (optimality holds), but s1=−4<0s_1=-4<0 (not feasible). This is exactly the situation for the dual simplex method: keep optimality, restore feasibility.

Rules. Leaving variable: the basic variable with the most negative value. Entering variable: among the columns with a negative entry arja_{rj} in that row, the one with the smallest |(zj−cj)/arj|\left|(z_j-c_j)/a_{rj}\right|.

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
s1s_1 0 −4 −1 2 −1 1 0 0
s2s_2 0 8 2 1 1 0 1 0
s3s_3 0 0 −1 0 1 0 0 1
zj−cjz_j-c_j 0 2 1 3 0 0 0

Leaving: s1s_1 (most negative xB=−4x_B=−4). Ratios |(zj−cj)/arj||(z_j-c_j)/a_{rj}| for arj<0a_{rj}<0: x1x_1: 2, x3x_3: 3; entering: x1x_1. Pivot element: −1.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
x1x_1 −2 4 1 −2 1 −1 0 0
s2s_2 0 0 0 5 −1 2 1 0
s3s_3 0 4 0 −2 2 −1 0 1
zj−cjz_j-c_j −8 0 5 1 2 0 0

All xB≥0x_B\ge0 and all zj−cj≥0z_j-c_j\ge0, so the table is optimal and feasible.

Answer. x1=4,x2=0,x3=0x_1=4,\;x_2=0,\;x_3=0, and maxZ′=−8\max Z'=-8, so minZ=8.\boxed{\min Z=8}. Check: 4−0+0=4≥44-0+0=4\ge4, 8+0+0=8≤88+0+0=8\le8, 4−0=4≥04-0=4\ge0.

✓ Checked by computer We checked in Python (scipy linprog): the minimum is Z = 8 at x₁ = 4, x₂ = x₃ = 0, the same as the dual simplex tables below (computed with exact fractions).

↑ Back to the question list

Use the penalty (Big M) method to solve the following linear programming problem: Minimize Z=5x1+3x2 subject to the constraints 2x1+4x2≤12,2x1+2x2=10,5x1+2x2≥10,x1,x2≥0

2025 · Paper II · Q4b · 15 marks

Solution

Standard form. Max Z′=−Z=−5x1−3x2Z'=-Z=-5x_1-3x_2. Add a slack s1s_1 to the first constraint, an artificial A1A_1 to the equation, and a surplus s2s_2 and artificial A2A_2 to the third. The artificials get a penalty −M-M in the (maximising) objective: Max Z′=−5x1−3x2+0s1+0s2−MA1−MA22x1+4x2+s1=122x1+2x2+A1=105x1+2x2−s2+A2=10\begin{aligned}\text{Max } Z'&=-5x_1-3x_2+0s_1+0s_2-MA_1-MA_2\\ 2x_1+4x_2+s_1&=12\\ 2x_1+2x_2+A_1&=10\\ 5x_1+2x_2-s_2+A_2&=10\end{aligned} Starting basis: s1=12,A1=10,A2=10s_1=12,\ A_1=10,\ A_2=10.

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
s1s_1 0 12 2 4 1 0 0 0 6
A1A_1 −M 10 2 2 0 0 1 0 5
A2A_2 −M 10 5 2 0 −1 0 1 2
zj−cjz_j-c_j −20M −7M+5 −4M+3 0 M 0 0

Entering: x1x_1 (most negative zj−cj=−7M+5z_j-c_j=−7M+5). Leaving: A2A_2 (smallest ratio 2). Pivot element: 5.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
s1s_1 0 8 0 16/5 1 2/5 0 −2/5 5/2
A1A_1 −M 6 0 6/5 0 2/5 1 −2/5 5
x1x_1 −5 2 1 2/5 0 −1/5 0 1/5 5
zj−cjz_j-c_j −6M−10 0 −6M/5+1 0 −2M/5+1 0 7M/5−1

Entering: x2x_2 (most negative zj−cj=−6M/5+1z_j-c_j=−6M/5+1). Leaving: s1s_1 (smallest ratio 5/2). Pivot element: 16/5.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
x2x_2 −3 5/2 0 1 5/16 1/8 0 −1/8 20
A1A_1 −M 3 0 0 −3/8 1/4 1 −1/4 12
x1x_1 −5 1 1 0 −1/8 −1/4 0 1/4 —
zj−cjz_j-c_j −3M−25/2 0 0 3M/8−5/16 −M/4+7/8 0 5M/4−7/8

Entering: s2s_2 (most negative zj−cj=−M/4+7/8z_j-c_j=−M/4+7/8). Leaving: A1A_1 (smallest ratio 12). Pivot element: 1/4.

Table 4.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2
x2x_2 −3 1 0 1 1/2 0 −1/2 0
s2s_2 0 12 0 0 −3/2 1 4 −1
x1x_1 −5 4 1 0 −1/2 0 1 0
zj−cjz_j-c_j −23 0 0 1 0 M−7/2 M

All zj−cj≥0z_j-c_j\ge0 and no artificial variable is in the basis, so this is optimal.

Answer. x1=4,x2=1x_1=4,\;x_2=1 (with s2=12s_2=12: the third constraint is over-satisfied by 12), and maxZ′=−23\max Z'=-23, so minZ=5(4)+3(1)=23.\boxed{\min Z=5(4)+3(1)=23}. Check: 8+4=12≤128+4=12\le12, 8+2=108+2=10, 20+2=22≥1020+2=22\ge10.

✓ Checked by computer We checked in Python (scipy linprog): the minimum is Z = 23 at x₁ = 4, x₂ = 1, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

A Linear Programming Problem (LPP) in standard form is as given below: Optimize Z=CTX subject to AX=B with X≥0 Write down the Dual Simplex form and its iterative procedure.

2024 · Paper II · Q1d · 10 marks

Solution

Dual simplex form. Take the problem Max Z=CTXsubject toAX=b,X≥0\text{Max } Z=C^TX\quad\text{subject to}\quad AX=b,\;X\ge0 (a minimisation is turned into maximisation of −Z-Z). The dual simplex method needs a starting basis BB that is dual feasible, i.e. optimal: zj−cj=CBTB−1aj−cj≥0for all j,z_j-c_j=C_B^TB^{-1}a_j-c_j\ge0\quad\text{for all }j, but it may be primal infeasible: some components of XB=B−1bX_B=B^{-1}b are negative. In practice we get this form by writing every ≥\ge constraint as ≤\le (multiplying by −1-1) and adding slacks, so that the slacks form an identity basis, provided all cj≤0c_j\le0 in the maximisation form (that is, all costs non-negative in a minimisation problem).

The method keeps optimality (zj−cj≥0z_j-c_j\ge0) at every step and moves towards feasibility. It is the simplex method applied to the dual, carried out on the primal table.

Iterative procedure.

  1. Initial table. Convert to maximisation, make all constraints ≤\le, add slacks, and form the table. Check that all zj−cj≥0z_j-c_j\ge0. (If not, the dual simplex method cannot be used directly.)
  2. Feasibility test. If all xBi≥0x_{Bi}\ge0, the current solution is optimal and feasible: stop.
  3. Leaving variable. Otherwise choose the row rr with the most negative xBrx_{Br}: xBr=mini{xBi:xBi<0}.x_{Br}=\min_i\{x_{Bi}:x_{Bi}<0\}. The basic variable of row rr leaves the basis.
  4. Infeasibility test. If every entry arj≥0a_{rj}\ge0 in row rr, the problem has no feasible solution (the dual is unbounded): stop.
  5. Entering variable. Among the columns with arj<0a_{rj}<0, compute the ratios |zj−cjarj|,\left|\frac{z_j-c_j}{a_{rj}}\right| , and let xkx_k be the one with the smallest ratio. This choice keeps all zj−cj≥0z_j-c_j\ge0 after pivoting.
  6. Pivot on arka_{rk} exactly as in the ordinary simplex method (divide row rr by arka_{rk} and make all other entries of column kk zero).
  7. Return to step 2.

Why the ratio rule works. After the pivot, the new zj−cjz_j-c_j are (zj−cj)′=(zj−cj)−arjark(zk−ck).(z_j-c_j)'=(z_j-c_j)-\frac{a_{rj}}{a_{rk}}(z_k-c_k). Since ark<0a_{rk}<0 and zk−ck≥0z_k-c_k\ge0, the change is non-negative for arj≥0a_{rj}\ge0; for arj<0a_{rj}<0 it stays ≥0\ge0 exactly when |(zj−cj)/arj|≥|(zk−ck)/ark|\left|(z_j-c_j)/a_{rj}\right|\ge\left|(z_k-c_k)/a_{rk}\right|, which the minimum-ratio choice guarantees. The objective value ZZ decreases (moves towards the true optimum from above) at each step, and xBrx_{Br} becomes positive.

Comparison with the primal simplex.

Primal simplex Dual simplex
Starts from feasible, not optimal optimal, not feasible
First choose entering variable (most negative zj−cjz_j-c_j) leaving variable (most negative xBx_B)
Then choose leaving variable by min ratio xBi/aikx_{Bi}/a_{ik}, aik>0a_{ik}>0 entering variable by min |(zj−cj)/arj|\lvert(z_j-c_j)/a_{rj}\rvert, arj<0a_{rj}<0
Stops when all zj−cj≥0z_j-c_j\ge0 all xB≥0x_B\ge0

It avoids artificial variables and is the standard tool for re-optimising after a constraint is added or bb is changed (sensitivity analysis).

✓ Answer checked step by step Every step was checked against the standard dual simplex algorithm (Lemke): it starts from a dual-feasible (optimal) but primal-infeasible basis, removes the most negative basic variable, and enters by the minimum ratio |(z_j − c_j)/a_rj| over a_rj < 0.

↑ Back to the question list

Use simplex method to solve the following LPP: Maximize z=5x1+2x2 subject to 6x1+x2≥6,4x1+3x2≥12,x1+2x2≥4,x1≥0,x2≥0

2024 · Paper II · Q2c · 20 marks

Solution

Standard form. All three constraints are ≥\ge. Subtract surplus variables and add artificial variables with penalty −M-M: Max z=5x1+2x2−MA1−MA2−MA36x1+x2−s1+A1=64x1+3x2−s2+A2=12x1+2x2−s3+A3=4\begin{aligned}\text{Max } z&=5x_1+2x_2-MA_1-MA_2-MA_3\\ 6x_1+x_2-s_1+A_1&=6\\ 4x_1+3x_2-s_2+A_2&=12\\ x_1+2x_2-s_3+A_3&=4\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
A1A_1 −M 6 6 1 −1 0 0 1 0 0 1
A2A_2 −M 12 4 3 0 −1 0 0 1 0 3
A3A_3 −M 4 1 2 0 0 −1 0 0 1 4
zj−cjz_j-c_j −22M −11M−5 −6M−2 M M M 0 0 0

Entering: x1x_1 (most negative zj−cj=−11M−5z_j-c_j=−11M−5). Leaving: A1A_1 (smallest ratio 1). Pivot element: 6.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 5 1 1 1/6 −1/6 0 0 1/6 0 0 6
A2A_2 −M 8 0 7/3 2/3 −1 0 −2/3 1 0 24/7
A3A_3 −M 3 0 11/6 1/6 0 −1 −1/6 0 1 18/11
zj−cjz_j-c_j −11M+5 0 −25M/6−7/6 −5M/6−5/6 M M 11M/6+5/6 0 0

Entering: x2x_2 (most negative zj−cj=−25M/6−7/6z_j-c_j=−25M/6−7/6). Leaving: A3A_3 (smallest ratio 18/11). Pivot element: 11/6.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 5 8/11 1 0 −2/11 0 1/11 2/11 0 −1/11 8
A2A_2 −M 46/11 0 0 5/11 −1 14/11 −5/11 1 −14/11 23/7
x2x_2 2 18/11 0 1 1/11 0 −6/11 −1/11 0 6/11 —
zj−cjz_j-c_j −46M/11+76/11 0 0 −5M/11−8/11 M −14M/11−7/11 16M/11+8/11 0 25M/11+7/11

Entering: s3s_3 (most negative zj−cj=−14M/11−7/11z_j-c_j=−14M/11−7/11). Leaving: A2A_2 (smallest ratio 23/7). Pivot element: 14/11.

Table 4.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 5 3/7 1 0 −3/14 1/14 0 3/14 −1/14 0 —
s3s_3 0 23/7 0 0 5/14 −11/14 1 −5/14 11/14 −1 46/5
x2x_2 2 24/7 0 1 2/7 −3/7 0 −2/7 3/7 0 12
zj−cjz_j-c_j 9 0 0 −1/2 −1/2 0 M+1/2 M+1/2 M

Entering: s1s_1 (most negative zj−cj=−1/2z_j-c_j=−1/2). Leaving: s3s_3 (smallest ratio 46/5). Pivot element: 5/14.

Table 5.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 5 12/5 1 0 0 −2/5 3/5 0 2/5 −3/5 —
s1s_1 0 46/5 0 0 1 −11/5 14/5 −1 11/5 −14/5 —
x2x_2 2 4/5 0 1 0 1/5 −4/5 0 −1/5 4/5 4
zj−cjz_j-c_j 68/5 0 0 0 −8/5 7/5 M M+8/5 M−7/5

Entering: s2s_2 (most negative zj−cj=−8/5z_j-c_j=−8/5). Leaving: x2x_2 (smallest ratio 4). Pivot element: 1/5.

Table 6.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 5 4 1 2 0 0 −1 0 0 1 —
s1s_1 0 18 0 11 1 0 −6 −1 0 6 —
s2s_2 0 4 0 5 0 1 −4 0 −1 4 —
zj−cjz_j-c_j 20 0 8 0 0 −5 M M M+5

s3s_3 can enter (z_j − c_j = −5), but no entry of its column is positive, so the solution is unbounded.

Conclusion. The variable s3s_3 has zj−cj=−5<0z_j-c_j=-5<0, so zz can still be increased, but there is no positive entry in its column: s3s_3 can be increased without limit while all basic variables stay non-negative (x1=4+s3x_1=4+s_3, s1=18+6s3s_1=18+6s_3, s2=4+4s3s_2=4+4s_3). Hence the problem has an unbounded solution: zz can be made as large as we like.

This is also clear directly: all constraints are ≥\ge with positive coefficients, so the feasible region extends without limit to the right, and for x2=0x_2=0, x1=t≥4x_1=t\ge4 every constraint holds while z=5t→∞z=5t\to\infty.

✓ Checked by computer We checked in Python: scipy linprog reports the problem as unbounded, and in the exact Big-M tables below the column of s₃ in Table 6 has no positive entry.

↑ Back to the question list

With respect to a given Linear Programming Problem (LPP), explain the following concepts: (i) Extreme Point Solutions (ii) Duality Theorem (iii) Complementary Slackness Principle.

2024 · Paper II · Q3a · 15 marks

Solution

Consider the LPP (P)Max Z=CTX,AX≤b,X≥0,\text{(P)}\quad\text{Max }Z=C^TX,\quad AX\le b,\;X\ge0, with dual (D)Min W=bTY,ATY≥C,Y≥0.\text{(D)}\quad\text{Min }W=b^TY,\quad A^TY\ge C,\;Y\ge0 .

(i) Extreme point solutions. The feasible set S={X:AX≤b,X≥0}S=\{X:AX\le b,\ X\ge0\} is a convex polyhedron. A point X∈SX\in S is an extreme point (corner, vertex) if it cannot be written as λX1+(1−λ)X2\lambda X_1+(1-\lambda)X_2 with X1≠X2X_1\ne X_2 in SS and 0<λ<10<\lambda<1; that is, it does not lie strictly inside any line segment of SS.

  • After adding slacks, a solution of AX=bAX=b obtained by setting n−mn-m variables to zero and solving for the other mm (with linearly independent columns) is a basic solution; if it is also non-negative it is a basic feasible solution (BFS).
  • Key result: the basic feasible solutions are exactly the extreme points of SS. There are at most (nm)\binom nm of them.
  • Fundamental theorem: if the LPP has an optimal solution, at least one extreme point is optimal. So we need only examine extreme points, and the simplex method moves from one extreme point to an adjacent better one.
  • Graphically, extreme points are the corners of the feasible polygon.

(ii) Duality theorem.

  • Weak duality: if XX is feasible for (P) and YY for (D), then CTX≤bTYC^TX\le b^TY. (Proof: CTX≤(ATY)TX=YTAX≤YTbC^TX\le(A^TY)^TX=Y^TAX\le Y^Tb.)
  • Consequence: if CTX*=bTY*C^TX^*=b^TY^* for feasible X*X^*, Y*Y^*, both are optimal.
  • Strong duality (fundamental duality theorem): if either (P) or (D) has a finite optimal solution, so does the other, and maxZ=minW.\max Z=\min W . In the optimal simplex table of (P), the optimal dual values are Y*T=CBTB−1Y^{*T}=C_B^TB^{-1}, read off as the zj−cjz_j-c_j of the slack columns.
  • Other cases: if one problem is unbounded, the other is infeasible; both may be infeasible.

(iii) Complementary slackness principle. Feasible X*X^* and Y*Y^* are optimal for (P) and (D) if and only if yi*(bi−∑jaijxj*)=0(i=1,…,m),xj*(∑iaijyi*−cj)=0(j=1,…,n).y_i^*\Big(b_i-\sum_j a_{ij}x_j^*\Big)=0\quad(i=1,\dots,m),\qquad x_j^*\Big(\sum_i a_{ij}y_i^*-c_j\Big)=0\quad(j=1,\dots,n). In words:

  • if a primal constraint is slack (resource not fully used), its dual price is zero; if a dual variable (shadow price) is positive, the corresponding resource is fully used;
  • if a primal variable is positive (product made), the corresponding dual constraint holds with equality (the imputed cost of its resources equals its profit); if a dual constraint is strict, the product is not made.

Proof. For feasible X,YX,Y: bTY−CTX=YT(b−AX)+XT(ATY−C)b^TY-C^TX=Y^T(b-AX)+X^T(A^TY-C). Both terms are sums of non-negative products. By strong duality, optimality means the left side is 0, so every product is 0; conversely if all products are 0 the two objective values are equal and both solutions are optimal by weak duality. ∎

The principle is used to find the dual solution from the primal one (and vice versa) and gives the economic meaning of shadow prices.

✓ Answer checked step by step Every statement was checked against the standard theory: basic feasible solutions are the extreme points of the feasible set, the duality theorem (weak and strong forms) and the complementary slackness conditions.

↑ Back to the question list

Solve the following linear programming problem by using graphical approach: Minimize 4x1+5x2+6x3 Subject to x1+x2≥11,x1−x2≤5,x3−x1−x2=0,7x1+12x2≥35,x1≥0,x2≥0,x3≥0

2023 · Paper II · Q1c · 10 marks

Solution

Reduce to two variables. The equality constraint gives x3=x1+x2x_3=x_1+x_2 (and then x3≥0x_3\ge0 holds automatically). Substituting, Z=4x1+5x2+6(x1+x2)=10x1+11x2.Z=4x_1+5x_2+6(x_1+x_2)=10x_1+11x_2 . The problem becomes: minimise Z=10x1+11x2Z=10x_1+11x_2 subject to x1+x2≥11,x1−x2≤5,7x1+12x2≥35,x1,x2≥0.x_1+x_2\ge11,\qquad x_1-x_2\le5,\qquad 7x_1+12x_2\ge35,\qquad x_1,x_2\ge0 .

Graph. Draw the lines

  • x1+x2=11x_1+x_2=11 through (11,0)(11,0) and (0,11)(0,11); feasible side away from the origin;
  • x1−x2=5x_1-x_2=5 through (5,0)(5,0) and (10,5)(10,5); feasible side above (towards the x2x_2-axis);
  • 7x1+12x2=357x_1+12x_2=35 through (5,0)(5,0) and (0,35/12)(0,35/12); feasible side away from the origin. This line lies entirely below x1+x2=11x_1+x_2=11 in the first quadrant, so it is redundant.
04812160481216x₁x₂B (8, 3)A (0, 11)feasible
Shaded: feasible region (unbounded upwards). Blue: x₁ + x₂ = 11; gold: x₁ − x₂ = 5; grey dashed: 7x₁ + 12x₂ = 35 (redundant); red dashed: 10x₁ + 11x₂ = 113, touching the region at B (8, 3).

The feasible region is unbounded (it extends upwards), but the costs are positive, so a minimum exists. Its corner points are:

  • A=(0,11)A=(0,11): Z=121Z=121;
  • BB, where x1+x2=11x_1+x_2=11 meets x1−x2=5x_1-x_2=5: x1=8,x2=3x_1=8,\ x_2=3, Z=80+33=113Z=80+33=113.

Answer. The minimum is at BB: x1=8,x2=3,x3=11,minZ=4(8)+5(3)+6(11)=113.x_1=8,\quad x_2=3,\quad x_3=11,\qquad \boxed{\min Z=4(8)+5(3)+6(11)=113}. (The iso-cost line 10x1+11x2=11310x_1+11x_2=113 touches the region only at BB.)

✓ Checked by computer We checked in Python (scipy linprog): the minimum is 113 at x₁ = 8, x₂ = 3, x₃ = 11; the corner values were recomputed by hand and in Python.

↑ Back to the question list

Solve the following Linear Programming problem using Two Phase method: Maximize Z=3x1−x2 Subject to 2x1+x2≥2,x1+3x2≤2,x2≤4,x1≥0,x2≥0

2023 · Paper II · Q3a · 15 marks

Solution

Standard form. 2x1+x2−s1+A1=2x1+3x2+s2=2x2+s3=4\begin{aligned}2x_1+x_2-s_1+A_1&=2\\ x_1+3x_2+s_2&=2\\ x_2+s_3&=4\end{aligned} Only the first constraint needs an artificial variable.

Phase I. Maximise Z*=−A1Z^*=-A_1 (i.e. minimise the artificial variable). Costs: −1-1 for A1A_1, 0 for all others.

Phase I, table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
A1A_1 −1 2 2 1 −1 0 0 1 1
s2s_2 0 2 1 3 0 1 0 0 2
s3s_3 0 4 0 1 0 0 1 0 —
zj−cjz_j-c_j −2 −2 −1 1 0 0 0

Entering: x1x_1 (most negative zj−cj=−2z_j-c_j=−2). Leaving: A1A_1 (smallest ratio 1). Pivot element: 2.

Phase I, table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1
x1x_1 0 1 1 1/2 −1/2 0 0 1/2
s2s_2 0 1 0 5/2 1/2 1 0 −1/2
s3s_3 0 4 0 1 0 0 1 0
zj−cjz_j-c_j 0 0 0 0 0 0 1

maxZ*=0\max Z^*=0 and A1A_1 has left the basis, so the original problem is feasible and Table 2 gives a basic feasible solution.

Phase II. Drop the A1A_1 column, put back the original costs c=(3,−1,0,0,0)c=(3,-1,0,0,0) and continue.

Phase II, table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 Ratio
x1x_1 3 1 1 1/2 −1/2 0 0 —
s2s_2 0 1 0 5/2 1/2 1 0 2
s3s_3 0 4 0 1 0 0 1 —
zj−cjz_j-c_j 3 0 5/2 −3/2 0 0

Entering: s1s_1 (most negative zj−cj=−3/2z_j-c_j=−3/2). Leaving: s2s_2 (smallest ratio 2). Pivot element: 1/2.

Phase II, table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3
x1x_1 3 2 1 3 0 1 0
s1s_1 0 2 0 5 1 2 0
s3s_3 0 4 0 1 0 0 1
zj−cjz_j-c_j 6 0 10 0 3 0

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=2,x2=0,maxZ=6.x_1=2,\quad x_2=0,\qquad\boxed{\max Z=6}. Here s1=2s_1=2 (the first constraint is exceeded by 2) and s3=4s_3=4.

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 6 at x₁ = 2, x₂ = 0, the same as the two-phase tables below (exact fractions).

↑ Back to the question list

Write down the dual for the given primal problem. Max Z=6x1−5x2+7x3+x4 Subject to 2x1+4x2−x3+x4≤4,x1−x2+6x3+7x4≥5,2x1+2x2+4x3+5x4=6,x1+8x2+x3=7 x1 and x4 unrestricted, x2≥0,x3≥0

2023 · Paper II · Q3b(ii) · 5 marks

Solution

Rules (primal maximisation).

  • Each primal constraint gives a dual variable: ≤\le → yi≥0y_i\ge0; ≥\ge → yi≤0y_i\le0; == → yiy_i unrestricted.
  • Each primal variable gives a dual constraint: xj≥0x_j\ge0 → “≥cj\ge c_j”; xjx_j unrestricted → “=cj=c_j”.
  • Dual objective: minimise ∑biyi\sum b_iy_i; dual constraint jj uses column jj of AA.

Primal data.

x1x_1 x2x_2 x3x_3 x4x_4 bb dual var.
Row 1 2 4 −1 1 ≤\le 4 y1≥0y_1\ge0
Row 2 1 −1 6 7 ≥\ge 5 y2≤0y_2\le0
Row 3 2 2 4 5 == 6 y3y_3 unrestricted
Row 4 1 8 1 0 == 7 y4y_4 unrestricted
cc 6 −5 7 1
sign unrestr. ≥0\ge0 ≥0\ge0 unrestr.

Dual. Minimise W=4y1+5y2+6y3+7y4\text{Minimise }W=4y_1+5y_2+6y_3+7y_4 subject to 2y1+y2+2y3+y4=6(x1 unrestricted)4y1−y2+2y3+8y4≥−5(x2≥0)−y1+6y2+4y3+y4≥7(x3≥0)y1+7y2+5y3=1(x4 unrestricted)\begin{aligned}2y_1+y_2+2y_3+y_4&=6 &&(x_1\text{ unrestricted})\\ 4y_1-y_2+2y_3+8y_4&\ge-5 &&(x_2\ge0)\\ -y_1+6y_2+4y_3+y_4&\ge7 &&(x_3\ge0)\\ y_1+7y_2+5y_3&=1 &&(x_4\text{ unrestricted})\end{aligned} y1≥0,y2≤0,y3,y4unrestricted in sign.y_1\ge0,\qquad y_2\le0,\qquad y_3,\ y_4\ \text{unrestricted in sign}.

(Equivalently, put y2=−y2′y_2=-y_2' with y2′≥0y_2'\ge0, i.e. first write constraint 2 as −x1+x2−6x3−7x4≤−5-x_1+x_2-6x_3-7x_4\le-5.)

✓ Checked by computer Every step was checked: the rules primal max ⇄ dual min, ≤ constraint ↔︎ y ≥ 0, ≥ ↔︎ y ≤ 0, = ↔︎ y unrestricted, x ≥ 0 ↔︎ dual ≥, x unrestricted ↔︎ dual =.

↑ Back to the question list

Use penalty method to solve the following linear programming problem: Maximize Z=x1+2x2+3x3−x4 subject to the constraints x1+2x2+3x3=15,2x1+x2+5x3=20,x1+2x2+x3+x4=10,x1,x2,x3,x4≥0

2022 · Paper II · Q4a · 20 marks

Solution

Starting basis. The third constraint already contains x4x_4 with coefficient 1, and x4x_4 appears in no other constraint, so x4x_4 can start in the basis. Artificial variables A1A_1, A2A_2 (penalty −M-M) are needed for the first two equations: Max Z=x1+2x2+3x3−x4−MA1−MA2x1+2x2+3x3+A1=152x1+x2+5x3+A2=20x1+2x2+x3+x4=10\begin{aligned}\text{Max } Z&=x_1+2x_2+3x_3-x_4-MA_1-MA_2\\ x_1+2x_2+3x_3+A_1&=15\\ 2x_1+x_2+5x_3+A_2&=20\\ x_1+2x_2+x_3+x_4&=10\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 x4x_4 A1A_1 A2A_2 Ratio
A1A_1 −M 15 1 2 3 0 1 0 5
A2A_2 −M 20 2 1 5 0 0 1 4
x4x_4 −1 10 1 2 1 1 0 0 10
zj−cjz_j-c_j −35M−10 −3M−2 −3M−4 −8M−4 0 0 0

Entering: x3x_3 (most negative zj−cj=−8M−4z_j-c_j=−8M−4). Leaving: A2A_2 (smallest ratio 4). Pivot element: 5.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 x4x_4 A1A_1 A2A_2 Ratio
A1A_1 −M 3 −1/5 7/5 0 0 1 −3/5 15/7
x3x_3 3 4 2/5 1/5 1 0 0 1/5 20
x4x_4 −1 6 3/5 9/5 0 1 0 −1/5 10/3
zj−cjz_j-c_j −3M+6 M/5−2/5 −7M/5−16/5 0 0 0 8M/5+4/5

Entering: x2x_2 (most negative zj−cj=−7M/5−16/5z_j-c_j=−7M/5−16/5). Leaving: A1A_1 (smallest ratio 15/7). Pivot element: 7/5.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 x4x_4 A1A_1 A2A_2 Ratio
x2x_2 2 15/7 −1/7 1 0 0 5/7 −3/7 —
x3x_3 3 25/7 3/7 0 1 0 −1/7 2/7 25/3
x4x_4 −1 15/7 6/7 0 0 1 −9/7 4/7 5/2
zj−cjz_j-c_j 90/7 −6/7 0 0 0 M+16/7 M−4/7

Entering: x1x_1 (most negative zj−cj=−6/7z_j-c_j=−6/7). Leaving: x4x_4 (smallest ratio 5/2). Pivot element: 6/7.

Table 4.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 x4x_4 A1A_1 A2A_2
x2x_2 2 5/2 0 1 0 1/6 1/2 −1/3
x3x_3 3 5/2 0 0 1 −1/2 1/2 0
x1x_1 1 5/2 1 0 0 7/6 −3/2 2/3
zj−cjz_j-c_j 15 0 0 0 1 M+1 M

All zj−cj≥0z_j-c_j\ge0 and both artificial variables are zero (non-basic), so the solution is optimal.

Answer. x1=52,x2=52,x3=52,x4=0,maxZ=15.x_1=\tfrac52,\quad x_2=\tfrac52,\quad x_3=\tfrac52,\quad x_4=0,\qquad\boxed{\max Z=15}. Check: 52+5+152=15\tfrac52+5+\tfrac{15}2=15, 5+52+252=205+\tfrac52+\tfrac{25}2=20, 52+5+52+0=10\tfrac52+5+\tfrac52+0=10; Z=52+5+152=15Z=\tfrac52+5+\tfrac{15}2=15.

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 15 at x₁ = x₂ = x₃ = 5/2, x₄ = 0, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

Use two-phase method to solve: Maximize z=2x1+x2+x3 subject to the constraints 4x1+6x2+3x3≤8,3x1−6x2−4x3≤1,2x1+3x2−5x3≥4 and x1,x2,x3≥0.

2021 · Paper II · Q3c · 20 marks

Solution

Standard form. 4x1+6x2+3x3+s1=83x1−6x2−4x3+s2=12x1+3x2−5x3−s3+A1=4\begin{aligned}4x_1+6x_2+3x_3+s_1&=8\\ 3x_1-6x_2-4x_3+s_2&=1\\ 2x_1+3x_2-5x_3-s_3+A_1&=4\end{aligned}

Phase I. Maximise z*=−A1z^*=-A_1.

Phase I, table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
s1s_1 0 8 4 6 3 1 0 0 0 4/3
s2s_2 0 1 3 −6 −4 0 1 0 0 —
A1A_1 −1 4 2 3 −5 0 0 −1 1 4/3
zj−cjz_j-c_j −4 −2 −3 5 0 0 1 0

Entering: x2x_2 (most negative zj−cj=−3z_j-c_j=−3). Leaving: A1A_1 (smallest ratio 4/3). Pivot element: 3.

Phase I, table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 A1A_1
s1s_1 0 0 0 0 13 1 0 2 −2
s2s_2 0 9 7 0 −14 0 1 −2 2
x2x_2 0 4/3 2/3 1 −5/3 0 0 −1/3 1/3
zj−cjz_j-c_j 0 0 0 0 0 0 0 1

(In Table 1 there is a tie between s1s_1 and A1A_1 for leaving; we remove the artificial variable.) maxz*=0\max z^*=0 with A1A_1 out of the basis, so a feasible solution exists. Note that s1=0s_1=0 is basic: the solution is degenerate.

Phase II. Drop A1A_1, restore the costs (2,1,1,0,0,0)(2,1,1,0,0,0).

Phase II, table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 0 0 0 13 1 0 2 0
s2s_2 0 9 7 0 −14 0 1 −2 —
x2x_2 1 4/3 2/3 1 −5/3 0 0 −1/3 —
zj−cjz_j-c_j 4/3 −4/3 0 −8/3 0 0 −1/3

Entering: x3x_3 (most negative zj−cj=−8/3z_j-c_j=−8/3). Leaving: s1s_1 (smallest ratio 0). Pivot element: 13.

Phase II, table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
x3x_3 1 0 0 0 1 1/13 0 2/13 —
s2s_2 0 9 7 0 0 14/13 1 2/13 9/7
x2x_2 1 4/3 2/3 1 0 5/39 0 −1/13 2
zj−cjz_j-c_j 4/3 −4/3 0 0 8/39 0 1/13

Entering: x1x_1 (most negative zj−cj=−4/3z_j-c_j=−4/3). Leaving: s2s_2 (smallest ratio 9/7). Pivot element: 7.

Phase II, table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
x3x_3 1 0 0 0 1 1/13 0 2/13
x1x_1 2 9/7 1 0 0 2/13 1/7 2/91
x2x_2 1 10/21 0 1 0 1/39 −2/21 −25/273
zj−cjz_j-c_j 64/21 0 0 0 16/39 4/21 29/273

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=97,x2=1021,x3=0,maxz=6421≈3.05.x_1=\tfrac97,\quad x_2=\tfrac{10}{21},\quad x_3=0,\qquad\boxed{\max z=\tfrac{64}{21}\approx3.05}. Check: 367+6021=8\tfrac{36}7+\tfrac{60}{21}=8, 277−6021=1\tfrac{27}7-\tfrac{60}{21}=1, 187+3021=4\tfrac{18}7+\tfrac{30}{21}=4 (all three constraints are binding).

✓ Checked by computer We checked in Python (scipy linprog): the maximum is z = 64/21 ≈ 3.048 at x₁ = 9/7, x₂ = 10/21, x₃ = 0, the same as the two-phase tables below (exact fractions).

↑ Back to the question list

Solve the following linear programming problem: Maximize z=3x1+5x2 subject to the constraints 3x1+2x2≤18,x1≤4,x2≤6 and x1,x2≥0. Discuss the change in Cj on the optimality of the optimal basic feasible solution.

2021 · Paper II · Q4a · 15 marks

Solution

Simplex solution. Add slacks: 3x1+2x2+s1=183x_1+2x_2+s_1=18, x1+s2=4x_1+s_2=4, x2+s3=6x_2+s_3=6.

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 18 3 2 1 0 0 9
s2s_2 0 4 1 0 0 1 0 —
s3s_3 0 6 0 1 0 0 1 6
zj−cjz_j-c_j 0 −3 −5 0 0 0

Entering: x2x_2 (most negative zj−cj=−5z_j-c_j=−5). Leaving: s3s_3 (smallest ratio 6). Pivot element: 1.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 6 3 0 1 0 −2 2
s2s_2 0 4 1 0 0 1 0 4
x2x_2 5 6 0 1 0 0 1 —
zj−cjz_j-c_j 30 −3 0 0 0 5

Entering: x1x_1 (most negative zj−cj=−3z_j-c_j=−3). Leaving: s1s_1 (smallest ratio 2). Pivot element: 3.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3
x1x_1 3 2 1 0 1/3 0 −2/3
s2s_2 0 2 0 0 −1/3 1 2/3
x2x_2 5 6 0 1 0 0 1
zj−cjz_j-c_j 36 0 0 1 0 3

Optimal solution: x1=2,x2=6x_1=2,\ x_2=6 (s2=2s_2=2), maxz=36\boxed{\max z=36}.

Effect of changes in cjc_j (sensitivity analysis). A change in a cost coefficient does not affect feasibility (XB=B−1bX_B=B^{-1}b is unchanged); it changes only the zj−cjz_j-c_j row. The current solution stays optimal as long as every zj−cjz_j-c_j of the non-basic variables (s1s_1, s3s_3) stays ≥0\ge0.

Change in c1c_1 (basic variable). With c1c_1 general, the rows of x1x_1 (13,−23\tfrac13,-\tfrac23 under s1,s3s_1,s_3) and x2x_2 (0,10,1) give zs1−0=c13≥0,zs3−0=−2c13+5≥0.z_{s_1}-0=\frac{c_1}3\ge0,\qquad z_{s_3}-0=-\frac{2c_1}3+5\ge0 . So the solution stays optimal for 0≤c1≤152(current c1=3).\boxed{0\le c_1\le\tfrac{15}2}\quad(\text{current }c_1=3).

Change in c2c_2. With c2c_2 general: zs1=33=1≥0,zs3=−2+c2≥0.z_{s_1}=\frac33=1\ge0,\qquad z_{s_3}=-2+c_2\ge0 . So it stays optimal for c2≥2(current c2=5).\boxed{c_2\ge2}\quad(\text{current }c_2=5).

Interpretation. Within these ranges, x1=2x_1=2, x2=6x_2=6 remains the best plan; only z=2c1+6c2z=2c_1+6c_2 changes. If c1>7.5c_1>7.5, s3s_3 enters (we should produce more of x1x_1 and less of x2x_2, moving to the corner x1=4,x2=3x_1=4,\ x_2=3); if c2<2c_2<2, s3s_3 enters as well and x2x_2 is reduced. A change in the cost of a non-basic variable affects only its own zj−cjz_j-c_j; e.g. if a slack had a cost, the solution stays optimal as long as that zj−cj≥0z_j-c_j\ge0.

✓ Checked by computer We checked in Python (scipy linprog): the optimum is z = 36 at x₁ = 2, x₂ = 6; the ranges 0 ≤ c₁ ≤ 15/2 and c₂ ≥ 2 were checked by re-solving at the end points.

↑ Back to the question list

Define the concept of duality in Linear Programming Problem (LPP). Write down the dual of the following LPP: Maximize Z=2x1+5x2+6x3 subject to the constraints 5x1+6x2−x3≤3,−2x1+x2+4x3≤4,x1−5x2+3x3≤1,−3x1−3x2+7x3≤6,x1,x2,x3≥0

2020 · Paper II · Q1c · 10 marks

Solution

Duality. Every LPP (the primal) has an associated LPP, its dual, formed from the same data. If the primal is Max Z=CTX,AX≤b,X≥0,\text{Max }Z=C^TX,\quad AX\le b,\quad X\ge0, its dual is Min W=bTY,ATY≥C,Y≥0.\text{Min }W=b^TY,\quad A^TY\ge C,\quad Y\ge0 .

  • One dual variable for each primal constraint, and one dual constraint for each primal variable.
  • The right-hand sides of one become the objective coefficients of the other, and the coefficient matrix is transposed.
  • Max becomes Min, and ≤\le becomes ≥\ge.
  • The dual of the dual is the primal. If either problem has a finite optimum, so does the other, with equal objective values; the optimal dual variables are the shadow prices of the primal resources.

Dual of the given problem. Here A=(56−1−2141−53−3−37),b=(3416),C=(256).A=\begin{pmatrix}5&6&-1\\-2&1&4\\1&-5&3\\-3&-3&7\end{pmatrix},\quad b=\begin{pmatrix}3\\4\\1\\6\end{pmatrix},\quad C=\begin{pmatrix}2\\5\\6\end{pmatrix}. With dual variables y1,y2,y3,y4y_1,y_2,y_3,y_4 for the four constraints: Minimise W=3y1+4y2+y3+6y4\text{Minimise }W=3y_1+4y_2+y_3+6y_4 subject to 5y1−2y2+y3−3y4≥26y1+y2−5y3−3y4≥5−y1+4y2+3y3+7y4≥6y1,y2,y3,y4≥0.\begin{aligned}5y_1-2y_2+y_3-3y_4&\ge2\\ 6y_1+y_2-5y_3-3y_4&\ge5\\ -y_1+4y_2+3y_3+7y_4&\ge6\end{aligned}\qquad y_1,y_2,y_3,y_4\ge0 .

✓ Checked by computer Every step was checked: for a maximisation primal with ≤ constraints and x ≥ 0, the dual is a minimisation with ≥ constraints, the transposed matrix and y ≥ 0.

↑ Back to the question list

Explain the general Linear Programming Problem. Solve the following LPP by Charnes’ Big-M method: Minimize Z=2x1+x2 subject to the constraints 3x1+x2=3,4x1+3x2≥6,x1+2x2≤3,x1≥0,x2≥0

2020 · Paper II · Q3c · 20 marks

Solution

General LPP. Find x1,…,xnx_1,\dots,x_n that optimise (maximise or minimise) Z=c1x1+c2x2+…+cnxnZ=c_1x_1+c_2x_2+\dots+c_nx_n subject to mm linear constraints ai1x1+ai2x2+…+ainxn(≤,=,≥)bi,i=1,…,m,a_{i1}x_1+a_{i2}x_2+\dots+a_{in}x_n\ (\le,=,\ge)\ b_i,\qquad i=1,\dots,m, and the non-negativity restrictions xj≥0x_j\ge0. In matrix form: optimise Z=CTXZ=C^TX subject to AX(≤,=,≥)bAX\ (\le,=,\ge)\ b, X≥0X\ge0.

  • ZZ is the objective function, cjc_j the cost/profit coefficients, aija_{ij} the technological coefficients, bib_i the resources or requirements.
  • It assumes proportionality, additivity, divisibility and certainty of the data, and a finite number of activities.

Big-M solution. Max Z′=−Z=−2x1−x2Z'=-Z=-2x_1-x_2. The equation gets an artificial A1A_1; the ≥\ge constraint a surplus s1s_1 and artificial A2A_2; the ≤\le constraint a slack s2s_2: Max Z′=−2x1−x2−MA1−MA23x1+x2+A1=34x1+3x2−s1+A2=6x1+2x2+s2=3\begin{aligned}\text{Max }Z'&=-2x_1-x_2-MA_1-MA_2\\ 3x_1+x_2+A_1&=3\\ 4x_1+3x_2-s_1+A_2&=6\\ x_1+2x_2+s_2&=3\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
A1A_1 −M 3 3 1 0 0 1 0 1
A2A_2 −M 6 4 3 −1 0 0 1 3/2
s2s_2 0 3 1 2 0 1 0 0 3
zj−cjz_j-c_j −9M −7M+2 −4M+1 M 0 0 0

Entering: x1x_1 (most negative zj−cj=−7M+2z_j-c_j=−7M+2). Leaving: A1A_1 (smallest ratio 1). Pivot element: 3.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
x1x_1 −2 1 1 1/3 0 0 1/3 0 3
A2A_2 −M 2 0 5/3 −1 0 −4/3 1 6/5
s2s_2 0 2 0 5/3 0 1 −1/3 0 6/5
zj−cjz_j-c_j −2M−2 0 −5M/3+1/3 M 0 7M/3−2/3 0

Entering: x2x_2 (most negative zj−cj=−5M/3+1/3z_j-c_j=−5M/3+1/3). Leaving: A2A_2 (smallest ratio 6/5). Pivot element: 5/3.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2
x1x_1 −2 3/5 1 0 1/5 0 3/5 −1/5
x2x_2 −1 6/5 0 1 −3/5 0 −4/5 3/5
s2s_2 0 0 0 0 1 1 1 −1
zj−cjz_j-c_j −12/5 0 0 1/5 0 M−2/5 M−1/5

All zj−cj≥0z_j-c_j\ge0 with no artificial variable in the basis: optimal.

Answer. x1=35,x2=65,minZ=2⋅35+65=125=2.4.x_1=\tfrac35,\quad x_2=\tfrac65,\qquad\boxed{\min Z=2\cdot\tfrac35+\tfrac65=\tfrac{12}5=2.4}. Check: 95+65=3\tfrac95+\tfrac65=3, 125+185=6≥6\tfrac{12}5+\tfrac{18}5=6\ge6, 35+125=3≤3\tfrac35+\tfrac{12}5=3\le3.

✓ Checked by computer We checked in Python (scipy linprog): the minimum is Z = 12/5 at x₁ = 3/5, x₂ = 6/5, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

Give the applications of linear programming problem. A firm produces three products A, B and C. It uses two types of raw material I and II of which 5000 units and 7500 units respectively are available. The raw material requirements per unit of the products are given below:

Raw material \ Requirement per unit of product A B C
I 3 4 5
II 5 3 5

The labour time for each unit of product A is twice that of product B and three times that of product C. The entire labour force of the firm can produce the equivalent of 3000 units of product A. The minimum demands of the three products are 600 units, 650 units and 500 units respectively. Also, the ratio of the number of units produced must be equal to 2:3:4. Assume that the profits per unit of A, B and C are ₹ 50, ₹ 50 and ₹ 80 respectively. Formulate the problem as a linear programming model in order to determine the number of units of each product which will maximize the profit.

2019 · Paper II · Q1d · 10 marks

Solution

Applications of linear programming.

  • Production: product mix, production scheduling, blending (petrol, alloys, animal feed), cutting stock.
  • Marketing: media selection and advertising budgets, sales-force allocation.
  • Finance: portfolio selection, capital budgeting, cash management.
  • Transport and distribution: transportation and assignment problems, routing, warehouse location.
  • Agriculture: crop planning, fertiliser mix, irrigation.
  • Personnel: staff scheduling, assignment of workers to jobs.
  • Defence, government and health: allocation of resources, diet planning, hospital scheduling.

Formulation. Let x1,x2,x3x_1,x_2,x_3 be the numbers of units of AA, BB, CC produced.

Objective (profit): Maximise Z=50x1+50x2+80x3.\text{Maximise }Z=50x_1+50x_2+80x_3 .

Raw materials: 3x1+4x2+5x3≤5000(I),5x1+3x2+5x3≤7500(II).3x_1+4x_2+5x_3\le5000\quad(\text{I}),\qquad 5x_1+3x_2+5x_3\le7500\quad(\text{II}).

Labour. If a unit of AA takes tt hours, a unit of BB takes t/2t/2 and a unit of CC takes t/3t/3. The labour available equals 3000t3000t hours. So x1+x22+x33≤3000⇔6x1+3x2+2x3≤18000.x_1+\frac{x_2}2+\frac{x_3}3\le3000\quad\Longleftrightarrow\quad 6x_1+3x_2+2x_3\le18000 .

Minimum demands: x1≥600,x2≥650,x3≥500.x_1\ge600,\qquad x_2\ge650,\qquad x_3\ge500 .

Ratio x1:x2:x3=2:3:4x_1:x_2:x_3=2:3:4: x12=x23=x34⇔3x1−2x2=0,4x2−3x3=0.\frac{x_1}2=\frac{x_2}3=\frac{x_3}4\quad\Longleftrightarrow\quad 3x_1-2x_2=0,\quad 4x_2-3x_3=0 .

Non-negativity: x1,x2,x3≥0x_1,x_2,x_3\ge0.

Note on the question. With the numbers as printed, the ratio forces x=(2k,3k,4k)x=(2k,3k,4k); raw material I then needs 6k+12k+20k=38k≤50006k+12k+20k=38k\le5000, i.e. k≤131.6k\le131.6, while the minimum demand for AA needs 2k≥6002k\ge600, i.e. k≥300k\ge300. So these constraints cannot all hold together and the LP, as printed, has no feasible solution. The formulation above is what the question asks for; in practice the ratio condition (or the raw-material supply) would have to be relaxed.

✓ Checked by computer Every constraint was checked against the data; we also checked in Python (scipy linprog) that, with the figures as printed, the ratio 2:3:4 and the minimum demands cannot both be met within raw material I.

↑ Back to the question list

Solve the following problem using simplex method: A company sells two types of fertilizers, one is liquid and the other is dry. The liquid fertilizer contains 2 units of chemical A and 4 units of chemical B per jar and the dry fertilizer contains 3 units of each of chemicals A and B per carton. The liquid fertilizer sells for ₹ 3 per jar and the dry fertilizer sells for ₹ 4 per carton. A farmer requires at least 90 units of chemical A and at least 102 units of chemical B for his farm. How many of each type of fertilizers should the farmer purchase to minimize the cost while meeting his requirements?

2019 · Paper II · Q2a · 15 marks

Solution

Formulation. Let x1x_1 = number of jars of liquid fertiliser and x2x_2 = number of cartons of dry fertiliser. Minimise Z=3x1+4x2\text{Minimise }Z=3x_1+4x_2 subject to2x1+3x2≥90(chemical A),4x1+3x2≥102(chemical B),x1,x2≥0.\text{subject to}\quad 2x_1+3x_2\ge90\ (\text{chemical }A),\qquad 4x_1+3x_2\ge102\ (\text{chemical }B),\qquad x_1,x_2\ge0 .

Simplex (Big-M) form. Max Z′=−ZZ'=-Z: Max Z′=−3x1−4x2−MA1−MA22x1+3x2−s1+A1=904x1+3x2−s2+A2=102\begin{aligned}\text{Max }Z'&=-3x_1-4x_2-MA_1-MA_2\\ 2x_1+3x_2-s_1+A_1&=90\\ 4x_1+3x_2-s_2+A_2&=102\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
A1A_1 −M 90 2 3 −1 0 1 0 45
A2A_2 −M 102 4 3 0 −1 0 1 51/2
zj−cjz_j-c_j −192M −6M+3 −6M+4 M M 0 0

Entering: x1x_1 (most negative zj−cj=−6M+3z_j-c_j=−6M+3). Leaving: A2A_2 (smallest ratio 51/2). Pivot element: 4.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
A1A_1 −M 39 0 3/2 −1 1/2 1 −1/2 26
x1x_1 −3 51/2 1 3/4 0 −1/4 0 1/4 34
zj−cjz_j-c_j −39M−153/2 0 −3M/2+7/4 M −M/2+3/4 0 3M/2−3/4

Entering: x2x_2 (most negative zj−cj=−3M/2+7/4z_j-c_j=−3M/2+7/4). Leaving: A1A_1 (smallest ratio 26). Pivot element: 3/2.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2
x2x_2 −4 26 0 1 −2/3 1/3 2/3 −1/3
x1x_1 −3 6 1 0 1/2 −1/2 −1/2 1/2
zj−cjz_j-c_j −122 0 0 7/6 1/6 M−7/6 M−1/6

All zj−cj≥0z_j-c_j\ge0 and the artificials are out: optimal.

Answer. The farmer should buy 6 jars of liquid and 26 cartons of dry fertiliser. Minimum cost: Z=3(6)+4(26)=₹122.Z=3(6)+4(26)=\boxed{₹122}. Both requirements are met exactly: 12+78=9012+78=90 units of AA and 24+78=10224+78=102 units of BB.

✓ Checked by computer We checked in Python (scipy linprog): the minimum cost is ₹122 at 6 jars and 26 cartons, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

If a linear programming problem has an optimal solution, then prove that it attains its optimum solution at an extreme point of the convex set generated by the set of all the feasible solutions to the problem.

2018 · Paper II · Q1a · 10 marks

Solution

Setting. Consider: Maximise Z=CTXZ=C^TX subject to X∈S={X:AX=b,X≥0}X\in S=\{X:AX=b,\ X\ge0\}. SS is convex, and we take it to be bounded (a convex polyhedron) with extreme points X1,X2,…,XkX_1,X_2,\dots,X_k (kk finite, since there are at most (nm)\binom nm basic feasible solutions). Suppose the problem has an optimal solution X0X_0, with Z*=CTX0Z^*=C^TX_0.

To prove: some extreme point XrX_r satisfies CTXr=Z*C^TX_r=Z^*.

Proof.

  1. A bounded convex polyhedron is the convex hull of its extreme points. So X0X_0 can be written X0=∑i=1kλiXi,λi≥0,∑i=1kλi=1.X_0=\sum_{i=1}^k\lambda_iX_i,\qquad \lambda_i\ge0,\quad \sum_{i=1}^k\lambda_i=1 .
  2. Let XrX_r be the extreme point with the largest objective value: CTXr=max1≤i≤kCTXi.C^TX_r=\max_{1\le i\le k}C^TX_i .
  3. By linearity, Z*=CTX0=∑i=1kλiCTXi≤∑i=1kλiCTXr=CTXr.Z^*=C^TX_0=\sum_{i=1}^k\lambda_iC^TX_i\le\sum_{i=1}^k\lambda_iC^TX_r=C^TX_r .
  4. But XrX_r is feasible and X0X_0 is optimal, so CTXr≤Z*C^TX_r\le Z^*.
  5. Hence CTXr=Z*C^TX_r=Z^*: the extreme point XrX_r is an optimal solution. ∎

If SS is unbounded. Every X∈SX\in S can be written as ∑λiXi+∑μjDj\sum\lambda_iX_i+\sum\mu_jD_j, where the DjD_j are extreme directions (ADj=0AD_j=0, Dj≥0D_j\ge0) and μj≥0\mu_j\ge0. If the optimum is finite, CTDj≤0C^TD_j\le0 for every jj (otherwise ZZ would be unbounded), so CTX0≤∑λiCTXi≤CTXrC^TX_0\le\sum\lambda_iC^TX_i\le C^TX_r, and the same argument applies.

Remarks.

  • The same proof (with “min”) works for minimisation.
  • If the maximum is attained at several extreme points, it is also attained at every convex combination of them (alternative optima).
  • This theorem is the basis of the simplex method: we need only search among the finitely many basic feasible solutions.

✓ Proof checked step by step Every step was checked: the feasible set is a convex polytope; every feasible point is a convex combination of extreme points (plus, if unbounded, directions that cannot improve a finite optimum); linearity then gives an extreme point at least as good.

↑ Back to the question list

What is the importance of sensitivity analysis? Mention what type of problems can be resolved using it. Using the following linear programming problem, show that the value 6 of the resource vector b=col.{6812} can be increased to 7: Maximize Z=3x1+2x2 subject to x1+2x2≤6,2x1+x2≤8,−x1+x2≤1,x2≤2,x1,x2≥0

2018 · Paper II · Q4b · 20 marks

Solution

Importance of sensitivity analysis. The data of an LPP (prices, costs, resources, technical coefficients) are usually estimates and change over time. Sensitivity (post-optimality) analysis studies how the optimal solution changes when these data change, without solving the problem afresh, using the final simplex table. It tells the manager:

  • how far each cost or price may change before the optimal plan changes;
  • how far each resource may be increased or decreased while the same set of activities (basis) stays optimal, and how the profit changes (shadow prices);
  • whether a new product (variable) is worth introducing, and whether a new constraint upsets the current plan. It thus measures how reliable the solution is and helps in planning and negotiation.

Problems resolved by it. Changes in (i) the objective coefficients cjc_j; (ii) the right-hand sides bib_i; (iii) the coefficients aija_{ij} of non-basic (and basic) variables; (iv) addition of a new variable; (v) addition of a new constraint; (vi) deletion of a variable or a constraint.

Solve the problem. Slacks s1,…,s4s_1,\dots,s_4:

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 s4s_4 Ratio
s1s_1 0 6 1 2 1 0 0 0 6
s2s_2 0 8 2 1 0 1 0 0 4
s3s_3 0 1 −1 1 0 0 1 0 —
s4s_4 0 2 0 1 0 0 0 1 —
zj−cjz_j-c_j 0 −3 −2 0 0 0 0

Entering: x1x_1 (most negative zj−cj=−3z_j-c_j=−3). Leaving: s2s_2 (smallest ratio 4). Pivot element: 2.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 s4s_4 Ratio
s1s_1 0 2 0 3/2 1 −1/2 0 0 4/3
x1x_1 3 4 1 1/2 0 1/2 0 0 8
s3s_3 0 5 0 3/2 0 1/2 1 0 10/3
s4s_4 0 2 0 1 0 0 0 1 2
zj−cjz_j-c_j 12 0 −1/2 0 3/2 0 0

Entering: x2x_2 (most negative zj−cj=−1/2z_j-c_j=−1/2). Leaving: s1s_1 (smallest ratio 4/3). Pivot element: 3/2.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 s4s_4
x2x_2 2 4/3 0 1 2/3 −1/3 0 0
x1x_1 3 10/3 1 0 −1/3 2/3 0 0
s3s_3 0 3 0 0 −1 1 1 0
s4s_4 0 2/3 0 0 −2/3 1/3 0 1
zj−cjz_j-c_j 38/3 0 0 1/3 4/3 0 0

Optimal: x1=103,x2=43x_1=\tfrac{10}3,\ x_2=\tfrac43, Z=383Z=\tfrac{38}3, with s3=3s_3=3, s4=23s_4=\tfrac23.

Range of b1b_1. The basis is (x2,x1,s3,s4)(x_2,x_1,s_3,s_4). From the final table (columns of s1,…,s4s_1,\dots,s_4), B−1=(23−1300−132300−1110−231301).B^{-1}=\begin{pmatrix}\tfrac23&-\tfrac13&0&0\\-\tfrac13&\tfrac23&0&0\\-1&1&1&0\\-\tfrac23&\tfrac13&0&1\end{pmatrix}. With b=(b1,8,1,2)Tb=(b_1,8,1,2)^T: XB=B−1b=(x2x1s3s4)=(2b1−8316−b139−b114−2b13).X_B=B^{-1}b=\begin{pmatrix}x_2\\x_1\\s_3\\s_4\end{pmatrix}=\begin{pmatrix}\tfrac{2b_1-8}3\\[2pt]\tfrac{16-b_1}3\\[2pt]9-b_1\\[2pt]\tfrac{14-2b_1}3\end{pmatrix}. The basis stays feasible (hence optimal, since the zj−cjz_j-c_j do not depend on bb) when all four are ≥0\ge0: b1≥4,b1≤16,b1≤9,b1≤7⇒4≤b1≤7.b_1\ge4,\quad b_1\le16,\quad b_1\le9,\quad b_1\le7\qquad\Longrightarrow\qquad 4\le b_1\le7 .

Conclusion. The value 6 of b1b_1 can be increased up to 7 without changing the optimal basis. At b1=7b_1=7: x1=3,x2=2,s3=2,s4=0,Z=13.x_1=3,\quad x_2=2,\quad s_3=2,\quad s_4=0,\qquad Z=13 . The shadow price of resource 1 is zs1−cs1=13z_{s_1}-c_{s_1}=\tfrac13, so each extra unit adds 13\tfrac13: Z=383+13=13Z=\tfrac{38}3+\tfrac13=13. Beyond 7, s4s_4 would become negative (the constraint x2≤2x_2\le2 becomes binding) and the basis must change.

✓ Checked by computer We checked in Python (scipy linprog): the optimum is Z = 38/3 at (10/3, 4/3); B⁻¹ from the final table gives the range 4 ≤ b₁ ≤ 7, and re-solving with b₁ = 7 gives (3, 2), Z = 13 with the same basis.

↑ Back to the question list

What is a linear programming problem and how it can be represented in the form of matrix notations? Given the following constraints: 6x1+3x2−4x3≤602x1−4x2+4x3≤403x1+3x2+3x3≤60x1,x2,x3≥0 maximize the objective function Z=3x1+2x2+6x3 using simplex method.

2017 · Paper II · Q3c · 20 marks

Solution

LPP and its matrix form. A linear programming problem asks for values of decision variables x1,…,xnx_1,\dots,x_n that maximise (or minimise) a linear objective function subject to linear constraints and non-negativity. In matrix notation: Max (or Min) Z=CTXsubject toAX(≤,=,≥)b,X≥0,\text{Max (or Min) }Z=C^TX\quad\text{subject to}\quad AX\ (\le,=,\ge)\ b,\qquad X\ge0, where X=(x1⋮xn),C=(c1⋮cn),b=(b1⋮bm),A=(a11⋯a1n⋮⋮am1⋯amn).X=\begin{pmatrix}x_1\\\vdots\\x_n\end{pmatrix},\quad C=\begin{pmatrix}c_1\\\vdots\\c_n\end{pmatrix},\quad b=\begin{pmatrix}b_1\\\vdots\\b_m\end{pmatrix},\quad A=\begin{pmatrix}a_{11}&\cdots&a_{1n}\\\vdots&&\vdots\\a_{m1}&\cdots&a_{mn}\end{pmatrix}. After adding slack/surplus variables the standard form is AX=bAX=b, X≥0X\ge0.

For this problem C=(326),A=(63−42−44333),b=(604060),AX≤b,X≥0.C=\begin{pmatrix}3\\2\\6\end{pmatrix},\quad A=\begin{pmatrix}6&3&-4\\2&-4&4\\3&3&3\end{pmatrix},\quad b=\begin{pmatrix}60\\40\\60\end{pmatrix},\quad AX\le b,\ X\ge0 .

Simplex solution. Add slacks s1,s2,s3s_1,s_2,s_3:

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 60 6 3 −4 1 0 0 —
s2s_2 0 40 2 −4 4 0 1 0 10
s3s_3 0 60 3 3 3 0 0 1 20
zj−cjz_j-c_j 0 −3 −2 −6 0 0 0

Entering: x3x_3 (most negative zj−cj=−6z_j-c_j=−6). Leaving: s2s_2 (smallest ratio 10). Pivot element: 4.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 100 8 −1 0 1 1 0 —
x3x_3 6 10 1/2 −1 1 0 1/4 0 —
s3s_3 0 30 3/2 6 0 0 −3/4 1 5
zj−cjz_j-c_j 60 0 −8 0 0 3/2 0

Entering: x2x_2 (most negative zj−cj=−8z_j-c_j=−8). Leaving: s3s_3 (smallest ratio 5). Pivot element: 6.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
s1s_1 0 105 33/4 0 0 1 7/8 1/6
x3x_3 6 15 3/4 0 1 0 1/8 1/6
x2x_2 2 5 1/4 1 0 0 −1/8 1/6
zj−cjz_j-c_j 100 2 0 0 0 1/2 4/3

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=0,x2=5,x3=15,maxZ=2(5)+6(15)=100.x_1=0,\quad x_2=5,\quad x_3=15,\qquad\boxed{\max Z=2(5)+6(15)=100}. Check: 15−60=−45≤6015-60=-45\le60, −20+60=40≤40-20+60=40\le40, 15+45=60≤6015+45=60\le60. (x1x_1 has zj−cj=1>0z_j-c_j=1>0, so the optimum is unique in this basis.)

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 100 at x₁ = 0, x₂ = 5, x₃ = 15, the same as the simplex tables below (exact fractions).

↑ Back to the question list

For the following linear programming problem write the dual problem and solve: Maximize W=2X+3Y+5Zsubject to 10X+9Y+Z≤10X+Y+Z≥309X+2Y−4Z≥80X,Y,Z≥0

2016 · Paper II · Q1e · 10 marks

Solution

Note on the question. As printed, the primal has no feasible solution, so it cannot be “solved” in the usual sense; we show this and solve the dual, which turns out to be unbounded.

Write the primal in canonical form (all ≤\le, maximisation): multiply the ≥\ge constraints by −1-1: Max W=2X+3Y+5Z10X+9Y+Z≤10−X−Y−Z≤−30−9X−2Y+4Z≤−80X,Y,Z≥0\begin{aligned}\text{Max }W&=2X+3Y+5Z\\ 10X+9Y+Z&\le10\\ -X-Y-Z&\le-30\\ -9X-2Y+4Z&\le-80\\ X,Y,Z&\ge0\end{aligned}

Dual. With dual variables u1,u2,u3≥0u_1,u_2,u_3\ge0: Min V=10u1−30u2−80u310u1−u2−9u3≥29u1−u2−2u3≥3u1−u2+4u3≥5u1,u2,u3≥0\begin{aligned}\text{Min }V&=10u_1-30u_2-80u_3\\ 10u_1-u_2-9u_3&\ge2\\ 9u_1-u_2-2u_3&\ge3\\ u_1-u_2+4u_3&\ge5\\ u_1,u_2,u_3&\ge0\end{aligned} (Equivalently, with v2=−u2≤0v_2=-u_2\le0, v3=−u3≤0v_3=-u_3\le0: Min 10u1+30v2+80v310u_1+30v_2+80v_3 subject to 10u1+v2+9v3≥210u_1+v_2+9v_3\ge2, 9u1+v2+2v3≥39u_1+v_2+2v_3\ge3, u1+v2−4v3≥5u_1+v_2-4v_3\ge5.)

Primal is infeasible. From the first constraint, Z≤10−10X−9YZ\le10-10X-9Y. Then X+Y+Z≤X+Y+10−10X−9Y=10−9X−8Y≤10<30,X+Y+Z\le X+Y+10-10X-9Y=10-9X-8Y\le10<30, so X+Y+Z≥30X+Y+Z\ge30 can never hold.

Dual is unbounded. Take u3=0u_3=0 and u2=t≥0u_2=t\ge0, u1=t+5u_1=t+5. Then 10u1−u2=9t+50≥2,9u1−u2=8t+45≥3,u1−u2=5≥5,10u_1-u_2=9t+50\ge2,\qquad 9u_1-u_2=8t+45\ge3,\qquad u_1-u_2=5\ge5, so the point is feasible for every t≥0t\ge0, and V=10(t+5)−30t=50−20t→−∞(t→∞).V=10(t+5)-30t=50-20t\to-\infty\quad(t\to\infty).

Conclusion. The primal has no feasible solution and its dual has an unbounded solution (minV=−∞\min V=-\infty). This illustrates the duality theorem: if the dual is unbounded, the primal is infeasible.

✓ Checked by computer We checked in Python (scipy linprog): the primal is infeasible (status 2) and the dual is unbounded (status 3); the algebraic argument below proves both.

↑ Back to the question list

In the context of linear programming problem (LPP), define the terms (i) basic solution, (ii) feasible solution, and (iii) non-degenerate solution. Show that the set of all the feasible solutions to an LPP is a convex set.

2016 · Paper II · Q2a · 15 marks

Solution

Consider the LPP: optimise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0, where AA is m×nm\times n (m<nm<n) of rank mm.

(i) Basic solution. Choose mm linearly independent columns of AA; they form a basis matrix BB. Setting the other n−mn-m variables (non-basic) to zero and solving BXB=bBX_B=b gives XB=B−1bX_B=B^{-1}b. The resulting solution of AX=bAX=b is a basic solution; the mm variables in XBX_B are the basic variables. There are at most (nm)\binom nm basic solutions.

(ii) Feasible solution. Any XX satisfying all the constraints AX=bAX=b and the non-negativity restrictions X≥0X\ge0 is a feasible solution. A basic solution that is also feasible (XB≥0X_B\ge0) is a basic feasible solution.

(iii) Non-degenerate solution. A basic (feasible) solution is non-degenerate if all mm basic variables are strictly positive. If one or more basic variables are zero it is degenerate.

Theorem. The set S={X:AX=b,X≥0}S=\{X:AX=b,\ X\ge0\} of all feasible solutions is convex.

Proof. If SS is empty or has one point, it is trivially convex. Let X1,X2∈SX_1,X_2\in S and 0≤λ≤10\le\lambda\le1, and put X=λX1+(1−λ)X2.X=\lambda X_1+(1-\lambda)X_2 . Then

  • AX=λAX1+(1−λ)AX2=λb+(1−λ)b=bAX=\lambda AX_1+(1-\lambda)AX_2=\lambda b+(1-\lambda)b=b;
  • X≥0X\ge0, because X1,X2≥0X_1,X_2\ge0 and λ,1−λ≥0\lambda,1-\lambda\ge0.

So X∈SX\in S. Every point of the segment joining two feasible solutions is feasible; hence SS is a convex set. ∎

(The same proof works for constraints AX≤bAX\le b: AX=λAX1+(1−λ)AX2≤λb+(1−λ)b=bAX=\lambda AX_1+(1-\lambda)AX_2\le\lambda b+(1-\lambda)b=b.)

✓ Proof checked step by step Every step was checked: definitions of basic, feasible and non-degenerate solutions, and the convexity of {X : AX = b, X ≥ 0} from the linearity of A.

↑ Back to the question list

What is the use of artificial variables in an LPP? Use the artificial variable technique to solve the following LPP: Minimize z=12x1+20x2subject to 6x1+8x2≥1007x1+12x2≥120x1,x2≥0

2016 · Paper II · Q4c · 15 marks

Solution

Use of artificial variables. The simplex method needs a starting basic feasible solution whose basis is the identity matrix. Slack variables give such a basis for ≤\le constraints, but a ≥\ge constraint gets a surplus variable with coefficient −1-1, and an == constraint gets nothing. We therefore add a non-negative artificial variable to each such constraint. Artificial variables have no physical meaning; they only provide the starting identity basis. They must be driven out (to zero) — by giving them a large penalty MM in the objective (Big-M method) or by first minimising their sum (two-phase method). If an artificial variable stays positive at the optimum, the original problem has no feasible solution.

Solution. Max z′=−z=−12x1−20x2z'=-z=-12x_1-20x_2: Max z′=−12x1−20x2−MA1−MA26x1+8x2−s1+A1=1007x1+12x2−s2+A2=120\begin{aligned}\text{Max }z'&=-12x_1-20x_2-MA_1-MA_2\\ 6x_1+8x_2-s_1+A_1&=100\\ 7x_1+12x_2-s_2+A_2&=120\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
A1A_1 −M 100 6 8 −1 0 1 0 25/2
A2A_2 −M 120 7 12 0 −1 0 1 10
zj−cjz_j-c_j −220M −13M+12 −20M+20 M M 0 0

Entering: x2x_2 (most negative zj−cj=−20M+20z_j-c_j=−20M+20). Leaving: A2A_2 (smallest ratio 10). Pivot element: 12.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2 Ratio
A1A_1 −M 20 4/3 0 −1 2/3 1 −2/3 15
x2x_2 −20 10 7/12 1 0 −1/12 0 1/12 120/7
zj−cjz_j-c_j −20M−200 −4M/3+1/3 0 M −2M/3+5/3 0 5M/3−5/3

Entering: x1x_1 (most negative zj−cj=−4M/3+1/3z_j-c_j=−4M/3+1/3). Leaving: A1A_1 (smallest ratio 15). Pivot element: 4/3.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 A1A_1 A2A_2
x1x_1 −12 15 1 0 −3/4 1/2 3/4 −1/2
x2x_2 −20 5/4 0 1 7/16 −3/8 −7/16 3/8
zj−cjz_j-c_j −205 0 0 1/4 3/2 M−1/4 M−3/2

All zj−cj≥0z_j-c_j\ge0, artificials out: optimal.

Answer. x1=15,x2=54,minz=12(15)+20(1.25)=205.x_1=15,\quad x_2=\tfrac54,\qquad\boxed{\min z=12(15)+20(1.25)=205}. Check: 90+10=10090+10=100 and 105+15=120105+15=120 (both constraints binding).

✓ Checked by computer We checked in Python (scipy linprog): the minimum is z = 205 at x₁ = 15, x₂ = 5/4, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

Mention the importance of sensitivity analysis. What are the different problems that are resolved through it?

2015 · Paper II · Q1e · 10 marks

Solution

Importance of sensitivity analysis. In an LPP the coefficients cjc_j, bib_i and aija_{ij} are assumed known with certainty, but in practice they are estimates (prices, costs, resource availabilities, input norms) and they change. Sensitivity analysis (post-optimality analysis) finds the effect of such changes on the optimal solution, starting from the final simplex table instead of re-solving the problem. Its importance:

  • It shows how stable the optimal solution is: the ranges within which each coefficient may vary without changing the optimal basis.
  • It gives the shadow prices (marginal values) of the resources, so management knows which resources are worth buying more of, and at what price.
  • It saves computation: a new optimum can be found from the old table with a few dual- or primal-simplex steps.
  • It supports “what if” planning when markets, technology or capacities change.

Problems resolved through it.

  1. Change in the objective coefficients cjc_j — of basic or non-basic variables (price or cost changes). Optimality may be lost; feasibility is not affected.
  2. Change in the resource vector bb — more or less of a resource. Feasibility of XB=B−1bX_B=B^{-1}b may be lost; optimality is not affected. Range of each bib_i and the shadow price.
  3. Change in the coefficients aija_{ij} — of a non-basic variable (affects only its zj−cjz_j-c_j) or of a basic variable (affects B−1B^{-1}, so the problem may need re-solving).
  4. Addition of a new variable (new product): compute its zj−cj=CBTB−1aj−cjz_j-c_j=C_B^TB^{-1}a_j-c_j; if negative, it should be introduced.
  5. Addition of a new constraint: if the current solution satisfies it, nothing changes; otherwise add it to the table and use the dual simplex method.
  6. Deletion of a variable or a constraint.

✓ Answer checked step by step Every point was checked against the standard purposes of post-optimality analysis and the six types of discrete change it handles.

↑ Back to the question list

Explain the meanings of (i) basic solutions and (ii) feasible solutions in a linear programming problem with m conditions and n variables. Using simplex method, solve the following linear programming problem: Maximize Z=3x1+2x2+5x3subject to x1+2x2+x3≤4303x1+2x3≤4603x1+4x2≤420x1,x2,x3≥0

2015 · Paper II · Q3a · 15 marks

Solution

(i) Basic solutions. With mm constraints written as equations AX=bAX=b in nn variables (n>mn>m, including slacks), a basic solution is obtained by setting n−mn-m variables equal to zero and solving the mm equations for the remaining mm variables, provided their columns are linearly independent. The mm variables are basic, the others non-basic. There are at most (nm)\binom nm basic solutions.

(ii) Feasible solutions. A set of values of x1,…,xnx_1,\dots,x_n that satisfies all mm constraints and the non-negativity conditions xj≥0x_j\ge0 is a feasible solution. A basic solution with all basic variables ≥0\ge0 is a basic feasible solution; it corresponds to a corner of the feasible region.

Simplex solution. Add slacks: x1+2x2+x3+s1=430x_1+2x_2+x_3+s_1=430, 3x1+2x3+s2=4603x_1+2x_3+s_2=460, 3x1+4x2+s3=4203x_1+4x_2+s_3=420.

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 430 1 2 1 1 0 0 430
s2s_2 0 460 3 0 2 0 1 0 230
s3s_3 0 420 3 4 0 0 0 1 —
zj−cjz_j-c_j 0 −3 −2 −5 0 0 0

Entering: x3x_3 (most negative zj−cj=−5z_j-c_j=−5). Leaving: s2s_2 (smallest ratio 230). Pivot element: 2.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 200 −1/2 2 0 1 −1/2 0 100
x3x_3 5 230 3/2 0 1 0 1/2 0 —
s3s_3 0 420 3 4 0 0 0 1 105
zj−cjz_j-c_j 1150 9/2 −2 0 0 5/2 0

Entering: x2x_2 (most negative zj−cj=−2z_j-c_j=−2). Leaving: s1s_1 (smallest ratio 100). Pivot element: 2.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
x2x_2 2 100 −1/4 1 0 1/2 −1/4 0
x3x_3 5 230 3/2 0 1 0 1/2 0
s3s_3 0 20 4 0 0 −2 1 1
zj−cjz_j-c_j 1350 4 0 0 1 2 0

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=0,x2=100,x3=230,maxZ=2(100)+5(230)=1350,x_1=0,\quad x_2=100,\quad x_3=230,\qquad\boxed{\max Z=2(100)+5(230)=1350}, with s3=20s_3=20 (the third resource is not fully used).

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 1350 at x₁ = 0, x₂ = 100, x₃ = 230, the same as the simplex tables below (exact fractions).

↑ Back to the question list

What do you understand by the term “Sensitivity Analysis”? Discuss the effect of variation in the resource vector b in the linear programming problem with set of constraints AX=b. In the problem Maximize Z=−x1+2x2−x3subject to 3x1+x2−x3≤10,−x1+4x2+x3≥6,x2+x3≤4,x1,x2,x3≥0 discuss the effect of discrete change in the component b2 so as to maintain the optimality of the current optimum solution.

2014 · Paper II · Q4a · 20 marks

Solution

Sensitivity analysis. Sensitivity (post-optimality) analysis studies how the optimal solution of an LPP responds to changes in its data — the costs cjc_j, the resources bib_i and the coefficients aija_{ij} — using the final simplex table rather than solving afresh. It finds the ranges over which the present optimal basis remains optimal.

Effect of variation in bb. Let BB be the optimal basis, so XB=B−1bX_B=B^{-1}b and zj−cj=CBTB−1aj−cj≥0z_j-c_j=C_B^TB^{-1}a_j-c_j\ge0.

  • A change in bb does not affect the zj−cjz_j-c_j (they do not involve bb), so optimality is kept.
  • It changes XBX_B. If bkb_k becomes bk+Δb_k+\Delta, then XBnew=B−1(b+Δek)=XB+Δβk,X_B^{\text{new}}=B^{-1}(b+\Delta e_k)=X_B+\Delta\,\beta_k , where βk\beta_k is the kk-th column of B−1B^{-1}. The basis stays optimal as long as XB+Δβk≥0X_B+\Delta\beta_k\ge0, i.e. maxβik>0(−xBiβik)≤Δ≤minβik<0(−xBiβik).\max_{\beta_{ik}>0}\left(-\frac{x_{Bi}}{\beta_{ik}}\right)\le\Delta\le\min_{\beta_{ik}<0}\left(-\frac{x_{Bi}}{\beta_{ik}}\right).
  • Within this range the new optimum is XBnewX_B^{\text{new}} and ZZ changes by Δ×\Delta\times (shadow price yky_k). Outside it, some basic variable becomes negative and the dual simplex method is used to restore feasibility.

The problem. Standard form (surplus s2s_2, artificial A1A_1 for the ≥\ge constraint): 3x1+x2−x3+s1=10−x1+4x2+x3−s2+A1=6x2+x3+s3=4\begin{aligned}3x_1+x_2-x_3+s_1&=10\\ -x_1+4x_2+x_3-s_2+A_1&=6\\ x_2+x_3+s_3&=4\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
s1s_1 0 10 3 1 −1 1 0 0 0 10
A1A_1 −M 6 −1 4 1 0 −1 0 1 3/2
s3s_3 0 4 0 1 1 0 0 1 0 4
zj−cjz_j-c_j −6M M+1 −4M−2 −M+1 0 M 0 0

Entering: x2x_2 (most negative zj−cj=−4M−2z_j-c_j=−4M−2). Leaving: A1A_1 (smallest ratio 3/2). Pivot element: 4.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
s1s_1 0 17/2 13/4 0 −5/4 1 1/4 0 −1/4 34
x2x_2 2 3/2 −1/4 1 1/4 0 −1/4 0 1/4 —
s3s_3 0 5/2 1/4 0 3/4 0 1/4 1 −1/4 10
zj−cjz_j-c_j 3 1/2 0 3/2 0 −1/2 0 M+1/2

Entering: s2s_2 (most negative zj−cj=−1/2z_j-c_j=−1/2). Leaving: s3s_3 (smallest ratio 10). Pivot element: 1/4.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 A1A_1
s1s_1 0 6 3 0 −2 1 0 −1 0
x2x_2 2 4 0 1 1 0 0 1 0
s2s_2 0 10 1 0 3 0 1 4 −1
zj−cjz_j-c_j 8 1 0 3 0 0 2 M

Optimal: x2=4x_2=4, x1=x3=0x_1=x_3=0, Z=8Z=8, with s1=6s_1=6 and s2=10s_2=10.

Discrete change in b2b_2. The optimal basis is (s1,x2,s2)(s_1,x_2,s_2). With the basis (s1,x2,s2)(s_1,x_2,s_2) the equations give x2=4,s1=10−x2=6,s2=−x1+4x2+x3−b2=16−b2.x_2=4,\qquad s_1=10-x_2=6,\qquad s_2=-x_1+4x_2+x_3-b_2=16-b_2 . So XB=(6,4,16−b2)X_B=(6,\,4,\,16-b_2). The basis stays feasible (and therefore optimal) when 16−b2≥0⇔b2≤16.16-b_2\ge0\quad\Longleftrightarrow\quad b_2\le16 . With the present b2=6b_2=6, a change Δb2\Delta b_2 keeps the current solution optimal for −∞<Δb2≤10,i.e.b2≤16.\boxed{-\infty<\Delta b_2\le10},\qquad\text{i.e.}\quad b_2\le16 .

Interpretation.

  • s2s_2 is basic, so constraint 2 is not binding: its shadow price is 0, and Z=8Z=8 does not change at all within this range.
  • If b2>16b_2>16, s2s_2 becomes negative. In fact no solution exists then: from x2+x3≤4x_2+x_3\le4 and x1≥0x_1\ge0, −x1+4x2+x3≤4(x2+x3)≤16-x_1+4x_2+x_3\le4(x_2+x_3)\le16. So the problem becomes infeasible for b2>16b_2>16.

✓ Checked by computer We checked in Python (scipy linprog): the optimum is Z = 8 at x₂ = 4; re-solving for b₂ = 16 and b₂ = 16.5 confirms the range b₂ ≤ 16 (infeasible beyond).

↑ Back to the question list

What is Linear Programming? Give its advantages and limitations.

2013 · Paper II · Q1e · 10 marks

Solution

Linear programming (LP) is a mathematical technique for allocating limited resources among competing activities in the best possible way. “Linear” means that the objective and all the constraints are linear functions of the decision variables; “programming” means planning. An LP problem is: Optimise Z=∑j=1ncjxjsubject to∑j=1naijxj(≤,=,≥)bi(i=1,…,m),xj≥0.\text{Optimise }Z=\sum_{j=1}^nc_jx_j\quad\text{subject to}\quad\sum_{j=1}^na_{ij}x_j\ (\le,=,\ge)\ b_i\ (i=1,\dots,m),\qquad x_j\ge0 . Its components are the decision variables, the objective function, the constraints and the non-negativity restrictions. It rests on the assumptions of proportionality, additivity, divisibility, certainty and finiteness.

Advantages.

  1. Gives the best (optimal) use of scarce resources — machines, labour, money, materials.
  2. Makes decisions objective and systematic: the objective and the restrictions must be stated clearly.
  3. Indicates bottlenecks: binding constraints show which resources limit output.
  4. Provides shadow prices and sensitivity ranges, so management knows the value of extra resources and how stable the plan is.
  5. Handles many variables and constraints at once; efficient algorithms (simplex, interior point) and software are available.
  6. Can be revised quickly when conditions change (post-optimality analysis).
  7. Wide applications: production, blending, diet, transport, assignment, finance, agriculture, defence.

Limitations.

  1. Linearity may not hold: costs and returns often change with scale (economies of scale, price discounts).
  2. Divisibility: the solution may be fractional when only integers make sense (e.g. 2.4 machines); rounding may give a non-optimal or infeasible plan; integer programming is then needed.
  3. Certainty: all coefficients are assumed known and constant, but in reality they are uncertain.
  4. Single objective: LP optimises one objective, while firms often have several conflicting goals (goal programming is needed).
  5. Static: it does not allow for time; dynamic problems need other methods.
  6. Large problems need computers, and formulating them correctly needs skill.
  7. Intangible factors (human behaviour, goodwill) cannot be included.

✓ Answer checked step by step Every point was checked against the standard account of linear programming: its components, assumptions, advantages and limitations.

↑ Back to the question list

Solve the following LPP: Maximise Z=8x1−4x2Subject to 4x1+5x2≤20,−x1+3x2≥−23 where x1≥0 and x2 is unrestricted in sign.

2013 · Paper II · Q4c · 30 marks

Solution

Removing the free variable. Since x2x_2 is unrestricted in sign, put x2=x2′−x2″,x2′,x2″≥0.x_2=x_2'-x_2'',\qquad x_2',x_2''\ge0 . Write the second constraint as ≤\le with a non-negative right side: −x1+3x2≥−23⇔x1−3x2≤23-x_1+3x_2\ge-23\iff x_1-3x_2\le23. The problem becomes Max Z=8x1−4x2′+4x2″4x1+5x2′−5x2″+s1=20x1−3x2′+3x2″+s2=23\begin{aligned}\text{Max }Z&=8x_1-4x_2'+4x_2''\\ 4x_1+5x_2'-5x_2''+s_1&=20\\ x_1-3x_2'+3x_2''+s_2&=23\end{aligned} with all variables ≥0\ge0.

Table 1.

Basis cBc_B xBx_B x1x_1 x2′x_2' x2″x_2'' s1s_1 s2s_2 Ratio
s1s_1 0 20 4 5 −5 1 0 5
s2s_2 0 23 1 −3 3 0 1 23
zj−cjz_j-c_j 0 −8 4 −4 0 0

Entering: x1x_1 (most negative zj−cj=−8z_j-c_j=−8). Leaving: s1s_1 (smallest ratio 5). Pivot element: 4.

Table 2.

Basis cBc_B xBx_B x1x_1 x2′x_2' x2″x_2'' s1s_1 s2s_2 Ratio
x1x_1 8 5 1 5/4 −5/4 1/4 0 —
s2s_2 0 18 0 −17/4 17/4 −1/4 1 72/17
zj−cjz_j-c_j 40 0 14 −14 2 0

Entering: x2″x_2'' (most negative zj−cj=−14z_j-c_j=−14). Leaving: s2s_2 (smallest ratio 72/17). Pivot element: 17/4.

Table 3.

Basis cBc_B xBx_B x1x_1 x2′x_2' x2″x_2'' s1s_1 s2s_2
x1x_1 8 175/17 1 0 0 3/17 5/17
x2″x_2'' 4 72/17 0 −1 1 −1/17 4/17
zj−cjz_j-c_j 1688/17 0 0 0 20/17 56/17

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=17517x_1=\dfrac{175}{17}, x2′=0x_2'=0, x2″=7217x_2''=\dfrac{72}{17}, so x1=17517≈10.29,x2=−7217≈−4.24,maxZ=168817≈99.29.x_1=\frac{175}{17}\approx10.29,\qquad x_2=-\frac{72}{17}\approx-4.24,\qquad\boxed{\max Z=\frac{1688}{17}\approx99.29}. Check: 4⋅17517−5⋅7217=700−36017=204\cdot\tfrac{175}{17}-5\cdot\tfrac{72}{17}=\tfrac{700-360}{17}=20; −17517−21617=−23-\tfrac{175}{17}-\tfrac{216}{17}=-23. Both constraints are binding, and Z=1400+28817Z=\tfrac{1400+288}{17}.

✓ Checked by computer We checked in Python (scipy linprog with x₂ free): the maximum is Z = 1688/17 ≈ 99.29 at x₁ = 175/17, x₂ = −72/17, the same as the simplex tables below (exact fractions).

↑ Back to the question list

Show that in a linear programming problem, the feasible solutions form a convex set.

2012 · Paper II · Q1e · 12 marks

Solution

Theorem. The set of feasible solutions of a linear programming problem is a convex set.

Set-up. Let the LPP be: optimise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0 (any LPP can be put in this form with slack and surplus variables). Let S={X∈ℝn:AX=b,X≥0}.S=\{X\in\mathbb R^n:AX=b,\ X\ge0\}. A set SS is convex if, for any two points X1,X2∈SX_1,X_2\in S, the whole segment joining them lies in SS: λX1+(1−λ)X2∈S\lambda X_1+(1-\lambda)X_2\in S for all 0≤λ≤10\le\lambda\le1.

Proof.

  • If SS is empty or a single point, it is convex.
  • Otherwise take any X1,X2∈SX_1,X_2\in S, so that AX1=bAX_1=b, AX2=bAX_2=b, X1≥0X_1\ge0, X2≥0X_2\ge0. Let 0≤λ≤10\le\lambda\le1 and X0=λX1+(1−λ)X2.X_0=\lambda X_1+(1-\lambda)X_2 .
  • Constraints: AX0=λAX1+(1−λ)AX2=λb+(1−λ)b=bAX_0=\lambda AX_1+(1-\lambda)AX_2=\lambda b+(1-\lambda)b=b.
  • Non-negativity: each component of X0X_0 is λx1j+(1−λ)x2j\lambda x_{1j}+(1-\lambda)x_{2j}, a sum of non-negative numbers, so X0≥0X_0\ge0.
  • Hence X0∈SX_0\in S.

So every convex combination of two feasible solutions is feasible, and SS is convex. ∎

Remarks. (1) For inequality constraints AX≤bAX\le b the same argument gives AX0≤λb+(1−λ)b=bAX_0\le\lambda b+(1-\lambda)b=b. (2) SS is the intersection of finitely many half-spaces and hyperplanes, each of which is convex; an intersection of convex sets is convex, which is another proof.

✓ Proof checked step by step Every step was checked: a convex combination of two solutions of AX = b (or AX ≤ b) with X ≥ 0 is again such a solution.

↑ Back to the question list

A person needs at least 10, 12 and 12 units of chemicals A, B and C respectively for his garden. A liquid product available in the market contains 5, 2 and 1 units of A, B and C respectively per jar. A dry product contains 1, 2 and 4 units of A, B and C per carton. The price of the liquid product is ₹ 3 per jar and that of the dry product is ₹ 2 per carton. How many jars and cartons should be purchased to meet the requirements and to minimize the cost?

2012 · Paper II · Q2a · 30 marks

Solution

Formulation. Let x1x_1 = jars of liquid product and x2x_2 = cartons of dry product. Minimise Z=3x1+2x2\text{Minimise }Z=3x_1+2x_2 subject to 5x1+x2≥10(A)2x1+2x2≥12(B)x1+4x2≥12(C)x1,x2≥0\begin{aligned}5x_1+x_2&\ge10&&(A)\\ 2x_1+2x_2&\ge12&&(B)\\ x_1+4x_2&\ge12&&(C)\\ x_1,x_2&\ge0\end{aligned}

Graphical view. The feasible region is unbounded (away from the origin); its corners are (0,10)(0,10): Z=20Z=20; (1,5)(1,5): Z=13Z=13; (4,2)(4,2): Z=16Z=16; (12,0)(12,0): Z=36Z=36.

0246810121402468101214jars x₁cartons x₂(1, 5)(4, 2)(0, 10)feasible
Corners (0, 10), (1, 5), (4, 2), (12, 0) with Z = 20, 13, 16, 36. Red dashed: 3x₁ + 2x₂ = 13, touching the region at (1, 5).

Simplex (Big-M) check. Max Z′=−3x1−2x2−MA1−MA2−MA3Z'=-3x_1-2x_2-MA_1-MA_2-MA_3: 5x1+x2−s1+A1=10,2x1+2x2−s2+A2=12,x1+4x2−s3+A3=12.5x_1+x_2-s_1+A_1=10,\quad 2x_1+2x_2-s_2+A_2=12,\quad x_1+4x_2-s_3+A_3=12 .

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
A1A_1 −M 10 5 1 −1 0 0 1 0 0 2
A2A_2 −M 12 2 2 0 −1 0 0 1 0 6
A3A_3 −M 12 1 4 0 0 −1 0 0 1 12
zj−cjz_j-c_j −34M −8M+3 −7M+2 M M M 0 0 0

Entering: x1x_1 (most negative zj−cj=−8M+3z_j-c_j=−8M+3). Leaving: A1A_1 (smallest ratio 2). Pivot element: 5.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 −3 2 1 1/5 −1/5 0 0 1/5 0 0 10
A2A_2 −M 8 0 8/5 2/5 −1 0 −2/5 1 0 5
A3A_3 −M 10 0 19/5 1/5 0 −1 −1/5 0 1 50/19
zj−cjz_j-c_j −18M−6 0 −27M/5+7/5 −3M/5+3/5 M M 8M/5−3/5 0 0

Entering: x2x_2 (most negative zj−cj=−27M/5+7/5z_j-c_j=−27M/5+7/5). Leaving: A3A_3 (smallest ratio 50/19). Pivot element: 19/5.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3 Ratio
x1x_1 −3 28/19 1 0 −4/19 0 1/19 4/19 0 −1/19 28
A2A_2 −M 72/19 0 0 6/19 −1 8/19 −6/19 1 −8/19 9
x2x_2 −2 50/19 0 1 1/19 0 −5/19 −1/19 0 5/19 —
zj−cjz_j-c_j −72M/19−184/19 0 0 −6M/19+10/19 M −8M/19+7/19 25M/19−10/19 0 27M/19−7/19

Entering: s3s_3 (most negative zj−cj=−8M/19+7/19z_j-c_j=−8M/19+7/19). Leaving: A2A_2 (smallest ratio 9). Pivot element: 8/19.

Table 4.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 A2A_2 A3A_3
x1x_1 −3 1 1 0 −1/4 1/8 0 1/4 −1/8 0
s3s_3 0 9 0 0 3/4 −19/8 1 −3/4 19/8 −1
x2x_2 −2 5 0 1 1/4 −5/8 0 −1/4 5/8 0
zj−cjz_j-c_j −13 0 0 1/4 7/8 0 M−1/4 M−7/8 M

Answer. Buy 1 jar of the liquid product and 5 cartons of the dry product: minZ=3(1)+2(5)=₹13.\boxed{\min Z=3(1)+2(5)=₹13}. The requirements of AA and BB are met exactly (5+5=105+5=10, 2+10=122+10=12) and CC is over-supplied by s3=9s_3=9 units (1+20=21≥121+20=21\ge12).

✓ Checked by computer We checked in Python (scipy linprog): the minimum cost is ₹13 at 1 jar and 5 cartons, the same as the Big-M tables below (exact fractions); the corner values were also checked.

↑ Back to the question list

Use simplex method to solve the following LPP: Maximize Z=x1−x2+3x3 subject to x1+x2+x3≤102x1−x3≤22x1−2x2+3x3≤0x1,x2,x3≥0

2011 · Paper II · Q1d · 12 marks

Solution

Standard form. Add slacks: x1+x2+x3+s1=10,2x1−x3+s2=2,2x1−2x2+3x3+s3=0.x_1+x_2+x_3+s_1=10,\qquad 2x_1-x_3+s_2=2,\qquad 2x_1-2x_2+3x_3+s_3=0 . The starting solution s=(10,2,0)s=(10,2,0) is feasible but degenerate (s3=0s_3=0).

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 10 1 1 1 1 0 0 10
s2s_2 0 2 2 0 −1 0 1 0 —
s3s_3 0 0 2 −2 3 0 0 1 0
zj−cjz_j-c_j 0 −1 1 −3 0 0 0

Entering: x3x_3 (most negative zj−cj=−3z_j-c_j=−3). Leaving: s3s_3 (smallest ratio 0). Pivot element: 3.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 10 1/3 5/3 0 1 0 −1/3 6
s2s_2 0 2 8/3 −2/3 0 0 1 1/3 —
x3x_3 3 0 2/3 −2/3 1 0 0 1/3 —
zj−cjz_j-c_j 0 1 −1 0 0 0 1

Entering: x2x_2 (most negative zj−cj=−1z_j-c_j=−1). Leaving: s1s_1 (smallest ratio 6). Pivot element: 5/3.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
x2x_2 −1 6 1/5 1 0 3/5 0 −1/5
s2s_2 0 6 14/5 0 0 2/5 1 1/5
x3x_3 3 4 4/5 0 1 2/5 0 1/5
zj−cjz_j-c_j 6 6/5 0 0 3/5 0 4/5

All zj−cj≥0z_j-c_j\ge0: optimal.

Answer. x1=0,x2=6,x3=4,maxZ=−6+12=6.x_1=0,\quad x_2=6,\quad x_3=4,\qquad\boxed{\max Z=-6+12=6}. Check: 6+4=10≤106+4=10\le10, −4≤2-4\le2, −12+12=0≤0-12+12=0\le0.

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 6 at x₁ = 0, x₂ = 6, x₃ = 4, the same as the simplex tables below (exact fractions).

↑ Back to the question list

Justify the use of artificial variables in obtaining LPP. When should slack and surplus variables be used for solving linear programming problem?

2011 · Paper II · Q2a · 10 marks

Solution

Why artificial variables are used.

  • The simplex method starts from a basic feasible solution with an identity basis: each constraint must contain a variable with coefficient +1+1 that appears in no other constraint and whose value equals the (non-negative) right-hand side.
  • A ≤\le constraint gets a slack variable, which does this job.
  • A ≥\ge constraint gets a surplus variable with coefficient −1-1: setting the decision variables to zero would make the surplus negative (−s=b>0-s=b>0), which is infeasible. An == constraint gets no extra variable at all.
  • In these rows we therefore add a non-negative artificial variable AiA_i, which forms the missing column of the identity matrix and gives the starting solution Ai=biA_i=b_i.
  • Artificial variables are fictitious; they make the starting point possible but must be driven to zero. This is done by giving them a very large penalty MM in the objective (Charnes’ Big-M method: −M-M in a maximisation, +M+M in a minimisation) or by first minimising their sum (two-phase method).
  • If at the optimum an artificial variable is still positive, the original problem has no feasible solution. So the artificial variables also serve as a test of feasibility.

When slack and surplus variables are used.

  • Slack variables are used for constraints of the type ≤\le (e.g. resource limits): ∑aijxj+si=bi\sum a_{ij}x_j+s_i=b_i. They measure unused resource, have zero cost, and can form the initial basis.
  • Surplus variables are used for constraints of the type ≥\ge (e.g. minimum requirements): ∑aijxj−si=bi\sum a_{ij}x_j-s_i=b_i. They measure the excess over the requirement and have zero cost; because of the −1-1 coefficient they are always accompanied by an artificial variable in the starting table.
  • For == constraints neither is used; only an artificial variable is added.
  • Both are needed to convert the LPP to the standard form AX=bAX=b, X≥0X\ge0, on which the simplex method works.

✓ Answer checked step by step Every point was checked against the standard reasons for artificial variables (an identity starting basis) and the use of slack (≤) and surplus (≥) variables.

↑ Back to the question list

Solve graphically the following linear programming problem: Min Z=3x1+5x2 subject to −3x1+4x2≤122x1−x2≥−22x1+3x2≥12x1≤4,x2≥2,x1,x2≥0.

2010 · Paper II · Q1d · 12 marks

Solution

Constraint lines.

  1. −3x1+4x2=12-3x_1+4x_2=12: through (0,3)(0,3) and (4,6)(4,6); feasible side below the line.
  2. 2x1−x2=−22x_1-x_2=-2: through (0,2)(0,2) and (2,6)(2,6); feasible side below/right.
  3. 2x1+3x2=122x_1+3x_2=12: through (6,0)(6,0) and (0,4)(0,4); feasible side away from the origin.
  4. x1=4x_1=4: feasible side to the left.
  5. x2=2x_2=2: feasible side above.
012345601234567x₁x₂A (3, 2)CBDE
Feasible region ABCDE. Red dashed: the iso-cost line 3x₁ + 5x₂ = 19, touching the region only at A (3, 2).

Corner points of the feasible region (a pentagon):

Corner Lines (x1,x2)(x_1,x_2) Z=3x1+5x2Z=3x_1+5x_2
AA 3 and 5 (3, 2) 19
BB 4 and 5 (4, 2) 22
CC 4 and 1 (4, 6) 42
DD 1 and 2 (0.8, 3.6) 20.4
EE 2 and 3 (0.75, 3.5) 19.75

Answer. The minimum is at AA: x1=3,x2=2,minZ=19.x_1=3,\quad x_2=2,\qquad\boxed{\min Z=19}. (The iso-cost line 3x1+5x2=193x_1+5x_2=19 touches the region only at AA.)

✓ Checked by computer We checked in Python (scipy linprog with 0 ≤ x₁ ≤ 4, x₂ ≥ 2): the minimum is Z = 19 at (3, 2); the five corner values were recomputed.

↑ Back to the question list

What are the goals achieved through sensitivity analysis? If in the following linear programming problem (L.P.P.): Maximize z=3x1+2x2+5x3 subject to x1+2x2+x3≤4303x1+2x3≤460x1+4x2≤420x1,x2,x3≥0 the profit coefficient of x1 is reduced to 2 from 3, determine whether the original solution remains optimal.

2009 · Paper II · Q1b · 12 marks

Solution

Goals of sensitivity analysis.

  • To find how far the data (cjc_j, bib_i, aija_{ij}) can change before the present optimal solution (basis) changes, so that the decision is known to be stable.
  • To find the new optimal solution quickly, from the final simplex table, when a change does occur.
  • To obtain the shadow prices of the resources and judge whether extra resources are worth acquiring.
  • To evaluate new products (variables) and new restrictions (constraints).
  • In short, to make the LP solution useful when the data are uncertain or changing.

Solve the problem. Slacks s1,s2,s3s_1,s_2,s_3; the simplex method gives the final table

Basis cBc_B xBx_B x1x_1 x2x_2 x3x_3 s1s_1 s2s_2 s3s_3
x2x_2 2 100 −1/4 1 0 1/2 −1/4 0
x3x_3 5 230 3/2 0 1 0 1/2 0
s3s_3 0 20 2 0 0 −2 1 1
zj−cjz_j-c_j 1350 4 0 0 1 2 0

Optimal: x1=0x_1=0, x2=100x_2=100, x3=230x_3=230, z=1350z=1350.

Change c1c_1 from 3 to 2. x1x_1 is non-basic, so a change in c1c_1 affects only z1−c1z_1-c_1: z1−c1=CBTa1−c1=2(−14)+5(32)+0(2)−c1=7−c1.z_1-c_1=C_B^Ta_1-c_1=2\left(-\tfrac14\right)+5\left(\tfrac32\right)+0(2)-c_1=7-c_1 .

  • With c1=3c_1=3: z1−c1=4≥0z_1-c_1=4\ge0.
  • With c1=2c_1=2: z1−c1=5≥0z_1-c_1=5\ge0.

All zj−cjz_j-c_j remain non-negative, so the original solution remains optimal: x1=0x_1=0, x2=100x_2=100, x3=230x_3=230, z=1350z=1350 (unchanged, since x1=0x_1=0).

In general the solution stays optimal for c1≤7c_1\le7; reducing the profit of a product that is not being made can never make it worth making.

✓ Checked by computer We checked in Python (scipy linprog): with c₁ = 3 and with c₁ = 2 the optimum is x = (0, 100, 230), Z = 1350; from the final table z₁ − c₁ = 7 − c₁ ≥ 0 for c₁ ≤ 7.

↑ Back to the question list

Explain (i) feasible solution and (ii) basic solution in the context of linear programming problem (L.P.P.). Prove that the objective function of a L.P.P. assumes its minimum at an extreme point of the convex set generated by the set of all feasible solutions to the problem, and if it assumes its minimum at more than one extreme point then it takes on the same value for every convex combination of those particular points.

2009 · Paper II · Q1f · 12 marks

Solution

(i) Feasible solution. For the LPP “optimise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0”, any XX that satisfies AX=bAX=b and X≥0X\ge0 is a feasible solution. The set SS of all feasible solutions is convex.

(ii) Basic solution. If AA is m×nm\times n of rank mm, choose mm linearly independent columns (a basis BB), set the other n−mn-m variables to zero and solve BXB=bBX_B=b. The solution XB=B−1bX_B=B^{-1}b, together with the zeros, is a basic solution. If XB≥0X_B\ge0 it is a basic feasible solution; basic feasible solutions are the extreme points of SS.

Theorem 1. If Z=CTXZ=C^TX has a minimum over SS, it is attained at an extreme point of SS.

Proof. Let SS be bounded with extreme points X1,…,XkX_1,\dots,X_k, and let X0X_0 be a minimising point, Z0=CTX0Z_0=C^TX_0. Every point of a bounded convex polyhedron is a convex combination of its extreme points: X0=∑i=1kλiXi,λi≥0,∑λi=1.X_0=\sum_{i=1}^k\lambda_iX_i,\qquad\lambda_i\ge0,\ \sum\lambda_i=1 . Let XpX_p be the extreme point with the smallest value, CTXp=miniCTXiC^TX_p=\min_iC^TX_i. Then Z0=∑λiCTXi≥∑λiCTXp=CTXp.Z_0=\sum\lambda_iC^TX_i\ge\sum\lambda_iC^TX_p=C^TX_p . Since Z0Z_0 is the minimum, CTXp≥Z0C^TX_p\ge Z_0. Hence CTXp=Z0C^TX_p=Z_0: the minimum is attained at the extreme point XpX_p. ∎

(If SS is unbounded but the minimum is finite, every feasible point is ∑λiXi+∑μjDj\sum\lambda_iX_i+\sum\mu_jD_j with extreme directions DjD_j satisfying CTDj≥0C^TD_j\ge0, and the same inequality holds.)

Theorem 2. If the minimum is attained at more than one extreme point, say X1,…,XrX_1,\dots,X_r, it is attained at every convex combination of them.

Proof. Let CTXi=Z0C^TX_i=Z_0 for i=1,…,ri=1,\dots,r, and X=∑i=1rμiXiX=\sum_{i=1}^r\mu_iX_i with μi≥0\mu_i\ge0, ∑μi=1\sum\mu_i=1. Then X∈SX\in S (convexity) and CTX=∑i=1rμiCTXi=∑μiZ0=Z0.C^TX=\sum_{i=1}^r\mu_iC^TX_i=\sum\mu_iZ_0=Z_0 . So XX is also a minimising point. ∎

In particular, if two extreme points are optimal, the whole edge (segment) joining them is optimal, so the LPP has infinitely many optimal solutions.

✓ Proof checked step by step Every step was checked: definitions of feasible and basic solutions; the minimum of a linear function over a bounded polyhedron is attained at an extreme point; and if attained at X₁, …, X_r, then at every convex combination of them, by linearity.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Describe the M-technique with artificial variables to minimize an objective function in a linear programming problem. What changes will be made in the procedure if the objective function is to be maximized?

2007 · Paper II · Q1d · 12 marks

Solution

The M-technique (Charnes’ penalty method) for minimisation.

  1. Standard form. Make all bi≥0b_i\ge0. Add slack variables to ≤\le constraints; subtract surplus variables from ≥\ge constraints.
  2. Artificial variables. Add an artificial variable Ai≥0A_i\ge0 to every ≥\ge and == constraint, so that an identity matrix is available for the starting basis.
  3. Penalty. Give each artificial variable a very large cost +M+M in the objective: Min Z=∑cjxj+0∑si+M∑Ai.\text{Min }Z=\sum c_jx_j+0\sum s_i+M\sum A_i . Because MM is huge, any solution with an artificial variable at a positive level is very expensive, so the minimisation drives them out.
  4. Initial table. Basis: slacks and artificials. Compute zj−cj=CBTaj−cjz_j-c_j=C_B^Ta_j-c_j; these will contain terms in MM.
  5. Optimality test (minimisation). The solution is optimal when all zj−cj≤0z_j-c_j\le0. Compare values by their MM-coefficient first, then by the constant.
  6. Entering variable: the one with the largest positive zj−cjz_j-c_j. Leaving variable: by the usual minimum ratio xBi/aikx_{Bi}/a_{ik}, aik>0a_{ik}>0. Pivot as usual. An artificial variable that leaves need not be brought back; its column can be dropped.
  7. Termination.
    • If all zj−cj≤0z_j-c_j\le0 and no artificial variable is positive: optimal solution of the original problem.
    • If all zj−cj≤0z_j-c_j\le0 but some artificial variable is positive: the problem has no feasible solution.
    • If an entering column has no positive entry: unbounded solution.

(Equivalently one may minimise by maximising −Z-Z, as in step 8 below.)

Changes for a maximisation problem.

  • The artificial variables get the penalty −M-M in the objective: Max Z=∑cjxj−M∑AiZ=\sum c_jx_j-M\sum A_i.
  • The optimality condition becomes all zj−cj≥0z_j-c_j\ge0.
  • The entering variable is the one with the most negative zj−cjz_j-c_j.
  • The ratio test, pivoting and the feasibility/unboundedness tests are the same.

✓ Answer checked step by step Every step was checked against Charnes’ Big-M method: penalty +M for artificials in a minimisation (−M in a maximisation), the optimality rule in each case, and the infeasibility test.

↑ Back to the question list

State and prove duality theorem in linear programming.

2007 · Paper II · Q3a · 20 marks

Solution

Primal and dual. (P)Max Z=CTX,AX≤b,X≥0;(D)Min W=bTY,ATY≥C,Y≥0.\text{(P)}\quad\text{Max }Z=C^TX,\quad AX\le b,\ X\ge0;\qquad\text{(D)}\quad\text{Min }W=b^TY,\quad A^TY\ge C,\ Y\ge0 .

Duality theorem. (a) If XX and YY are feasible for (P) and (D), then CTX≤bTYC^TX\le b^TY. (b) If either problem has a finite optimal solution, then so does the other, and maxZ=minW\max Z=\min W. (c) If either problem has an unbounded objective, the other has no feasible solution.

Proof of (a) — weak duality. For feasible XX and YY: CTX≤(ATY)TX=YT(AX)≤YTb=bTY,C^TX\le(A^TY)^TX=Y^T(AX)\le Y^Tb=b^TY, using C≤ATYC\le A^TY with X≥0X\ge0, and AX≤bAX\le b with Y≥0Y\ge0. ∎

Corollary. If CTX*=bTY*C^TX^*=b^TY^* for feasible X*,Y*X^*,Y^*, then both are optimal: no feasible XX can give more than bTY*=CTX*b^TY^*=C^TX^*, and no feasible YY less than CTX*=bTY*C^TX^*=b^TY^*.

Proof of (b) — strong duality. Suppose (P) has an optimal solution. Add slacks: AX+IS=bAX+IS=b. The simplex method ends with an optimal basis BB, XB=B−1bX_B=B^{-1}b, and the optimality conditions zj−cj=CBTB−1aj−cj≥0 for every column aj of A,CBTB−1ei−0≥0 for every slack column ei.z_j-c_j=C_B^TB^{-1}a_j-c_j\ge0\ \text{ for every column } a_j \text{ of } A,\qquad C_B^TB^{-1}e_i-0\ge0\ \text{ for every slack column } e_i . Define Y*T=CBTB−1Y^{*T}=C_B^TB^{-1}. The two conditions say ATY*≥CandY*≥0,A^TY^*\ge C\qquad\text{and}\qquad Y^*\ge0, so Y*Y^* is feasible for (D). Its objective value is bTY*=Y*Tb=CBTB−1b=CBTXB=maxZ.b^TY^*=Y^{*T}b=C_B^TB^{-1}b=C_B^TX_B=\max Z . By the corollary, Y*Y^* is optimal for (D) and minW=maxZ\min W=\max Z. Since the dual of (D) is (P), the argument also works starting from (D). ∎

Proof of (c). If (P) is unbounded and (D) had a feasible YY, weak duality would give CTX≤bTYC^TX\le b^TY for all feasible XX, a finite upper bound — contradiction. So (D) is infeasible. Similarly the other way.

Remarks. The optimal dual values Y*=(CBTB−1)TY^*=(C_B^TB^{-1})^T appear in the final simplex table of the primal as the zj−cjz_j-c_j of the slack columns; they are the shadow prices of the resources. Together with the theorem, complementary slackness (yi*(bi−aiTX*)=0y_i^*(b_i-a_i^TX^*)=0, xj*(a(j)TY*−cj)=0x_j^*(a^{(j)T}Y^*-c_j)=0) characterises optimal pairs.

✓ Proof checked step by step Every step was checked: weak duality from AX ≤ b, Aᵀy ≥ c; strong duality from the optimal simplex table (y = c_Bᵀ B⁻¹ is dual feasible with equal objective value); and the unbounded/infeasible case.

↑ Back to the question list

What is sensitivity analysis? Explain its use with the help of an example.

2007 · Paper II · Q4d · 15 marks

Solution

Sensitivity analysis (post-optimality analysis) is the study of how the optimal solution of a linear programming problem changes when its parameters — the objective coefficients cjc_j, the right-hand sides bib_i, the technological coefficients aija_{ij} — change, or when variables or constraints are added or removed. It uses the final simplex table, so the problem need not be solved again from the start.

Uses.

  • To find the range of each coefficient within which the current optimal basis (the “product mix”) remains optimal.
  • To find shadow prices — the change in the optimal value per unit change in a resource — and the range over which they hold.
  • To decide quickly whether a new product is profitable, or whether a new constraint changes the plan.
  • To judge how reliable the solution is when the data are only estimates, and to plan for changes in prices, costs and capacities.

Example. Maximise z=3x1+5x2z=3x_1+5x_2 subject to 3x1+2x2≤183x_1+2x_2\le18, x1≤4x_1\le4, x2≤6x_2\le6, x1,x2≥0x_1,x_2\ge0. The simplex method gives the final table

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3
x1x_1 3 2 1 0 1/3 0 −2/3
s2s_2 0 2 0 0 −1/3 1 2/3
x2x_2 5 6 0 1 0 0 1
zj−cjz_j-c_j 36 0 0 1 0 3

so x1=2x_1=2, x2=6x_2=6, z=36z=36.

(a) Change in c1c_1. With profit c1c_1 for x1x_1: zs1=c1/3≥0z_{s_1}=c_1/3\ge0 and zs3=5−2c1/3≥0z_{s_3}=5-2c_1/3\ge0. So the same plan is optimal for 0≤c1≤7.50\le c_1\le7.5. If the profit of x1x_1 rose to, say, 8, s3s_3 would enter and the plan would change to x1=4x_1=4, x2=3x_2=3 (z=47z=47).

(b) Change in b1b_1. Shadow price of resource 1 = zs1−cs1=1z_{s_1}-c_{s_1}=1: each extra unit of resource 1 adds ₹1 to zz. From XB=B−1bX_B=B^{-1}b: x1=b1−123≥0x_1=\tfrac{b_1-12}3\ge0, s2=4−b1−123≥0s_2=4-\tfrac{b_1-12}3\ge0, so the basis stays feasible for 12≤b1≤2412\le b_1\le24. For instance, b1=21b_1=21 gives x1=3x_1=3, x2=6x_2=6, z=39=36+3×1z=39=36+3\times1.

(c) New product. A product x3x_3 using (1,0,1)(1,0,1) units of the three resources with profit 5: z3−c3=CBTB−1a3−c3=(1,0,3)⋅(1,0,1)−5=−1<0z_3-c_3=C_B^TB^{-1}a_3-c_3=(1,0,3)\cdot(1,0,1)-5=-1<0, so it is worth introducing and the simplex iterations continue from the present table.

✓ Checked by computer We checked in Python (scipy linprog): the example optimum is z = 36 at (2, 6), and re-solving with c₁ = 7.5 and c₁ = 8 confirms the stated range 0 ≤ c₁ ≤ 7.5.

↑ Back to the question list

Show that the set of feasible solutions to a linear programming problem is convex.

2006 · Paper II · Q1d · 12 marks

Solution

(This is the same question as Q28 (2012, 1e) above. The worked solution is repeated here so that each question is complete.)

Theorem. The set of feasible solutions of a linear programming problem is a convex set.

Set-up. Let the LPP be: optimise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0 (any LPP can be put in this form with slack and surplus variables). Let S={X∈ℝn:AX=b,X≥0}.S=\{X\in\mathbb R^n:AX=b,\ X\ge0\}. A set SS is convex if, for any two points X1,X2∈SX_1,X_2\in S, the whole segment joining them lies in SS: λX1+(1−λ)X2∈S\lambda X_1+(1-\lambda)X_2\in S for all 0≤λ≤10\le\lambda\le1.

Proof.

  • If SS is empty or a single point, it is convex.
  • Otherwise take any X1,X2∈SX_1,X_2\in S, so that AX1=bAX_1=b, AX2=bAX_2=b, X1≥0X_1\ge0, X2≥0X_2\ge0. Let 0≤λ≤10\le\lambda\le1 and X0=λX1+(1−λ)X2.X_0=\lambda X_1+(1-\lambda)X_2 .
  • Constraints: AX0=λAX1+(1−λ)AX2=λb+(1−λ)b=bAX_0=\lambda AX_1+(1-\lambda)AX_2=\lambda b+(1-\lambda)b=b.
  • Non-negativity: each component of X0X_0 is λx1j+(1−λ)x2j\lambda x_{1j}+(1-\lambda)x_{2j}, a sum of non-negative numbers, so X0≥0X_0\ge0.
  • Hence X0∈SX_0\in S.

So every convex combination of two feasible solutions is feasible, and SS is convex. ∎

Remarks. (1) For inequality constraints AX≤bAX\le b the same argument gives AX0≤λb+(1−λ)b=bAX_0\le\lambda b+(1-\lambda)b=b. (2) SS is the intersection of finitely many half-spaces and hyperplanes, each of which is convex; an intersection of convex sets is convex, which is another proof.

✓ Proof checked step by step Every step was checked: a convex combination of two solutions of AX = b (or AX ≤ b) with X ≥ 0 is again such a solution.

↑ Back to the question list

Explain the Simplex Algorithm for solving a linear programming problem.

2005 · Paper II · Q1f · 12 marks

Solution

The simplex algorithm (Dantzig, 1947) solves an LPP by moving from one basic feasible solution (corner of the feasible region) to an adjacent one with a better value of the objective, until no improvement is possible. We state it for a maximisation problem.

Step 1. Standard form. Write the problem as Max Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0, with b≥0b\ge0: add slack variables to ≤\le constraints, subtract surplus variables and add artificial variables to ≥\ge constraints, add artificial variables to == constraints. (A minimisation problem is converted by maximising −Z-Z.)

Step 2. Initial basic feasible solution. Take the slack (and artificial) variables as the basic variables: XB=bX_B=b, all other variables zero. Set up the simplex table with columns Basis, cBc_B, xBx_B and one column aja_j for every variable.

Step 3. Optimality test. Compute the index row zj−cj=CBTaj−cjfor every non-basic j.z_j-c_j=C_B^Ta_j-c_j\qquad\text{for every non-basic } j . If all zj−cj≥0z_j-c_j\ge0, the current solution is optimal; stop. (If some non-basic zj−cj=0z_j-c_j=0, alternative optima exist.)

Step 4. Entering variable. Choose the non-basic variable xkx_k with the most negative zk−ckz_k-c_k. Increasing it raises ZZ at the fastest rate per unit.

Step 5. Unboundedness test. If every entry aik≤0a_{ik}\le0 in the column of xkx_k, the variable can be increased indefinitely: the solution is unbounded; stop.

Step 6. Leaving variable (minimum ratio rule). Compute θ=mini{xBiaik:aik>0}=xBrark.\theta=\min_i\left\{\frac{x_{Bi}}{a_{ik}}:a_{ik}>0\right\}=\frac{x_{Br}}{a_{rk}} . The basic variable of row rr leaves; arka_{rk} is the pivot (key) element. This rule keeps all variables non-negative.

Step 7. Pivoting. Form the new table:

  • new pivot row = old pivot row ÷ arka_{rk};
  • for every other row ii: new row ii = old row ii − aik×a_{ik}\times(new pivot row). Then xkx_k replaces the leaving variable in the basis and ZZ increases by θ|zk−ck|\theta\,|z_k-c_k|.

Step 8. Return to Step 3.

Termination. With non-degenerate solutions ZZ strictly increases at every step, no basis can repeat, and there are finitely many bases, so the method ends in a finite number of steps with an optimal, unbounded or (if an artificial variable stays positive) infeasible verdict. Degeneracy can cause cycling, which is avoided by special rules (perturbation, Bland’s rule).

✓ Answer checked step by step Every step was checked against the standard simplex algorithm: initial BFS, optimality test z_j − c_j ≥ 0 (maximisation), entering by most negative z_j − c_j, leaving by minimum ratio, pivoting, and the unboundedness test.

↑ Back to the question list

Solve the following LP problem graphically: Maximise Z=3x1+2x2 subject to x1+2x2≤62x1+x2≤8−x1+x2≤1x2≤2x1,x2≥0

2005 · Paper II · Q3a · 25 marks

Solution

Constraint lines (each feasible side contains the origin):

  1. x1+2x2=6x_1+2x_2=6: through (6,0)(6,0) and (0,3)(0,3).
  2. 2x1+x2=82x_1+x_2=8: through (4,0)(4,0) and (0,8)(0,8).
  3. −x1+x2=1-x_1+x_2=1: through (0,1)(0,1) and (2,3)(2,3).
  4. x2=2x_2=2: horizontal line.
012345601234x₁x₂B (10/3, 4/3)ACDEO
Feasible region OABCDE. Red dashed: the iso-profit line 3x₁ + 2x₂ = 38/3, touching the region only at B (10/3, 4/3).

Corner points of the feasible region OABCDEOABCDE.

Corner Lines (x1,x2)(x_1,x_2) Z=3x1+2x2Z=3x_1+2x_2
OO axes (0, 0) 0
AA 2 and x2=0x_2=0 (4, 0) 12
BB 1 and 2 (10/3, 4/3) 38/3 ≈ 12.67
CC 1 and 4 (2, 2) 10
DD 3 and 4 (1, 2) 7
EE 3 and x1=0x_1=0 (0, 1) 2

(BB: solving x1+2x2=6x_1+2x_2=6, 2x1+x2=82x_1+x_2=8 gives x1=103x_1=\tfrac{10}3, x2=43x_2=\tfrac43.)

Answer. x1=103,x2=43,maxZ=383≈12.67.x_1=\frac{10}3,\quad x_2=\frac43,\qquad\boxed{\max Z=\frac{38}3\approx12.67}. The iso-profit line 3x1+2x2=3833x_1+2x_2=\tfrac{38}3 touches the region only at BB. Constraints 3 and 4 are not binding at the optimum.

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 38/3 at (10/3, 4/3); the six corner values were recomputed.

↑ Back to the question list

Solve by Big-M method the following LP problem: Maximize Z=3x1−x2 subject to 2x1+x2≥2x1+3x2≤3x2≤4x1,x2≥0

2004 · Paper II · Q3a · 25 marks

Solution

Standard form. Surplus s1s_1 and artificial A1A_1 for the first constraint; slacks s2s_2, s3s_3 for the others: Max Z=3x1−x2+0s1+0s2+0s3−MA12x1+x2−s1+A1=2x1+3x2+s2=3x2+s3=4\begin{aligned}\text{Max }Z&=3x_1-x_2+0s_1+0s_2+0s_3-MA_1\\ 2x_1+x_2-s_1+A_1&=2\\ x_1+3x_2+s_2&=3\\ x_2+s_3&=4\end{aligned}

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
A1A_1 −M 2 2 1 −1 0 0 1 1
s2s_2 0 3 1 3 0 1 0 0 3
s3s_3 0 4 0 1 0 0 1 0 —
zj−cjz_j-c_j −2M −2M−3 −M+1 M 0 0 0

Entering: x1x_1 (most negative zj−cj=−2M−3z_j-c_j=−2M−3). Leaving: A1A_1 (smallest ratio 1). Pivot element: 2.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1 Ratio
x1x_1 3 1 1 1/2 −1/2 0 0 1/2 —
s2s_2 0 2 0 5/2 1/2 1 0 −1/2 4
s3s_3 0 4 0 1 0 0 1 0 —
zj−cjz_j-c_j 3 0 5/2 −3/2 0 0 M+3/2

Entering: s1s_1 (most negative zj−cj=−3/2z_j-c_j=−3/2). Leaving: s2s_2 (smallest ratio 4). Pivot element: 1/2.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 A1A_1
x1x_1 3 3 1 3 0 1 0 0
s1s_1 0 4 0 5 1 2 0 −1
s3s_3 0 4 0 1 0 0 1 0
zj−cjz_j-c_j 9 0 10 0 3 0 M

All zj−cj≥0z_j-c_j\ge0 and A1A_1 is out of the basis: optimal.

Answer. x1=3,x2=0,maxZ=9.x_1=3,\quad x_2=0,\qquad\boxed{\max Z=9}. Here s1=4s_1=4 (the first constraint is exceeded: 6≥26\ge2) and s3=4s_3=4. Check: 3+0=3≤33+0=3\le3.

✓ Checked by computer We checked in Python (scipy linprog): the maximum is Z = 9 at x₁ = 3, x₂ = 0, the same as the Big-M tables below (exact fractions).

↑ Back to the question list

Define the primal LP problem and its dual. Show that the optimal values of objective function under both the primal and dual problems are equal, if they are finite.

2003 · Paper II · Q1d · 12 marks

Solution

Primal. (P)Maximise Z=CTXsubject toAX≤b,X≥0,\text{(P)}\quad\text{Maximise }Z=C^TX\quad\text{subject to}\quad AX\le b,\ X\ge0 , with AA an m×nm\times n matrix.

Dual. (D)Minimise W=bTYsubject toATY≥C,Y≥0,\text{(D)}\quad\text{Minimise }W=b^TY\quad\text{subject to}\quad A^TY\ge C,\ Y\ge0 , with one dual variable yiy_i for each primal constraint. (Each primal variable gives a dual constraint; the roles of bb and CC are exchanged; the matrix is transposed; max ↔︎ min; ≤\le ↔︎ ≥\ge.)

Theorem. If both have finite optimal solutions, then maxZ=minW\max Z=\min W.

Step 1 (weak duality). If XX is feasible for (P) and YY for (D): CTX≤(ATY)TX=YTAX≤YTb.C^TX\le(A^TY)^TX=Y^TAX\le Y^Tb . So every feasible ZZ is ≤\le every feasible WW; in particular maxZ≤minW\max Z\le\min W.

Step 2 (equality). Let X*X^* be optimal for (P), obtained by the simplex method after adding slacks SS (AX+IS=bAX+IS=b), with optimal basis BB and XB*=B−1bX_B^*=B^{-1}b. The optimality conditions are CBTB−1aj−cj≥0(j=1,…,n),CBTB−1ei≥0(i=1,…,m)C_B^TB^{-1}a_j-c_j\ge0\ (j=1,\dots,n),\qquad C_B^TB^{-1}e_i\ge0\ (i=1,\dots,m) (the second set for the slack columns, whose costs are 0). Put Y*T=CBTB−1Y^{*T}=C_B^TB^{-1}. Then these conditions read ATY*≥CA^TY^*\ge C and Y*≥0Y^*\ge0: Y*Y^* is dual feasible. Moreover bTY*=CBTB−1b=CBTXB*=CTX*=maxZ.b^TY^*=C_B^TB^{-1}b=C_B^TX_B^*=C^TX^*=\max Z . By Step 1, no feasible YY gives WW below CTX*C^TX^*, so Y*Y^* is optimal for (D) and minW=bTY*=CTX*=maxZ.◼\min W=b^TY^*=C^TX^*=\max Z .\qquad\blacksquare

Remarks. The optimal dual variables are the zj−cjz_j-c_j of the slack columns in the final primal table (shadow prices). If one problem has an unbounded objective, the other is infeasible.

✓ Proof checked step by step Every step was checked: weak duality c’x ≤ b’y for feasible pairs, and the construction y* = (c_B’B⁻¹)’ from the optimal primal table, which is dual feasible with b’y* = c’x*.

↑ Back to the question list

Show that the set of all feasible solutions of a L.P. problem is a convex set, bounded by hyperplanes.

2003 · Paper II · Q3a · 15 marks

Solution

Definitions.

  • A hyperplane in ℝn\mathbb R^n is a set H={X:aTX=β}H=\{X:a^TX=\beta\} (a≠0a\ne0). It divides ℝn\mathbb R^n into two closed half-spaces {aTX≤β}\{a^TX\le\beta\} and {aTX≥β}\{a^TX\ge\beta\}, of which HH is the boundary.
  • A set SS is convex if X1,X2∈SX_1,X_2\in S and 0≤λ≤10\le\lambda\le1 imply λX1+(1−λ)X2∈S\lambda X_1+(1-\lambda)X_2\in S.

The feasible set. For the LPP with constraints aiTX≤bi(i=1,…,m),xj≥0(j=1,…,n),a_i^TX\le b_i\ (i=1,\dots,m),\qquad x_j\ge0\ (j=1,\dots,n), the feasible set is S=⋂i=1m{X:aiTX≤bi}∩⋂j=1n{X:xj≥0}.S=\bigcap_{i=1}^m\{X:a_i^TX\le b_i\}\ \cap\ \bigcap_{j=1}^n\{X:x_j\ge0\}. (Equality constraints are intersections of two half-spaces, and ≥\ge constraints are half-spaces too.)

Step 1. Each half-space is convex. Let X1,X2X_1,X_2 satisfy aTX≤βa^TX\le\beta and 0≤λ≤10\le\lambda\le1. Then aT(λX1+(1−λ)X2)=λaTX1+(1−λ)aTX2≤λβ+(1−λ)β=β.a^T(\lambda X_1+(1-\lambda)X_2)=\lambda a^TX_1+(1-\lambda)a^TX_2\le\lambda\beta+(1-\lambda)\beta=\beta . So the half-space contains the segment joining any two of its points. The same holds for a hyperplane (with equality).

Step 2. An intersection of convex sets is convex. If X1,X2X_1,X_2 lie in every set of the family, so does each point of the segment between them, since each set is convex.

Step 3. Conclusion. SS is a finite intersection of closed half-spaces, so it is convex; it is also closed. Its boundary consists of points of SS that lie on at least one of the bounding hyperplanes aiTX=biorxj=0.a_i^TX=b_i\quad\text{or}\quad x_j=0 . Thus the feasible set is a convex set (a convex polyhedron) bounded by hyperplanes. Its extreme points are the points where at least nn linearly independent bounding hyperplanes meet; they correspond to the basic feasible solutions. ∎

(Directly: for X1,X2∈SX_1,X_2\in S, A(λX1+(1−λ)X2)≤bA(\lambda X_1+(1-\lambda)X_2)\le b and λX1+(1−λ)X2≥0\lambda X_1+(1-\lambda)X_2\ge0, as in the standard proof.)

✓ Proof checked step by step Every step was checked: convexity of the feasible set via convex combinations, and its description as an intersection of finitely many closed half-spaces bounded by the hyperplanes aᵢᵀx = bᵢ and x_j = 0.

↑ Back to the question list

What is a linear programming problem? What are the assumptions made in a linear programming problem? The manager of an oil refinery company must decide on the optimal mix of two possible blending processes of which the inputs and the outputs per production run are as follows:

Processes Input (units): Crude-1 Input (units): Crude-2 Output (units): Petrol superior Output (units): Petrol ordinary
A 10 6 10 16
B 12 15 12 12

The availability of the two varieties is limited to the extent of 400 units and 450 units, respectively, per day. The market demand indicates that at least 200 units and 240 units of superior and ordinary quality petrol, respectively, is required every day. The profitability analysis indicates that the process A contributed Rs. 480 per run while the process B contributed Rs. 400 per run, The manager is interested in determining an optimal product mix to maximize company’s profit. Formulate this as a linear programming problem.

2002 · Paper II · Q1d · 12 marks

Solution

Linear programming problem. An LPP is the problem of choosing non-negative values of decision variables so as to maximise or minimise a linear objective function subject to a set of linear equality or inequality constraints, representing limited resources and requirements.

Assumptions.

  1. Proportionality (linearity): the contribution of each activity to the objective and to each constraint is proportional to its level.
  2. Additivity: the total of each is the sum of the contributions of the individual activities (no interaction).
  3. Divisibility (continuity): variables may take fractional values.
  4. Certainty: all coefficients cjc_j, aija_{ij}, bib_i are known constants.
  5. Non-negativity: activity levels cannot be negative.
  6. Finiteness: a finite number of activities and constraints; a single objective.

Formulation. Let x1x_1 and x2x_2 be the numbers of production runs of processes AA and BB per day.

Objective (profit): Maximise Z=480x1+400x2.\text{Maximise }Z=480x_1+400x_2 .

Availability of crude oil: 10x1+12x2≤400(Crude-1),6x1+15x2≤450(Crude-2).10x_1+12x_2\le400\quad(\text{Crude-1}),\qquad 6x_1+15x_2\le450\quad(\text{Crude-2}).

Market demand: 10x1+12x2≥200(superior petrol),16x1+12x2≥240(ordinary petrol).10x_1+12x_2\ge200\quad(\text{superior petrol}),\qquad 16x_1+12x_2\ge240\quad(\text{ordinary petrol}).

Non-negativity: x1,x2≥0x_1,x_2\ge0.

(Solving this model gives x1=40x_1=40, x2=0x_2=0, Z=₹19,200Z=₹19{,}200; Crude-1 is fully used.)

✓ Checked by computer Every constraint was checked against the table; we also solved the model in Python (scipy linprog) as a check: 40 runs of A, profit ₹19,200.

↑ Back to the question list

Write down the dual of the following linear programming problem and solve it by using simplex method Minimize Y=24y1+21y2+9y3 subject to y1+3y2+y3≥2,4y1+y2+y3≥5,y1≥0,y2≥0,y3≥0.

2002 · Paper II · Q3a · 15 marks

Solution

The dual. The primal is a minimisation with ≥\ge constraints and y≥0y\ge0; its dual is a maximisation with ≤\le constraints. With dual variables x1,x2≥0x_1,x_2\ge0 for the two constraints: Maximise Z=2x1+5x2\text{Maximise }Z=2x_1+5x_2 subject to x1+4x2≤243x1+x2≤21x1+x2≤9x1,x2≥0\begin{aligned}x_1+4x_2&\le24\\ 3x_1+x_2&\le21\\ x_1+x_2&\le9\\ x_1,x_2&\ge0\end{aligned}

Solve the dual by the simplex method. Add slacks s1,s2,s3s_1,s_2,s_3:

Table 1.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 Ratio
s1s_1 0 24 1 4 1 0 0 6
s2s_2 0 21 3 1 0 1 0 21
s3s_3 0 9 1 1 0 0 1 9
zj−cjz_j-c_j 0 −2 −5 0 0 0

Entering: x2x_2 (most negative zj−cj=−5z_j-c_j=−5). Leaving: s1s_1 (smallest ratio 6). Pivot element: 4.

Table 2.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3 Ratio
x2x_2 5 6 1/4 1 1/4 0 0 24
s2s_2 0 15 11/4 0 −1/4 1 0 60/11
s3s_3 0 3 3/4 0 −1/4 0 1 4
zj−cjz_j-c_j 30 −3/4 0 5/4 0 0

Entering: x1x_1 (most negative zj−cj=−3/4z_j-c_j=−3/4). Leaving: s3s_3 (smallest ratio 4). Pivot element: 3/4.

Table 3.

Basis cBc_B xBx_B x1x_1 x2x_2 s1s_1 s2s_2 s3s_3
x2x_2 5 5 0 1 1/3 0 −1/3
s2s_2 0 4 0 0 2/3 1 −11/3
x1x_1 2 4 1 0 −1/3 0 4/3
zj−cjz_j-c_j 33 0 0 1 0 1

All zj−cj≥0z_j-c_j\ge0: optimal.

Dual solution: x1=4,x2=5x_1=4,\ x_2=5, maxZ=8+25=33\max Z=8+25=33.

Primal solution from the final table. The optimal values of the primal variables y1,y2,y3y_1,y_2,y_3 are the zj−cjz_j-c_j of the slack columns s1,s2,s3s_1,s_2,s_3: y1=1,y2=0,y3=1,minY=24(1)+21(0)+9(1)=33=maxZ.y_1=1,\quad y_2=0,\quad y_3=1,\qquad\boxed{\min Y=24(1)+21(0)+9(1)=33=\max Z}. Check: 1+0+1=2≥21+0+1=2\ge2 and 4+0+1=5≥54+0+1=5\ge5. Complementary slackness also holds: s2=4>0s_2=4>0, so y2=0y_2=0.

✓ Checked by computer We checked in Python (scipy linprog): both problems have optimal value 33; the dual (maximisation) has x₁ = 4, x₂ = 5, and the primal y = (1, 0, 1), read from the final table.

↑ Back to the question list

Discuss briefly sensitivity analysis in the context of a linear programming problem: Maximize Z=C_′X_ subject to AX_≤b_,X_>0_, pertaining to instantaneous changes in (i) the coefficients of the objective function, (ii) b_ and (iii) coefficients aij in the matrix A.

2002 · Paper II · Q4c · 15 marks

Solution

Let the optimal simplex table of Max Z=C′X,AX≤b,X≥0\text{Max }Z=C'X,\quad AX\le b,\quad X\ge0 have basis BB, so XB=B−1b≥0X_B=B^{-1}b\ge0 and zj−cj=CB′B−1aj−cj≥0z_j-c_j=C_B'B^{-1}a_j-c_j\ge0 for all jj. Sensitivity analysis asks how far the data may change before this basis stops being optimal, and what the new solution is. A change may affect feasibility (XB≥0X_B\ge0), optimality (zj−cj≥0z_j-c_j\ge0), or both.

(i) Changes in the objective coefficients cjc_j (affect optimality only).

  • Non-basic xkx_k: only zk−ckz_k-c_k changes. If ckc_k becomes ck+Δc_k+\Delta, then zk−ckz_k-c_k becomes (zk−ck)−Δ(z_k-c_k)-\Delta. The solution stays optimal while Δ≤zk−ck\Delta\le z_k-c_k. If it becomes negative, xkx_k enters and we continue with the simplex method.
  • Basic xrx_r (in row rr): CBC_B changes, so every non-basic zj−cjz_j-c_j changes to (zj−cj)+Δyrj(z_j-c_j)+\Delta\,y_{rj}, where yrjy_{rj} is the entry in row rr, column jj of the table. The solution stays optimal while all these are ≥0\ge0: maxyrj>0(−zj−cjyrj)≤Δ≤minyrj<0(−zj−cjyrj).\max_{y_{rj}>0}\left(-\frac{z_j-c_j}{y_{rj}}\right)\le\Delta\le\min_{y_{rj}<0}\left(-\frac{z_j-c_j}{y_{rj}}\right). Within the range, XX is unchanged and ZZ changes by Δxr\Delta\,x_r.

(ii) Changes in the resource vector bb (affect feasibility only).

  • The zj−cjz_j-c_j do not involve bb, so optimality is kept. The new basic solution is XB=B−1(b+Δb)X_B=B^{-1}(b+\Delta b).
  • For a change Δ\Delta in bkb_k alone: XB+Δβk≥0X_B+\Delta\beta_k\ge0, where βk\beta_k is column kk of B−1B^{-1} (the column of the kk-th slack in the final table). This gives the range of bkb_k.
  • Within the range, ZZ changes by Δyk\Delta\,y_k, where yky_k is the shadow price (the zj−cjz_j-c_j of slack kk). Outside it, some xBi<0x_{Bi}<0 and the dual simplex method restores feasibility.

(iii) Changes in the coefficients aija_{ij}.

  • Column of a non-basic variable xkx_k: BB is unchanged, so feasibility is not affected; recompute zk−ck=CB′B−1aknew−ckz_k-c_k=C_B'B^{-1}a_k^{\text{new}}-c_k. If it is ≥0\ge0 the solution stays optimal; otherwise xkx_k enters (put the new column B−1aknewB^{-1}a_k^{\text{new}} into the table and iterate).
  • Column of a basic variable: BB itself changes, so B−1B^{-1}, XBX_B and all zj−cjz_j-c_j may change; both feasibility and optimality must be re-checked, and usually the problem is re-solved (or the new column is inserted and pivoted back into the basis).

These “instantaneous” (discrete) changes are thus handled from the final table, which saves recomputation and shows how stable the optimal plan is.

✓ Answer checked step by step Every result was checked against standard post-optimality formulas: z_j − c_j = c_Bᵀ B⁻¹ a_j − c_j for changes in c and in a_ij of non-basic columns, and X_B = B⁻¹b ≥ 0 for changes in b.

↑ Back to the question list

Formulate a general linear programming problem (LPP). Define slack and surplus variables and explain their role in this context.

2001 · Paper II · Q1d · 12 marks

Solution

General linear programming problem. Find x1,x2,…,xnx_1,x_2,\dots,x_n which optimise (maximise or minimise) Z=c1x1+c2x2+…+cnxnZ=c_1x_1+c_2x_2+\dots+c_nx_n subject to the mm constraints a11x1+a12x2+…+a1nxn(≤,=,≥)b1a21x1+a22x2+…+a2nxn(≤,=,≥)b2⋮am1x1+am2x2+…+amnxn(≤,=,≥)bm\begin{aligned}a_{11}x_1+a_{12}x_2+\dots+a_{1n}x_n&\ (\le,=,\ge)\ b_1\\ a_{21}x_1+a_{22}x_2+\dots+a_{2n}x_n&\ (\le,=,\ge)\ b_2\\ &\ \ \vdots\\ a_{m1}x_1+a_{m2}x_2+\dots+a_{mn}x_n&\ (\le,=,\ge)\ b_m\end{aligned} and the non-negativity restrictions x1,x2,…,xn≥0x_1,x_2,\dots,x_n\ge0. In matrix form: optimise Z=CTXZ=C^TX subject to AX(≤,=,≥)bAX\ (\le,=,\ge)\ b, X≥0X\ge0. Here cjc_j are cost/profit coefficients, aija_{ij} technological coefficients, bib_i resource availabilities or requirements.

Slack variables. For a ≤\le constraint ∑jaijxj≤bi\sum_ja_{ij}x_j\le b_i, the non-negative quantity si=bi−∑jaijxjs_i=b_i-\sum_ja_{ij}x_j is the slack: the unused part of resource ii. Adding it gives the equation ∑jaijxj+si=bi\sum_ja_{ij}x_j+s_i=b_i.

Surplus variables. For a ≥\ge constraint ∑jaijxj≥bi\sum_ja_{ij}x_j\ge b_i, the non-negative quantity si=∑jaijxj−bis_i=\sum_ja_{ij}x_j-b_i is the surplus: the excess over the requirement. Subtracting it gives ∑jaijxj−si=bi\sum_ja_{ij}x_j-s_i=b_i.

Their role.

  1. They convert the inequalities into equations, giving the standard form AX=bAX=b, X≥0X\ge0, on which the simplex method works.
  2. They have zero coefficients in the objective, so they do not change its value.
  3. Slack variables provide the initial basic feasible solution (identity basis) for ≤\le constraints; surplus variables cannot (their coefficient is −1-1), so artificial variables are added alongside them.
  4. In the final table they show which constraints are binding (slack/surplus = 0) and how much resource is idle (slack > 0); their zj−cjz_j-c_j are the shadow prices (dual values) of the constraints.

✓ Answer checked step by step Every point was checked against the standard general LPP and the role of slack and surplus variables in reaching the standard form AX = b, X ≥ 0.

↑ Back to the question list

Obtain a necessary and sufficient condition for a basic feasible solution of a LPP to be an optimal solution.

2001 · Paper II · Q3a · 20 marks

Solution

Setting. Maximise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0, where AA is m×nm\times n of rank mm. Let BB be a basis with basic feasible solution XB=B−1b≥0X_B=B^{-1}b\ge0 and value ZB=CBTXBZ_B=C_B^TX_B. For each column aja_j of AA write yj=B−1aj,zj=CBTyj.y_j=B^{-1}a_j,\qquad z_j=C_B^Ty_j .

Theorem. The basic feasible solution XBX_B is optimal if zj−cj≥0z_j-c_j\ge0 for every jj. Conversely, if XBX_B is non-degenerate and optimal, then zj−cj≥0z_j-c_j\ge0 for every jj.

Key identity. Let XX be any feasible solution, with basic part X(B)X^{(B)} and non-basic part xjx_j (j∈Nj\in N). From AX=bAX=b: BX(B)+∑j∈Najxj=b⇒X(B)=B−1b−∑j∈Nyjxj=XB−∑j∈Nyjxj.BX^{(B)}+\sum_{j\in N}a_jx_j=b\ \Longrightarrow\ X^{(B)}=B^{-1}b-\sum_{j\in N}y_jx_j=X_B-\sum_{j\in N}y_jx_j . Hence Z(X)=CBTX(B)+∑j∈Ncjxj=CBTXB−∑j∈N(CBTyj−cj)xj=ZB−∑j∈N(zj−cj)xj.Z(X)=C_B^TX^{(B)}+\sum_{j\in N}c_jx_j=C_B^TX_B-\sum_{j\in N}(C_B^Ty_j-c_j)x_j=Z_B-\sum_{j\in N}(z_j-c_j)x_j . (For basic jj, yjy_j is a unit vector and zj−cj=0z_j-c_j=0.)

Sufficiency. If all zj−cj≥0z_j-c_j\ge0, then since every xj≥0x_j\ge0, Z(X)=ZB−∑j∈N(zj−cj)xj≤ZBZ(X)=Z_B-\sum_{j\in N}(z_j-c_j)x_j\le Z_B for every feasible XX. So XBX_B is optimal.

Necessity. Suppose XBX_B is non-degenerate (XB>0X_B>0) and zk−ck<0z_k-c_k<0 for some non-basic kk. Give xkx_k a small value θ>0\theta>0 and keep the other non-basic variables at zero. Then X(B)=XB−θyk≥0for 0<θ≤minyik>0xBiyik(or any θ if yk≤0),X^{(B)}=X_B-\theta y_k\ge0\quad\text{for }0<\theta\le\min_{y_{ik}>0}\frac{x_{Bi}}{y_{ik}}\ (\text{or any }\theta\text{ if }y_k\le0), which is possible because XB>0X_B>0. This XX is feasible and Z(X)=ZB−θ(zk−ck)>ZB,Z(X)=Z_B-\theta(z_k-c_k)>Z_B , so XBX_B is not optimal. Hence at an optimal non-degenerate BFS all zj−cj≥0z_j-c_j\ge0. ∎

Remarks. (1) For minimisation the condition is zj−cj≤0z_j-c_j\le0. (2) For a degenerate BFS the condition is sufficient but not necessary: the step θ\theta may be forced to 0. (3) If zk−ck<0z_k-c_k<0 and yk≤0y_k\le0, then θ\theta can be made arbitrarily large and ZZ is unbounded.

✓ Proof checked step by step Every step was checked: Z = Z_B − Σ (z_j − c_j) x_j over non-basic j for any feasible solution, giving sufficiency; necessity follows by raising one x_k with z_k − c_k < 0 at a non-degenerate BFS.

↑ Back to the question list

What do you understand by sensitivity analysis with reference to a Linear Programming Problem? Explain.

2000 · Paper II · Q1e · 12 marks

Solution

Meaning. After an LPP has been solved, sensitivity analysis (also called post-optimality analysis) examines how the optimal solution and the optimal value respond to changes in the data of the problem. The coefficients of an LP model — unit profits or costs cjc_j, resource availabilities bib_i and input requirements aija_{ij} — are usually estimates and may change. Instead of solving the changed problem from the beginning, sensitivity analysis uses the final simplex table (B−1B^{-1}, XBX_B and the zj−cjz_j-c_j) to answer questions such as:

  • Within what range can a cjc_j vary without changing the optimal product mix?
  • Within what range can a bib_i vary while the same variables remain basic, and what is the shadow price of each resource?
  • Is a new product (a new variable) worth introducing?
  • Does a new restriction (a new constraint) change the optimal plan?
  • What happens if the technological coefficients aija_{ij} change?

How the changes act. In the optimal table, optimality requires zj−cj=CBTB−1aj−cj≥0z_j-c_j=C_B^TB^{-1}a_j-c_j\ge0 and feasibility requires XB=B−1b≥0X_B=B^{-1}b\ge0.

  • A change in cjc_j affects only the zj−cjz_j-c_j (optimality). If optimality is lost, the primal simplex method continues.
  • A change in bb affects only XBX_B (feasibility). If feasibility is lost, the dual simplex method restores it.
  • A change in aija_{ij} of a non-basic variable affects only its zj−cjz_j-c_j; a change in a basic column alters B−1B^{-1} and may affect both.
  • A new variable is tested by its zj−cjz_j-c_j; a new constraint, if violated, is added and the dual simplex method is applied.

Why it matters. It shows how robust the decision is to errors in the data, identifies the critical resources and their marginal worth, and lets management respond quickly to changes in markets, technology and capacity. (Parametric programming extends the idea to continuous changes in a parameter.)

✓ Answer checked step by step Every point was checked against the standard meaning of sensitivity (post-optimality) analysis and the changes it covers.

↑ Back to the question list

Obtain the rules for choosing the incoming variable and the outgoing variable in the simplex method of solving a linear programming problem.

2000 · Paper II · Q3a · 25 marks

Solution

Setting. Maximise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0. Let BB be the current basis with basic feasible solution XB=B−1b≥0X_B=B^{-1}b\ge0 and value ZB=CBTXBZ_B=C_B^TX_B. For each column put yj=B−1ajy_j=B^{-1}a_j (the column of the simplex table) and zj=CBTyjz_j=C_B^Ty_j.

Effect of introducing a non-basic variable. Keep all non-basic variables at zero except xkx_k, which is raised to θ≥0\theta\ge0. To keep AX=bAX=b, BX(B)+θak=b⇒X(B)=XB−θyk,i.e.xBi(θ)=xBi−θyik,BX^{(B)}+\theta a_k=b\ \Longrightarrow\ X^{(B)}=X_B-\theta y_k,\quad\text{i.e.}\quad x_{Bi}(\theta)=x_{Bi}-\theta y_{ik}, and the objective becomes Z(θ)=CBT(XB−θyk)+ckθ=ZB−θ(zk−ck).Z(\theta)=C_B^T(X_B-\theta y_k)+c_k\theta=Z_B-\theta(z_k-c_k).

Rule for the incoming variable.

  • ZZ increases with θ\theta only if zk−ck<0z_k-c_k<0. If all zj−cj≥0z_j-c_j\ge0, no variable can improve ZZ and the solution is optimal.
  • Each unit of xkx_k increases ZZ by −(zk−ck)-(z_k-c_k). The usual (Dantzig) rule takes the variable giving the largest increase per unit: zk−ck=minj{zj−cj:zj−cj<0}.z_k-c_k=\min_j\{z_j-c_j:z_j-c_j<0\}. This variable enters the basis. (Any variable with zj−cj<0z_j-c_j<0 would improve ZZ; the most negative is a convenient choice.)

Rule for the outgoing variable. As θ\theta increases, the basic variables change as xBi−θyikx_{Bi}-\theta y_{ik}. Feasibility requires all of them to stay ≥0\ge0.

  • If yik≤0y_{ik}\le0, xBix_{Bi} does not decrease, so it sets no limit.
  • If yik>0y_{ik}>0, we need θ≤xBi/yik\theta\le x_{Bi}/y_{ik}.

So the largest permissible value is θ*=mini{xBiyik:yik>0}=xBryrk.\theta^*=\min_i\left\{\frac{x_{Bi}}{y_{ik}}:y_{ik}>0\right\}=\frac{x_{Br}}{y_{rk}} . At θ=θ*\theta=\theta^* the basic variable xBrx_{Br} becomes zero; it leaves the basis and xkx_k takes its place. This is the minimum ratio rule, and yrky_{rk} is the pivot element. The new solution is again basic and feasible, with Znew=ZB−θ*(zk−ck)≥ZB.Z_{\text{new}}=Z_B-\theta^*(z_k-c_k)\ge Z_B .

Special cases.

  • If yik≤0y_{ik}\le0 for all ii, θ\theta can be increased without limit and Z→∞Z\to\infty: the problem is unbounded.
  • If several ratios tie, the new solution is degenerate; ties are broken by a rule such as the lexicographic rule or Bland’s rule to avoid cycling.
  • For minimisation, the incoming variable is the one with the most positive zj−cjz_j-c_j; the outgoing rule is the same.

✓ Proof checked step by step Every step was checked: the identity Z = Z_B − Σ (z_j − c_j)x_j gives the entering rule, and X_B − θ y_k ≥ 0 gives the minimum-ratio leaving rule (with the unboundedness case).

↑ Back to the question list

Define the dual of a linear programming problem (LPP). Also explain the relationships between the solutions of the primal LPP and its dual. If the primal problem has an unbounded solution what can you say about the solution of the dual?

2000 · Paper II · Q4c · 15 marks

Solution

Dual of an LPP. To every LPP (the primal) there corresponds another LPP (the dual), formed from the same data. For the primal Max Z=CTX,AX≤b,X≥0,\text{Max }Z=C^TX,\quad AX\le b,\quad X\ge0, the dual is Min W=bTY,ATY≥C,Y≥0.\text{Min }W=b^TY,\quad A^TY\ge C,\quad Y\ge0 . Rules: one dual variable per primal constraint; one dual constraint per primal variable; objective coefficients and right-hand sides are interchanged; AA is transposed; max ↔︎ min. An equality constraint gives an unrestricted dual variable, and an unrestricted primal variable gives an equality dual constraint. The dual of the dual is the primal.

Relationships between the solutions.

  1. Weak duality: for any feasible XX and YY, CTX≤bTYC^TX\le b^TY. So any feasible dual solution gives an upper bound on the primal objective.
  2. Optimality criterion: if feasible X*X^*, Y*Y^* satisfy CTX*=bTY*C^TX^*=b^TY^*, both are optimal.
  3. Strong duality: if either problem has a finite optimal solution, so has the other, and maxZ=minW\max Z=\min W.
  4. Complementary slackness: at optimality, if a primal constraint is slack, the corresponding dual variable is zero; if a primal variable is positive, the corresponding dual constraint is binding (and vice versa).
  5. Reading the dual from the primal table: the optimal dual variables are Y*T=CBTB−1Y^{*T}=C_B^TB^{-1}, which appear as the zj−cjz_j-c_j of the slack (or artificial) columns in the final primal table. They are the shadow prices of the resources.
  6. Possible combinations:
Primal Dual
finite optimum finite optimum (equal values)
unbounded infeasible
infeasible unbounded or infeasible

If the primal is unbounded. Then the dual has no feasible solution. Proof: if the dual had a feasible YY, weak duality would give CTX≤bTYC^TX\le b^TY for every feasible XX, a finite bound, contradicting unboundedness. (The converse is not quite true: if the dual is infeasible, the primal may be unbounded or also infeasible.)

✓ Answer checked step by step Every statement was checked against the duality theorems: dual definition and formation rules, weak and strong duality, complementary slackness, and the infeasible/unbounded cases.

↑ Back to the question list

For a linear programming problem, explain the following terms (i) Convex cone (ii) Feasible solution (iii) Extreme point (iv) Optimal basic feasible solution (v) Artificial variables.

1999 · Paper II · Q5b · 20 marks

Solution

Consider the LPP: optimise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0.

(i) Convex cone. A set K⊆ℝnK\subseteq\mathbb R^n is a cone if X∈KX\in K implies λX∈K\lambda X\in K for every λ≥0\lambda\ge0. It is a convex cone if, in addition, X1,X2∈KX_1,X_2\in K imply X1+X2∈KX_1+X_2\in K; equivalently, λ1X1+λ2X2∈K\lambda_1X_1+\lambda_2X_2\in K for all λ1,λ2≥0\lambda_1,\lambda_2\ge0. Examples: the non-negative orthant {X:X≥0}\{X:X\ge0\}; the set {AX:X≥0}\{AX:X\ge0\} generated by the columns of AA; the set of directions {D:AD=0,D≥0}\{D:AD=0,\ D\ge0\} along which an unbounded feasible region extends. The LPP AX=b,X≥0AX=b,\ X\ge0 is feasible exactly when bb lies in the convex cone generated by the columns of AA.

(ii) Feasible solution. A vector XX that satisfies all the constraints AX=bAX=b and the non-negativity restrictions X≥0X\ge0. The set of feasible solutions is convex.

(iii) Extreme point. A point XX of a convex set SS is an extreme point if it cannot be expressed as λX1+(1−λ)X2\lambda X_1+(1-\lambda)X_2 with X1≠X2X_1\ne X_2 in SS and 0<λ<10<\lambda<1 — it is not an interior point of any segment in SS. For the feasible region of an LPP the extreme points are its corners, and they are exactly the basic feasible solutions.

(iv) Optimal basic feasible solution. A basic feasible solution (one obtained by setting n−mn-m variables to zero, solving for the mm basic variables, with all basic variables non-negative) which also gives the best value of the objective function among all feasible solutions. In the simplex table it is recognised by zj−cj≥0z_j-c_j\ge0 for all jj (maximisation). If an LPP has an optimal solution, it has an optimal BFS.

(v) Artificial variables. Fictitious non-negative variables added to ≥\ge and == constraints so that an identity matrix, and hence an initial basic feasible solution, is available for the simplex method. They have no physical meaning and must be driven to zero, either by giving them a large penalty MM in the objective (Big-M method) or by minimising their sum in Phase I (two-phase method). If an artificial variable remains positive at the optimum, the original problem is infeasible.

✓ Answer checked step by step Every definition was checked against the standard definitions of a convex cone, feasible solution, extreme point, optimal BFS and artificial variables.

↑ Back to the question list

For a given linear programming problem, state its dual and show that the dual of the dual is the primal. Also, state the relationship between the nature of the solutions of the primal and the dual problems.

1999 · Paper II · Q5c · 20 marks

Solution

Primal and dual. Take the primal in canonical form (P)Max Z=CTX,AX≤b,X≥0.\text{(P)}\quad\text{Max }Z=C^TX,\quad AX\le b,\quad X\ge0 . Its dual is (D)Min W=bTY,ATY≥C,Y≥0.\text{(D)}\quad\text{Min }W=b^TY,\quad A^TY\ge C,\quad Y\ge0 . (One dual variable yiy_i for each primal constraint; AA transposed; bb and CC interchanged; max ↔︎ min; ≤\le ↔︎ ≥\ge.)

The dual of the dual is the primal.

  1. Put (D) into the canonical form of a maximisation problem with ≤\le constraints. Since minW=−max(−W)\min W=-\max(-W) and ATY≥C⇔−ATY≤−CA^TY\ge C\iff-A^TY\le-C: (D)Max (−W)=(−b)TY,(−AT)Y≤−C,Y≥0.\text{(D)}\quad\text{Max }(-W)=(-b)^TY,\quad(-A^T)Y\le-C,\quad Y\ge0 .
  2. This has the same form as (P) with C→−bC\to-b, A→−ATA\to-A^T, b→−Cb\to-C. Apply the rule for forming the dual: variables X≥0X\ge0, one for each constraint of (D), Min (−C)TXsubject to(−AT)TX≥−b,X≥0,\text{Min }(-C)^TX\quad\text{subject to}\quad(-A^T)^TX\ge-b,\quad X\ge0 , i.e. Min (−CTX)(-C^TX) subject to −AX≥−b-AX\ge-b, X≥0X\ge0.
  3. Since min(−CTX)=−maxCTX\min(-C^TX)=-\max C^TX and −AX≥−b⇔AX≤b-AX\ge-b\iff AX\le b, this is Max Z=CTX,AX≤b,X≥0,\text{Max }Z=C^TX,\quad AX\le b,\quad X\ge0, which is (P). ∎

So duality is symmetric: either problem may be called the primal.

Relationship between the nature of the solutions.

  • If one has a finite optimal solution, so does the other, and maxZ=minW\max Z=\min W (duality theorem). The optimal dual values are the zj−cjz_j-c_j of the slack columns in the final primal table.
  • If one has an unbounded solution, the other has no feasible solution.
  • If one is infeasible, the other is either unbounded or infeasible.
  • Both may be infeasible (e.g. Max 2x1−x22x_1-x_2 s.t. x1−x2≤1x_1-x_2\le1, −x1+x2≤−2-x_1+x_2\le-2, whose dual Min y1−2y2y_1-2y_2 s.t. y1−y2≥2y_1-y_2\ge2, −y1+y2≥−1-y_1+y_2\ge-1 is also infeasible).
  • For any feasible pair, CTX≤bTYC^TX\le b^TY (weak duality), and at the optimum complementary slackness holds.

✓ Proof checked step by step Every step was checked: writing the dual in the primal’s canonical form and dualising again returns the original problem; and the four possible primal–dual outcomes.

↑ Back to the question list

Explain what you understand by sensitivity analysis in linear programming.

1999 · Paper II · Q6b · 15 marks

Solution

(This is the same question as Q49 (2000, 1e) above. The worked solution is repeated here so that each question is complete.)

Meaning. After an LPP has been solved, sensitivity analysis (also called post-optimality analysis) examines how the optimal solution and the optimal value respond to changes in the data of the problem. The coefficients of an LP model — unit profits or costs cjc_j, resource availabilities bib_i and input requirements aija_{ij} — are usually estimates and may change. Instead of solving the changed problem from the beginning, sensitivity analysis uses the final simplex table (B−1B^{-1}, XBX_B and the zj−cjz_j-c_j) to answer questions such as:

  • Within what range can a cjc_j vary without changing the optimal product mix?
  • Within what range can a bib_i vary while the same variables remain basic, and what is the shadow price of each resource?
  • Is a new product (a new variable) worth introducing?
  • Does a new restriction (a new constraint) change the optimal plan?
  • What happens if the technological coefficients aija_{ij} change?

How the changes act. In the optimal table, optimality requires zj−cj=CBTB−1aj−cj≥0z_j-c_j=C_B^TB^{-1}a_j-c_j\ge0 and feasibility requires XB=B−1b≥0X_B=B^{-1}b\ge0.

  • A change in cjc_j affects only the zj−cjz_j-c_j (optimality). If optimality is lost, the primal simplex method continues.
  • A change in bb affects only XBX_B (feasibility). If feasibility is lost, the dual simplex method restores it.
  • A change in aija_{ij} of a non-basic variable affects only its zj−cjz_j-c_j; a change in a basic column alters B−1B^{-1} and may affect both.
  • A new variable is tested by its zj−cjz_j-c_j; a new constraint, if violated, is added and the dual simplex method is applied.

Why it matters. It shows how robust the decision is to errors in the data, identifies the critical resources and their marginal worth, and lets management respond quickly to changes in markets, technology and capacity. (Parametric programming extends the idea to continuous changes in a parameter.)

✓ Answer checked step by step Every point was checked against the standard meaning of sensitivity (post-optimality) analysis and the changes it covers.

↑ Back to the question list

State the general linear programming problem. Give its mathematical formulation and explain the terms: (i) Basic solution (ii) Feasible solution (iii) Basic feasible solution, and (iv) Optimal solution.

1998 · Paper II · Q10b · 20 marks

Solution

General LPP. Find the values of the decision variables x1,x2,…,xnx_1,x_2,\dots,x_n that optimise (maximise or minimise) the linear objective function Z=c1x1+c2x2+…+cnxnZ=c_1x_1+c_2x_2+\dots+c_nx_n subject to the linear constraints ∑j=1naijxj(≤,=,≥)bi,i=1,2,…,m,\sum_{j=1}^na_{ij}x_j\ (\le,=,\ge)\ b_i,\qquad i=1,2,\dots,m, and the non-negativity restrictions xj≥0x_j\ge0, j=1,…,nj=1,\dots,n.

Mathematical formulation (matrix form). With X=(x1,…,xn)TX=(x_1,\dots,x_n)^T, C=(c1,…,cn)TC=(c_1,\dots,c_n)^T, b=(b1,…,bm)Tb=(b_1,\dots,b_m)^T and A=(aij)m×nA=(a_{ij})_{m\times n}: Optimise Z=CTXsubject toAX(≤,=,≥)b,X≥0.\text{Optimise }Z=C^TX\quad\text{subject to}\quad AX\ (\le,=,\ge)\ b,\qquad X\ge0 . After adding slack/surplus variables, the standard form is AX=bAX=b, X≥0X\ge0, b≥0b\ge0, where now AA is m×Nm\times N (N>mN>m) of rank mm.

(i) Basic solution. Choose mm variables whose columns in AA are linearly independent (the basis BB). Set the remaining N−mN-m (non-basic) variables equal to zero and solve BXB=bBX_B=b; the resulting solution XB=B−1bX_B=B^{-1}b, with the zeros, is a basic solution. There are at most (Nm)\binom Nm basic solutions. If some basic variable is zero the basic solution is degenerate.

(ii) Feasible solution. Any XX that satisfies all the constraints and the non-negativity restrictions.

(iii) Basic feasible solution (BFS). A basic solution which is also feasible, i.e. all basic variables are non-negative. Geometrically, BFSs are the corner (extreme) points of the feasible region. A BFS with all basic variables positive is non-degenerate.

(iv) Optimal solution. A feasible solution that gives the best (maximum or minimum) value of ZZ among all feasible solutions. If an optimal solution exists, at least one optimal solution is a BFS; in the simplex method it is identified by zj−cj≥0z_j-c_j\ge0 for all jj (maximisation).

Example. For x1+x2+s1=4x_1+x_2+s_1=4, x1−x2+s2=2x_1-x_2+s_2=2 (m=2m=2, N=4N=4): setting x2=s1=0x_2=s_1=0 gives x1=4x_1=4, s2=−2s_2=-2, a basic but infeasible solution; setting s1=s2=0s_1=s_2=0 gives x1=3x_1=3, x2=1x_2=1, a basic feasible solution.

✓ Answer checked step by step Every definition was checked against the standard formulation of the general LPP and the meanings of basic, feasible, basic feasible and optimal solutions.

↑ Back to the question list

Show that the optimal solution of a linear programming problem can be found amongst its feasible solutions.

1998 · Paper II · Q10c · 20 marks

Solution

Theorem. If an LPP has an optimal (feasible) solution, then it has an optimal solution among its basic feasible solutions. Hence the optimum can be found by examining the finitely many basic feasible solutions (as the simplex method does).

Setting. Maximise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0, AA of order m×nm\times n and rank mm. Let X0X^0 be an optimal feasible solution with kk positive components, say x1,…,xk>0x_1,\dots,x_k>0 and xk+1=…=xn=0x_{k+1}=\dots=x_n=0, so that ∑j=1kxjaj=b.\sum_{j=1}^kx_ja_j=b .

Case 1. If a1,…,aka_1,\dots,a_k are linearly independent (k≤mk\le m), X0X^0 is already a basic feasible solution (add m−km-k further columns to complete a basis if k<mk<m; the solution is then degenerate). Done.

Case 2. If a1,…,aka_1,\dots,a_k are dependent, there are λ1,…,λk\lambda_1,\dots,\lambda_k, not all zero, with ∑j=1kλjaj=0.\sum_{j=1}^k\lambda_ja_j=0 . For any real ε\varepsilon, X(ε)X(\varepsilon) with components xj−ελjx_j-\varepsilon\lambda_j (j≤kj\le k) and 0 otherwise satisfies AX(ε)=bAX(\varepsilon)=b, and it is feasible for |ε||\varepsilon| small enough, since xj>0x_j>0.

  • The objective does not change. CTX(ε)=CTX0−ε∑j≤kcjλjC^TX(\varepsilon)=C^TX^0-\varepsilon\sum_{j\le k}c_j\lambda_j. If ∑cjλj≠0\sum c_j\lambda_j\ne0, choosing a small ε\varepsilon of the appropriate sign would give a feasible solution better than X0X^0, which is impossible. So ∑cjλj=0\sum c_j\lambda_j=0 and CTX(ε)=CTX0C^TX(\varepsilon)=C^TX^0 for all feasible ε\varepsilon.
  • Reduce the number of positive components. Changing the signs of all λj\lambda_j if necessary, assume some λj>0\lambda_j>0 and take ε*=minλj>0xjλj>0.\varepsilon^*=\min_{\lambda_j>0}\frac{x_j}{\lambda_j}>0 . Then X(ε*)≥0X(\varepsilon^*)\ge0, at least one component becomes zero, and X(ε*)X(\varepsilon^*) is still optimal, with at most k−1k-1 positive components.

Repeat the argument. After a finite number of steps the positive components correspond to linearly independent columns, i.e. we reach an optimal basic feasible solution. ∎

Since there are at most (nm)\binom nm basic feasible solutions, the optimal solution can be found among them; the simplex method searches these systematically.

✓ Proof checked step by step Every step was checked: a non-basic feasible solution can be reduced, by removing a linear dependence among its positive columns, to a basic feasible solution with at least as good an objective value (when the optimum is finite).

↑ Back to the question list

Show that the objective function of a linear programming problem (LPP) will assume its minimum value at an extreme point of the convex set of feasible solutions of the LPP. If the objective function assumes the minimum value at more than one point then show that it will assume this minimum value at infinite number of points.

1997 · Paper II · Q10a · 20 marks

Solution

Setting. Minimise Z=CTXZ=C^TX over the convex set S={X:AX=b,X≥0}S=\{X:AX=b,\ X\ge0\}, assumed bounded, with extreme points X1,…,XkX_1,\dots,X_k (finitely many, since they are the basic feasible solutions).

Part 1. The minimum is attained at an extreme point. Let X0∈SX_0\in S give the minimum Z0=CTX0Z_0=C^TX_0. Since SS is a bounded convex polyhedron, X0X_0 is a convex combination of the extreme points: X0=∑i=1kλiXi,λi≥0,∑i=1kλi=1.X_0=\sum_{i=1}^k\lambda_iX_i,\qquad\lambda_i\ge0,\quad\sum_{i=1}^k\lambda_i=1 . Let XpX_p be an extreme point with CTXp=miniCTXiC^TX_p=\min_iC^TX_i. Then Z0=CTX0=∑iλiCTXi≥∑iλiCTXp=CTXp.Z_0=C^TX_0=\sum_i\lambda_iC^TX_i\ \ge\ \sum_i\lambda_iC^TX_p=C^TX_p . But Z0Z_0 is the minimum over SS, so CTXp≥Z0C^TX_p\ge Z_0. Hence CTXp=Z0C^TX_p=Z_0: the minimum is attained at the extreme point XpX_p. ∎

(If SS is unbounded with a finite minimum, write X0=∑λiXi+∑μjDjX_0=\sum\lambda_iX_i+\sum\mu_jD_j with directions DjD_j; finiteness forces CTDj≥0C^TD_j\ge0, and the same inequality gives the result.)

Part 2. If the minimum is attained at more than one point, it is attained at infinitely many points. Suppose CTXa=CTXb=Z0C^TX_a=C^TX_b=Z_0 for two distinct points Xa,Xb∈SX_a,X_b\in S (for instance two extreme points). For every λ∈[0,1]\lambda\in[0,1], the point Xλ=λXa+(1−λ)XbX_\lambda=\lambda X_a+(1-\lambda)X_b lies in SS (convexity), and CTXλ=λCTXa+(1−λ)CTXb=λZ0+(1−λ)Z0=Z0.C^TX_\lambda=\lambda C^TX_a+(1-\lambda)C^TX_b=\lambda Z_0+(1-\lambda)Z_0=Z_0 . So every XλX_\lambda is a minimising point. Since Xa≠XbX_a\ne X_b, the points XλX_\lambda are all different for different λ\lambda, and there are infinitely many of them (the whole segment XaXbX_aX_b). ∎

More generally, if X1,…,XrX_1,\dots,X_r are minimising extreme points, every convex combination ∑μiXi\sum\mu_iX_i is also minimising. Geometrically, the iso-cost hyperplane CTX=Z0C^TX=Z_0 then contains a whole edge or face of the feasible region, and the problem has alternative optimal solutions.

✓ Proof checked step by step Every step was checked: the minimum of a linear function over a bounded convex polyhedron is attained at an extreme point, and if it is attained at two distinct points it is attained at every point of the segment joining them (infinitely many points).

↑ Back to the question list

Obtain a necessary and sufficient condition for a basic feasible solution to a LPP to be optimal.

1997 · Paper II · Q10b · 20 marks

Solution

(This is the same question as Q48 (2001, 3a) above. The worked solution is repeated here so that each question is complete.)

Setting. Maximise Z=CTXZ=C^TX subject to AX=bAX=b, X≥0X\ge0, where AA is m×nm\times n of rank mm. Let BB be a basis with basic feasible solution XB=B−1b≥0X_B=B^{-1}b\ge0 and value ZB=CBTXBZ_B=C_B^TX_B. For each column aja_j of AA write yj=B−1aj,zj=CBTyj.y_j=B^{-1}a_j,\qquad z_j=C_B^Ty_j .

Theorem. The basic feasible solution XBX_B is optimal if zj−cj≥0z_j-c_j\ge0 for every jj. Conversely, if XBX_B is non-degenerate and optimal, then zj−cj≥0z_j-c_j\ge0 for every jj.

Key identity. Let XX be any feasible solution, with basic part X(B)X^{(B)} and non-basic part xjx_j (j∈Nj\in N). From AX=bAX=b: BX(B)+∑j∈Najxj=b⇒X(B)=B−1b−∑j∈Nyjxj=XB−∑j∈Nyjxj.BX^{(B)}+\sum_{j\in N}a_jx_j=b\ \Longrightarrow\ X^{(B)}=B^{-1}b-\sum_{j\in N}y_jx_j=X_B-\sum_{j\in N}y_jx_j . Hence Z(X)=CBTX(B)+∑j∈Ncjxj=CBTXB−∑j∈N(CBTyj−cj)xj=ZB−∑j∈N(zj−cj)xj.Z(X)=C_B^TX^{(B)}+\sum_{j\in N}c_jx_j=C_B^TX_B-\sum_{j\in N}(C_B^Ty_j-c_j)x_j=Z_B-\sum_{j\in N}(z_j-c_j)x_j . (For basic jj, yjy_j is a unit vector and zj−cj=0z_j-c_j=0.)

Sufficiency. If all zj−cj≥0z_j-c_j\ge0, then since every xj≥0x_j\ge0, Z(X)=ZB−∑j∈N(zj−cj)xj≤ZBZ(X)=Z_B-\sum_{j\in N}(z_j-c_j)x_j\le Z_B for every feasible XX. So XBX_B is optimal.

Necessity. Suppose XBX_B is non-degenerate (XB>0X_B>0) and zk−ck<0z_k-c_k<0 for some non-basic kk. Give xkx_k a small value θ>0\theta>0 and keep the other non-basic variables at zero. Then X(B)=XB−θyk≥0for 0<θ≤minyik>0xBiyik(or any θ if yk≤0),X^{(B)}=X_B-\theta y_k\ge0\quad\text{for }0<\theta\le\min_{y_{ik}>0}\frac{x_{Bi}}{y_{ik}}\ (\text{or any }\theta\text{ if }y_k\le0), which is possible because XB>0X_B>0. This XX is feasible and Z(X)=ZB−θ(zk−ck)>ZB,Z(X)=Z_B-\theta(z_k-c_k)>Z_B , so XBX_B is not optimal. Hence at an optimal non-degenerate BFS all zj−cj≥0z_j-c_j\ge0. ∎

Remarks. (1) For minimisation the condition is zj−cj≤0z_j-c_j\le0. (2) For a degenerate BFS the condition is sufficient but not necessary: the step θ\theta may be forced to 0. (3) If zk−ck<0z_k-c_k<0 and yk≤0y_k\le0, then θ\theta can be made arbitrarily large and ZZ is unbounded.

✓ Proof checked step by step Every step was checked: Z = Z_B − Σ (z_j − c_j) x_j over non-basic j for any feasible solution, giving sufficiency; necessity follows by raising one x_k with z_k − c_k < 0 at a non-degenerate BFS.

↑ Back to the question list

Discuss the economic interpretation of the primal and the dual problems with suitable examples.

1997 · Paper II · Q10c · 20 marks

Solution

Primal: the allocation problem. A firm makes nn products using mm resources. Let xjx_j = output of product jj, cjc_j its unit profit, aija_{ij} the amount of resource ii used per unit of product jj, and bib_i the amount of resource ii available. The primal Max Z=∑jcjxjs.t.∑jaijxj≤bi,xj≥0\text{Max }Z=\sum_jc_jx_j\quad\text{s.t.}\quad\sum_ja_{ij}x_j\le b_i,\quad x_j\ge0 asks: how much of each product should be made to maximise profit with the given resources?

Dual: the valuation problem. Let yiy_i be the value (price) to be imputed to one unit of resource ii. The dual Min W=∑ibiyis.t.∑iaijyi≥cj,yi≥0\text{Min }W=\sum_ib_iy_i\quad\text{s.t.}\quad\sum_ia_{ij}y_i\ge c_j,\quad y_i\ge0 asks: what is the least total value that can be put on the firm’s resources such that, for every product, the value of the resources used to make one unit is at least the profit it earns? It can be pictured as an outside buyer who wants to buy all the firm’s resources as cheaply as possible, but must offer prices at which the firm would not rather use them itself.

Interpretation of the results.

  • Shadow prices. The optimal yi*y_i^* is the marginal worth of resource ii: the increase in maximum profit if one more unit of it were available. It tells management the highest price worth paying for extra units of that resource.
  • Equality of optimal values. maxZ=minW\max Z=\min W: the total profit of the best plan equals the total imputed value of the resources; profit is fully “explained” by the resources.
  • Complementary slackness.
    • If a resource is not fully used (∑jaijxj*<bi\sum_ja_{ij}x_j^*<b_i), it is a free good: yi*=0y_i^*=0.
    • If yi*>0y_i^*>0, the resource is scarce and fully used.
    • If a product is made (xj*>0x_j^*>0), the imputed cost of its resources equals its profit: ∑iaijyi*=cj\sum_ia_{ij}y_i^*=c_j.
    • If the imputed cost exceeds its profit (∑iaijyi*>cj\sum_ia_{ij}y_i^*>c_j), the product is not made: it does not earn enough to pay for the resources it uses. The difference is the “opportunity cost” shown as zj−cjz_j-c_j in the simplex table.

Example. A firm makes two products with profits ₹3 and ₹5 per unit. Product 1 uses 3 hours of machine I, product 2 uses 2 hours; 18 hours are available. Product 1 also needs 1 hour of machine II (4 hours available), and product 2 needs 1 hour of machine III (6 hours available).

Primal: Max Z=3x1+5x2Z=3x_1+5x_2 s.t. 3x1+2x2≤183x_1+2x_2\le18, x1≤4x_1\le4, x2≤6x_2\le6. Optimum: x1=2x_1=2, x2=6x_2=6, Z=₹36Z=₹36.

Dual: Min W=18y1+4y2+6y3W=18y_1+4y_2+6y_3 s.t. 3y1+y2≥33y_1+y_2\ge3, 2y1+y3≥52y_1+y_3\ge5. Optimum: y1=1y_1=1, y2=0y_2=0, y3=3y_3=3, W=₹36W=₹36.

Meaning.

  • One more hour of machine I would raise profit by ₹1; one more hour of machine III by ₹3.
  • Machine II has 2 hours idle, so its shadow price is 0: extra hours of it are worthless.
  • Both products are made, and for each the imputed value of the inputs equals the profit: 3(1)+1(0)=33(1)+1(0)=3 and 2(1)+1(3)=52(1)+1(3)=5.

A similar reading applies to a minimisation primal (e.g. a diet problem): the dual gives the prices of the nutrients that a supplier of pure nutrient pills could charge, and its optimal value equals the minimum cost of the diet.

✓ Answer checked step by step Every point was checked against the standard economic interpretation of duality (resource valuation, shadow prices, complementary slackness), and the example was solved in Python: primal 36, dual y = (1, 0, 3) with value 36.

↑ Back to the question list

Define (i) basic feasible solution, (ii) slack and surplus variables and (iii) artificial variables in the context of a linear programming problem (LPP).

1996 · Paper II · Q10a · 20 marks

Solution

Consider the LPP: optimise Z=CTXZ=C^TX subject to AX(≤,=,≥)bAX\ (\le,=,\ge)\ b, X≥0X\ge0, with b≥0b\ge0.

(i) Basic feasible solution. Write the constraints in standard form AX=bAX=b, with mm equations in nn variables (n>mn>m, rank mm). A basic solution is obtained by setting n−mn-m variables (non-basic) to zero and solving for the remaining mm (basic) variables, whose columns must be linearly independent. A basic solution in which all basic variables are non-negative is a basic feasible solution (BFS). It is non-degenerate if all basic variables are positive and degenerate otherwise. BFSs correspond to the corner points of the feasible region; the simplex method moves from one BFS to another.

Example. x1+x2+s1=4x_1+x_2+s_1=4, 2x1+x2+s2=62x_1+x_2+s_2=6: setting x1=x2=0x_1=x_2=0 gives the BFS s1=4s_1=4, s2=6s_2=6; setting s1=s2=0s_1=s_2=0 gives the BFS x1=2x_1=2, x2=2x_2=2.

(ii) Slack and surplus variables.

  • A slack variable is added to a “≤\le” constraint to make it an equation: ∑jaijxj+si=bi\sum_ja_{ij}x_j+s_i=b_i, si≥0s_i\ge0. It represents the unused amount of the resource.
  • A surplus variable is subtracted from a “≥\ge” constraint: ∑jaijxj−si=bi\sum_ja_{ij}x_j-s_i=b_i, si≥0s_i\ge0. It represents the amount by which the requirement is exceeded.
  • Both have zero cost in the objective function. Slack variables can form the starting basis; surplus variables cannot, because of their coefficient −1-1.

(iii) Artificial variables. Non-negative fictitious variables added to “≥\ge” and “==” constraints (after any surplus variable) to provide an identity matrix and hence an initial BFS: ∑jaijxj−si+Ai=bi\sum_ja_{ij}x_j-s_i+A_i=b_i. They have no economic meaning, so they must be removed from the solution: in the Big-M method they get a cost −M-M (maximisation) or +M+M (minimisation), with MM very large; in the two-phase method their sum is minimised first. If an artificial variable remains positive in the final solution, the problem has no feasible solution.

✓ Answer checked step by step Every definition was checked against the standard definitions used in the simplex method.

↑ Back to the question list

Show that if an optimal solution exists for a LPP then it corresponds to an extreme point of the feasible region.

1996 · Paper II · Q10b · 20 marks

Solution

(This is the same question as Q17 (2018, 1a) above. The worked solution is repeated here so that each question is complete.)

Setting. Consider: Maximise Z=CTXZ=C^TX subject to X∈S={X:AX=b,X≥0}X\in S=\{X:AX=b,\ X\ge0\}. SS is convex, and we take it to be bounded (a convex polyhedron) with extreme points X1,X2,…,XkX_1,X_2,\dots,X_k (kk finite, since there are at most (nm)\binom nm basic feasible solutions). Suppose the problem has an optimal solution X0X_0, with Z*=CTX0Z^*=C^TX_0.

To prove: some extreme point XrX_r satisfies CTXr=Z*C^TX_r=Z^*.

Proof.

  1. A bounded convex polyhedron is the convex hull of its extreme points. So X0X_0 can be written X0=∑i=1kλiXi,λi≥0,∑i=1kλi=1.X_0=\sum_{i=1}^k\lambda_iX_i,\qquad \lambda_i\ge0,\quad \sum_{i=1}^k\lambda_i=1 .
  2. Let XrX_r be the extreme point with the largest objective value: CTXr=max1≤i≤kCTXi.C^TX_r=\max_{1\le i\le k}C^TX_i .
  3. By linearity, Z*=CTX0=∑i=1kλiCTXi≤∑i=1kλiCTXr=CTXr.Z^*=C^TX_0=\sum_{i=1}^k\lambda_iC^TX_i\le\sum_{i=1}^k\lambda_iC^TX_r=C^TX_r .
  4. But XrX_r is feasible and X0X_0 is optimal, so CTXr≤Z*C^TX_r\le Z^*.
  5. Hence CTXr=Z*C^TX_r=Z^*: the extreme point XrX_r is an optimal solution. ∎

If SS is unbounded. Every X∈SX\in S can be written as ∑λiXi+∑μjDj\sum\lambda_iX_i+\sum\mu_jD_j, where the DjD_j are extreme directions (ADj=0AD_j=0, Dj≥0D_j\ge0) and μj≥0\mu_j\ge0. If the optimum is finite, CTDj≤0C^TD_j\le0 for every jj (otherwise ZZ would be unbounded), so CTX0≤∑λiCTXi≤CTXrC^TX_0\le\sum\lambda_iC^TX_i\le C^TX_r, and the same argument applies.

Remarks.

  • The same proof (with “min”) works for minimisation.
  • If the maximum is attained at several extreme points, it is also attained at every convex combination of them (alternative optima).
  • This theorem is the basis of the simplex method: we need only search among the finitely many basic feasible solutions.

✓ Proof checked step by step Every step was checked: the feasible set is a convex polytope; every feasible point is a convex combination of extreme points (plus, if unbounded, directions that cannot improve a finite optimum); linearity then gives an extreme point at least as good.

↑ Back to the question list

Describe the simplex algorithm for solving a LPP. How is this procedure modified when some of the variables are unrestricted?

1996 · Paper II · Q10c · 20 marks

Solution

The simplex algorithm (for maximisation; a minimisation problem is handled by maximising −Z-Z).

  1. Standard form. Make all right-hand sides non-negative. Convert inequalities into equations: add slack variables to ≤\le constraints, subtract surplus variables and add artificial variables to ≥\ge constraints, add artificial variables to == constraints.
  2. Initial BFS. Take the slack and artificial variables as the basic variables (XB=bX_B=b) and set up the initial simplex table. Artificial variables are handled by the Big-M or two-phase method.
  3. Optimality test. Compute zj−cj=CBTaj−cjz_j-c_j=C_B^Ta_j-c_j for all non-basic variables. If all zj−cj≥0z_j-c_j\ge0, the current BFS is optimal: stop.
  4. Entering variable. Choose xkx_k with the most negative zk−ckz_k-c_k.
  5. Unboundedness test. If all entries in column kk are ≤0\le0, the solution is unbounded: stop.
  6. Leaving variable. Compute the ratios xBi/aikx_{Bi}/a_{ik} for aik>0a_{ik}>0; the row rr with the smallest ratio gives the leaving variable, and arka_{rk} is the pivot.
  7. Pivoting. Divide the pivot row by arka_{rk}; subtract suitable multiples of it from the other rows to make all other entries in column kk zero. Update cBc_B and the basis.
  8. Go to step 3.

At each step ZZ does not decrease, and in the non-degenerate case it strictly increases, so the algorithm ends after a finite number of iterations.

Modification when some variables are unrestricted in sign. The simplex method requires all variables to be non-negative, so an unrestricted variable xjx_j must be replaced first.

Method 1 (difference of two non-negative variables). Write xj=xj′−xj″,xj′≥0,xj″≥0.x_j=x_j'-x_j'',\qquad x_j'\ge0,\ x_j''\ge0 . Substitute in the objective and all constraints. The column of xj″x_j'' is the negative of the column of xj′x_j', so the two can never be basic together (their columns are dependent). In the final solution at most one of them is positive: xj=xj′x_j=x_j' if xj′>0x_j'>0, or xj=−xj″x_j=-x_j'' if xj″>0x_j''>0.

Method 2 (elimination). If xjx_j appears in an equation ∑kaikxk=bi\sum_ka_{ik}x_k=b_i with aij≠0a_{ij}\ne0, solve for xjx_j in terms of the other variables, substitute it in the objective and the other constraints, and drop that equation. After solving, recover xjx_j from the eliminated equation.

Method 3 (one extra variable). If several variables are unrestricted, write xj=xj′−ux_j=x_j'-u for each, with a single common u≥0u\ge0.

Then apply the ordinary simplex algorithm to the transformed problem.

Example. Maximise 8x1−4x28x_1-4x_2 subject to 4x1+5x2≤204x_1+5x_2\le20, x1−3x2≤23x_1-3x_2\le23, x1≥0x_1\ge0, x2x_2 unrestricted. With x2=x2′−x2″x_2=x_2'-x_2'' the simplex method gives x1=17517x_1=\tfrac{175}{17}, x2″=7217x_2''=\tfrac{72}{17}, so x2=−7217x_2=-\tfrac{72}{17} and Zmax=168817Z_{\max}=\tfrac{1688}{17}.

✓ Answer checked step by step Every step was checked against the standard simplex algorithm and the substitution x_j = x_j′ − x_j″ (or elimination) for unrestricted variables.

↑ Back to the question list

Explain the general formulation of a linear programming problem (LPP). Describe an example.

1995 · Paper II · Q11a · 20 marks

Solution

General formulation. Every LPP has four components.

  1. Decision variables x1,…,xnx_1,\dots,x_n: the levels of the activities to be decided (quantities to produce, buy, ship …).
  2. Objective function: a linear function to be maximised (profit, output) or minimised (cost, time): Z=c1x1+c2x2+…+cnxn.Z=c_1x_1+c_2x_2+\dots+c_nx_n .
  3. Constraints: linear restrictions arising from limited resources, demands, policies: ∑j=1naijxj(≤,=,≥)bi,i=1,…,m.\sum_{j=1}^na_{ij}x_j\ (\le,=,\ge)\ b_i,\qquad i=1,\dots,m .
  4. Non-negativity: xj≥0x_j\ge0.

In matrix form: optimise Z=CTXZ=C^TX subject to AX(≤,=,≥)bAX\ (\le,=,\ge)\ b, X≥0X\ge0. The model assumes proportionality, additivity, divisibility, certainty and finiteness.

Steps in formulating. (a) Understand the problem and identify the decision variables; (b) express the objective in terms of them; (c) write each restriction as a linear inequality or equation; (d) add the non-negativity conditions.

Example (product mix). A firm makes chairs (AA) and tables (BB).

  • Each chair needs 2 hours of machining and 1 hour of assembly; each table needs 1 hour of machining and 1 hour of assembly.
  • 100 machining hours and 80 assembly hours are available per week.
  • The profits are ₹40 per chair and ₹30 per table.

Let x1x_1 = chairs and x2x_2 = tables made per week. Maximise Z=40x1+30x2\text{Maximise }Z=40x_1+30x_2 subject to2x1+x2≤100(machining),x1+x2≤80(assembly),x1,x2≥0.\text{subject to}\quad 2x_1+x_2\le100\ (\text{machining}),\qquad x_1+x_2\le80\ (\text{assembly}),\qquad x_1,x_2\ge0 .

Solution (graphical). The corners are (0,0)(0,0), (50,0)(50,0), (20,60)(20,60) and (0,80)(0,80), with Z=0Z=0, 2000, 2600 and 2400. So the firm should make 20 chairs and 60 tables a week for a profit of ₹2,600; both machining and assembly time are fully used.

✓ Checked by computer Every step of the example was checked; we solved it in Python (scipy linprog): x₁ = 20, x₂ = 60, Z = 2600.

↑ Back to the question list

Define a basic feasible solutions (bfs) and an optimal solution to a LPP. Show that a bfs is an extreme point of the set of feasible solutions and conversely.

1995 · Paper II · Q11b · 20 marks

Solution

Definitions. For the LPP with feasible set S={X:AX=b,X≥0}S=\{X:AX=b,\ X\ge0\} (AA of order m×nm\times n, rank mm):

  • A basic feasible solution (bfs) is a feasible XX whose positive components correspond to linearly independent columns of AA (equivalently, XX is obtained by setting n−mn-m variables to zero and solving for mm variables with independent columns, all of them ≥0\ge0).
  • An optimal solution is a feasible solution giving the best value of the objective function over SS.
  • X∈SX\in S is an extreme point if X=λX1+(1−λ)X2X=\lambda X_1+(1-\lambda)X_2 with X1,X2∈SX_1,X_2\in S, 0<λ<10<\lambda<1 implies X1=X2=XX_1=X_2=X.

Theorem. XX is a basic feasible solution if and only if it is an extreme point of SS.

(a) Every bfs is an extreme point. Let XX be a bfs with basic variables x1,…,xmx_1,\dots,x_m (columns a1,…,ama_1,\dots,a_m independent) and xm+1=…=xn=0x_{m+1}=\dots=x_n=0. Suppose X=λU+(1−λ)V,U,V∈S,0<λ<1.X=\lambda U+(1-\lambda)V,\qquad U,V\in S,\ 0<\lambda<1 .

  • For j>mj>m: 0=λuj+(1−λ)vj0=\lambda u_j+(1-\lambda)v_j with uj,vj≥0u_j,v_j\ge0 and λ,1−λ>0\lambda,1-\lambda>0, so uj=vj=0u_j=v_j=0.
  • Then AU=bAU=b and AV=bAV=b reduce to ∑j=1mujaj=b\sum_{j=1}^mu_ja_j=b and ∑j=1mvjaj=b\sum_{j=1}^mv_ja_j=b. Subtracting, ∑j=1m(uj−vj)aj=0\sum_{j=1}^m(u_j-v_j)a_j=0, and since a1,…,ama_1,\dots,a_m are independent, uj=vju_j=v_j for all jj.
  • So U=VU=V, and therefore U=V=XU=V=X.

Hence XX cannot be written as a proper convex combination of two different feasible points: it is an extreme point.

(b) Every extreme point is a bfs. Let XX be an extreme point with positive components x1,…,xkx_1,\dots,x_k and the rest zero, so ∑j=1kxjaj=b\sum_{j=1}^kx_ja_j=b. Suppose, for contradiction, that a1,…,aka_1,\dots,a_k are linearly dependent: ∑j=1kδjaj=0\sum_{j=1}^k\delta_ja_j=0 with δ=(δ1,…,δk,0,…,0)≠0\delta=(\delta_1,\dots,\delta_k,0,\dots,0)\ne0.

  • Since every xj>0x_j>0 for j≤kj\le k, choose ε>0\varepsilon>0 so small that xj±εδj>0x_j\pm\varepsilon\delta_j>0 for all j≤kj\le k.
  • Put U=X+εδU=X+\varepsilon\delta and V=X−εδV=X-\varepsilon\delta. Then U,V≥0U,V\ge0, AU=AV=bAU=AV=b, so U,V∈SU,V\in S, and U≠VU\ne V.
  • But X=12U+12VX=\tfrac12U+\tfrac12V, contradicting that XX is an extreme point.

So a1,…,aka_1,\dots,a_k are independent; necessarily k≤mk\le m, and (adding m−km-k further columns of AA to form a basis if k<mk<m) XX is a basic feasible solution, possibly degenerate. ∎

Consequence. The set of extreme points is finite (at most (nm)\binom nm), and since an optimal solution, if it exists, occurs at an extreme point, the simplex method only needs to search among basic feasible solutions.

✓ Proof checked step by step Every step was checked in both directions: a BFS cannot be a proper convex combination of two feasible points (the zero components and independence of the basic columns force equality), and the positive columns of an extreme point are linearly independent.

↑ Back to the question list

A firm manufactures two items A and B. It purchases castings which are then machined, bored and polished. Castings for items A and B cost Rs. 3 and Rs. 4 each and are sold at Rs. 6 and Rs. 7 each, respectively. Running costs of the processing machines are Rs. 20, Rs. 14 and Rs. 17.50 per hour respectively and their hourly capacities are as follows.

Item A Item B
Machining 25 40
Boring 28 35
Polishing 35 25

Formulate this problem as a LPP.

1995 · Paper II · Q11c · 20 marks

Solution

Decision variables. Let x1x_1 and x2x_2 be the numbers of items AA and BB processed per hour.

Profit per item. Selling price − cost of casting − machine running cost per item. A machine that processes 25 items an hour at ₹20 an hour costs 20/2520/25 per item, and so on.

Item A Item B
Selling price − casting 6 − 3 = 3.00 7 − 4 = 3.00
Machining 20/25 = 0.80 20/40 = 0.50
Boring 14/28 = 0.50 14/35 = 0.40
Polishing 17.50/35 = 0.50 17.50/25 = 0.70
Profit per item (₹) 1.20 1.40

Objective. Maximise Z=1.2x1+1.4x2(₹ per hour).\text{Maximise }Z=1.2x_1+1.4x_2\quad(\text{₹ per hour}).

Capacity constraints. Item AA needs 1/251/25 hour of machining, item BB 1/401/40 hour; each machine has 1 hour per hour: x125+x240≤1⇔40x1+25x2≤1000(machining)\frac{x_1}{25}+\frac{x_2}{40}\le1\quad\Longleftrightarrow\quad 40x_1+25x_2\le1000\quad(\text{machining}) x128+x235≤1⇔35x1+28x2≤980(boring)\frac{x_1}{28}+\frac{x_2}{35}\le1\quad\Longleftrightarrow\quad 35x_1+28x_2\le980\quad(\text{boring}) x135+x225≤1⇔25x1+35x2≤875(polishing)\frac{x_1}{35}+\frac{x_2}{25}\le1\quad\Longleftrightarrow\quad 25x_1+35x_2\le875\quad(\text{polishing}) x1,x2≥0.x_1,x_2\ge0 .

This is the required LPP. (Solving it gives x1≈16.9x_1\approx16.9 and x2≈12.9x_2\approx12.9 items per hour, with machining and polishing fully used and a profit of about ₹38.39 per hour.)

✓ Checked by computer Every coefficient was recomputed: profit per unit (6 − 3 − 20/25 − 14/28 − 17.5/35 = 1.20 for A; 7 − 4 − 20/40 − 14/35 − 17.5/25 = 1.40 for B) and the hourly capacity constraints; we also solved the model in Python (scipy linprog).

↑ Back to the question list

Explain Charne’s M-technique for solving a LPP.

1995 · Paper II · Q12a · 20 marks

Solution

Purpose. When some constraints are of the ≥\ge or == type, the standard form has no ready identity basis, so the simplex method cannot start. Charnes’ M-technique (the Big-M or penalty method) adds artificial variables to supply the identity basis and attaches a very large penalty MM to them in the objective, so that the simplex method itself drives them out.

Steps.

  1. Standard form. Express the problem in standard form with bi≥0b_i\ge0: slack variables for ≤\le constraints, surplus variables for ≥\ge constraints.
  2. Add artificial variables Ai≥0A_i\ge0 to each ≥\ge and == constraint.
  3. Modify the objective. Give each artificial variable the coefficient −M-M in a maximisation (or +M+M in a minimisation), where MM is a positive number larger than any number it will be compared with: Max Z=∑jcjxj+0⋅∑si−M∑Ai.\text{Max }Z=\sum_jc_jx_j+0\cdot\sum s_i-M\sum A_i .
  4. Initial table. Basis: slack and artificial variables. The zj−cjz_j-c_j are of the form αjM+βj\alpha_j M+\beta_j.
  5. Iterate by the simplex rules. Compare zj−cjz_j-c_j by the coefficient of MM first and then by the constant term. Enter the variable with the most negative zj−cjz_j-c_j (maximisation); leave by the minimum ratio rule. Once an artificial variable leaves the basis it can be dropped from further tables.
  6. Conclusions.
    • All zj−cj≥0z_j-c_j\ge0 and no artificial variable in the basis at a positive level → optimal solution of the original problem.
    • All zj−cj≥0z_j-c_j\ge0 but some artificial variable positive → the original problem has no feasible solution.
    • An artificial variable in the basis at zero level → the solution is optimal but degenerate (and a constraint may be redundant).
    • An entering column with no positive entry → unbounded solution.

Illustration. Minimise Z=5x1+3x2Z=5x_1+3x_2 subject to 2x1+4x2≤122x_1+4x_2\le12, 2x1+2x2=102x_1+2x_2=10, 5x1+2x2≥105x_1+2x_2\ge10. We maximise −Z=−5x1−3x2−MA1−MA2-Z=-5x_1-3x_2-MA_1-MA_2 with 2x1+4x2+s1=122x_1+4x_2+s_1=12, 2x1+2x2+A1=102x_1+2x_2+A_1=10, 5x1+2x2−s2+A2=105x_1+2x_2-s_2+A_2=10. The initial zj−cjz_j-c_j are −7M+5-7M+5 for x1x_1 and −4M+3-4M+3 for x2x_2, so x1x_1 enters; after three iterations the artificial variables have left and the optimum is x1=4x_1=4, x2=1x_2=1, minZ=23\min Z=23.

Drawbacks. The value of MM is arbitrary, and on a computer a very large MM causes rounding errors; the two-phase method avoids this.

✓ Answer checked step by step Every step was checked against Charnes’ Big-M (penalty) method, including the comparison of M-terms and the infeasibility and unboundedness verdicts; the illustration was solved exactly (min Z = 23 at (4, 1)).

↑ Back to the question list

Define degeneracy in a LPP. When is this encountered and how is this problem overcome?

1995 · Paper II · Q12b · 20 marks

Solution

Definition. A basic feasible solution is degenerate if one or more of the basic variables take the value zero. An LPP is degenerate if it has at least one degenerate basic feasible solution. Geometrically, more than nn of the bounding hyperplanes pass through the corresponding corner of the feasible region in nn dimensions, so the same corner is represented by more than one basis.

When it is encountered.

  1. At the start: when some right-hand side bi=0b_i=0 (the initial basic variable of that row is zero).
  2. During the iterations: when there is a tie in the minimum ratio test, i.e. two or more rows give the same smallest ratio xBi/aikx_{Bi}/a_{ik}. Only one of them leaves; the others remain basic with value zero in the next table.
  3. In the transportation problem, when the number of occupied cells is less than m+n−1m+n-1.

Why it is a problem.

  • When a basic variable is zero, the next ratio may be θ=0\theta=0, so the pivot changes the basis without changing the solution or the value of ZZ.
  • The simplex method may then go round a sequence of bases with the same ZZ and return to an earlier basis: this is cycling, and the method would never stop. Cycling is rare in practice, but examples exist (Beale, 1955).
  • Degeneracy can also make the optimality test necessary-but-not-sufficient in reverse (a degenerate optimal BFS may show some zj−cj<0z_j-c_j<0) and leads to non-unique dual (shadow) prices.

How it is overcome.

  1. Perturbation method (Charnes). Replace bb by b(ε)=b+(ε,ε2,…,εm)Tb(\varepsilon)=b+(\varepsilon,\varepsilon^2,\dots,\varepsilon^m)^T for a very small ε>0\varepsilon>0. Then no ties can occur; in practice one breaks a tie by comparing the ratios formed from the columns of the unit (slack) vectors, taken in order.
  2. Lexicographic rule. Among the tied rows, divide each element of those rows (starting with the first column of the identity, then the next, …) by the pivot-column entry and choose the row with the smallest ratio at the first column where they differ. This always gives a unique leaving variable and prevents cycling.
  3. Bland’s smallest-index rule. Choose as entering variable the eligible variable with the smallest index (any zj−cj<0z_j-c_j<0), and as leaving variable, among tied rows, the one whose basic variable has the smallest index. This guarantees termination.
  4. Simple practical rule. In hand computation, break ties arbitrarily (or in favour of an artificial variable, or the row with the smallest subscript); since cycling is very rare, the method usually still terminates.

Example. Max Z=3x1+9x2Z=3x_1+9x_2 subject to x1+4x2≤8x_1+4x_2\le8, x1+2x2≤4x_1+2x_2\le4. In the first iteration x2x_2 enters and the ratios 8/48/4 and 4/24/2 tie; the next table has a basic variable equal to 0, i.e. a degenerate solution. The method still reaches the optimum x1=0x_1=0, x2=2x_2=2, Z=18Z=18.

✓ Answer checked step by step Every point was checked against the standard theory of degeneracy: a basic variable at zero, its cause (ties in the minimum ratio or a zero right-hand side), cycling (Beale’s example), and the perturbation, lexicographic and Bland’s rules.

↑ Back to the question list

Write a note on the duality principle in a LPP.

1995 · Paper II · Q12c · 20 marks

Solution

Duality principle. Every linear programming problem has a companion problem, called its dual, formed from the same data; the original is called the primal. The two are so related that the solution of one gives the solution of the other.

Formation. For the primal in canonical form Max Z=CTX,AX≤b,X≥0,\text{Max }Z=C^TX,\quad AX\le b,\quad X\ge0, the dual is Min W=bTY,ATY≥C,Y≥0.\text{Min }W=b^TY,\quad A^TY\ge C,\quad Y\ge0 .

  • The number of dual variables equals the number of primal constraints, and vice versa.
  • The right-hand sides of one are the objective coefficients of the other.
  • The coefficient matrix is transposed.
  • Max becomes min and ≤\le becomes ≥\ge.
  • An equality constraint corresponds to an unrestricted variable, and an unrestricted variable to an equality constraint.

Main results.

  1. Symmetry: the dual of the dual is the primal.
  2. Weak duality: CTX≤bTYC^TX\le b^TY for any feasible XX, YY; so feasible solutions of each problem bound the other.
  3. Strong (fundamental) duality theorem: if either problem has a finite optimum, so does the other, and maxZ=minW\max Z=\min W.
  4. Existence: if one problem is unbounded, the other is infeasible.
  5. Complementary slackness: at optimality, yi*⋅(slack in primal constraint i)=0y_i^*\cdot(\text{slack in primal constraint } i)=0 and xj*⋅(surplus in dual constraint j)=0x_j^*\cdot(\text{surplus in dual constraint } j)=0.
  6. Reading the dual solution: the optimal dual variables are Y*T=CBTB−1Y^{*T}=C_B^TB^{-1}, i.e. the zj−cjz_j-c_j of the slack columns in the final primal simplex table.

Economic meaning. If the primal maximises profit from limited resources, the dual variables are the shadow prices (imputed values) of the resources; the dual minimises the total value of the resources subject to each product’s resources being valued at least at its profit. At the optimum total profit equals the total imputed value of the resources.

Uses.

  • Computation: solve whichever problem is smaller or easier (e.g. a primal with many constraints and few variables is easier through its dual, which needs no artificial variables if the primal is a minimisation with ≥\ge constraints).
  • The dual simplex method and sensitivity analysis rest on duality.
  • It gives a check of optimality (equal objective values) and economic insight into the value of resources.
  • It underlies game theory (the two players’ problems are dual LPs) and many algorithms (primal–dual methods).

Example. Primal: Max Z=2x1+5x2Z=2x_1+5x_2 s.t. x1+4x2≤24x_1+4x_2\le24, 3x1+x2≤213x_1+x_2\le21, x1+x2≤9x_1+x_2\le9. Dual: Min W=24y1+21y2+9y3W=24y_1+21y_2+9y_3 s.t. y1+3y2+y3≥2y_1+3y_2+y_3\ge2, 4y1+y2+y3≥54y_1+y_2+y_3\ge5. Both have optimal value 33, with x=(4,5)x=(4,5) and y=(1,0,1)y=(1,0,1).

✓ Answer checked step by step Every point was checked against the standard duality theory: formation rules, symmetry, weak and strong duality, complementary slackness, shadow prices and uses.

↑ Back to the question list

More on Optimization Techniques

Questions: UPSC Civil Services (Main) Examination, Statistics Paper II, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted