Operations Research

Online MA · Sem 4

Lesson 2 of 5Economics

Simplex Method and Duality

Operations Research

About the video

LPP using||SIMPLEX METHOD||simple Steps with solved problem||in Operations Research||by kauserwise

Kauser Wise

Study notes

The simplex method solves a linear programming problem by moving through a sequence of tables, improving the objective each iteration until the optimality condition on Cj - Zj holds. Worked example: maximize Z = 12x1 + 16x2 subject to 10x1 + 20x2 <= 120 and 8x1 + 8x2 <= 80, which gives x1 = 8, x2 = 2 and Z = 128. Duality pairs every LP (primal) with a related LP (dual) that has the same optimal value.

Setting up the initial simplex table

  • Convert each <= constraint into an equation by adding one slack variable: 10x1 + 20x2 + S1 = 120 and 8x1 + 8x2 + S2 = 80.
  • Slack variables get a cost of 0 in the objective: Z = 12x1 + 16x2 + 0S1 + 0S2, with all variables >= 0.
  • Table columns are CB (cost of the basic variable), the basic variables, the coefficients of x1, x2, S1, S2, the solution, and the ratio.
  • The Cj row holds the objective coefficients: 12, 16, 0, 0.
  • The initial basic variables are the slack variables S1 and S2, starting with solutions 120 and 80.

Iteration steps

  • Zj for each column = sum of (CB x column entry). In the initial table every Zj is 0 because all CB values are 0.
  • Compute Cj - Zj for each column.
  • Optimality for maximization: all Cj - Zj <= 0. For minimization: all Cj - Zj >= 0.
  • Key column: the column with the largest positive Cj - Zj. This variable enters the basis.
  • Ratio = solution / key column entry. The key row is the row with the smallest ratio; its variable leaves the basis.
  • Key element: the entry where the key row and key column intersect.
  • New key row = old key row / key element.
  • Other rows: new value = old value - (corresponding key column value x corresponding key row value) / key element.

Worked example trace

  • Initial table: Cj - Zj = 12, 16, 0, 0. x2 enters. Ratios are 120/20 = 6 and 80/8 = 10, so S1 leaves and the key element is 20.
  • Iteration 1: the x2 row becomes 1/2, 1, 1/20, 0 | 6. The S2 row becomes 4, 0, -2/5, 1 | 32. Cj - Zj = 4, 0, -4/5, 0.
  • x1 enters. Ratios are 6/(1/2) = 12 and 32/4 = 8, so S2 leaves and the key element is 4.
  • Iteration 2: the x1 row becomes 1, 0, -1/10, 1/4 | 8. The x2 row becomes 0, 1, 1/10, -1/8 | 2. Cj - Zj = 0, 0, -2/5, -1, so the table is optimal.
  • Solution: x1 = 8, x2 = 2, Z = 12(8) + 16(2) = 128.
  • Read the solution from the solution column. The x1 and x2 coefficients (12 and 16) are not the values of x1 and x2.

Duality

  • Every primal LP has a dual LP. A maximization primal with <= constraints corresponds to a minimization dual with >= constraints.
  • Each primal constraint gives one dual variable, and each primal variable gives one dual constraint.
  • The primal objective coefficients become the dual right-hand sides, and the right-hand sides become the dual objective coefficients. The coefficient matrix is transposed.
  • At the optimum, the primal and dual objective values are equal.
  • Dual for the example: minimize W = 120y1 + 80y2 subject to 10y1 + 8y2 >= 12, 20y1 + 8y2 >= 16, y1, y2 >= 0.
  • The optimal dual values (shadow prices) can be read from the final table as -(Cj - Zj) of the slack columns: y1 = 2/5, y2 = 1. Check: W = 48 + 80 = 128.

Key terms

Slack variable
A non-negative variable added to a <= constraint to turn it into an equation; its cost is 0.
Cj - Zj
The net evaluation of a column, used to test optimality and to choose the entering variable.
Key column
The column with the largest positive Cj - Zj in a maximization problem; its variable enters the basis.
Key row
The row with the minimum ratio (solution / key column entry); its variable leaves the basis.
Key element
The entry at the intersection of the key row and the key column.
Dual
A companion LP built from the primal by swapping the roles of the objective and constraints; it has the same optimal value.

Takeaways

  • A maximization problem is optimal when all Cj - Zj <= 0.
  • The entering variable has the largest positive Cj - Zj; the leaving variable has the minimum ratio.
  • Divide the key row by the key element; update other rows with old - (key column value x key row value) / key element.
  • At the optimum, the primal and dual objective values are equal.
Contribute

Was this lesson helpful?

We read every rating and fix the weakest lessons first.