Lecture 9 Duality 09-13-2009 Duality Every LP has its Dual. Primal(Ex 4.1-1) max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. Dual min w = 10y1 + 8y2 s.t. y1 + 2y2 2y1 − y2 y1 + 3y2 y1 ≥5 ≥ 12 ≥4 ≥0 Primal Optimal Solution Primal max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. (x1∗ , x2∗ , x3∗ ) = (5.2, 2.4, 0). z ∗ = 54.8. Dual Optimal Solution Dual min w = 10y1 + 8y2 s.t. y1 + 2y2 2y1 − y2 y1 + 3y2 y1 ≥5 ≥ 12 ≥4 ≥0 (y1 , y2 ) = (5.8, −0.4). w ∗ = 54.8. Duality Dual can be constructed from its primal. Primal(Ex 4.1-1) max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. Dual min w = 10y1 + 8y2 s.t. y1 + 2y2 2y1 − y2 y1 + 3y2 y1 ≥5 ≥ 12 ≥4 ≥0 Strong Duality Economic Interpretation Economic Interpretation Ex 4.3-2 TOYCO assembles three types of toys: trains, trucks, and cars using three operations. Available assembly times for the three operations are 430, 460 and 420 minutes per day, respectively, and the revenues per toy train, truck, and car are $3, $2 and $5, respectively. The assembly times per train for the three operations are 1, 3 and 1 minutes, respectively. The corresponding times per truck and per car are (2, 0, 4) and (1, 2, 0) minutes (a zero time indicates that the operations is not used). Economic Interpretation Primal max z = 3x1 + 2x2 + 5x3 s.t. x1 + 2x2 + x3 3x1 + 2x3 x1 + 4x2 x1 , x2 , x3 Optimal solution: z ∗ = $1350 x ∗ = (0, 100, 230). ≤ 430 ≤ 460 ≤ 420 ≥ 0. Economic Interpretation Dual side of the story TOYCO’s available assembly times for the three operations are 430, 460 and 420 minutes per day. You want to buy all assembly times from TOYCO, by paying prices y1 , y2 , y3 per minute, respectively. You must pay enough for the assembly times because otherwise TOYCO would choose not to sell to you, they would produce on their own and profit from it. TOYCO’s revenues per toy train, truck, and car are $3, $2 and $5, respectively. The assembly times per train for the three operations are 1, 3 and 1 minutes, respectively. The corresponding times per truck and per car are (2, 0, 4) and (1, 2, 0) minutes. Economic Interpretation Dual max w = 430y1 + 460y2 + 420y3 s.t. y1 + 3y2 + y3 2y1 + 4y3 y1 + 2y2 y1 , y2 , y3 Optimal solution: w ∗ = $1350 y ∗ = (1, 2, 0). ≥3 ≥2 ≥5 ≥ 0. Economic Interpretation Primal max z = 3x1 + 2x2 + 5x3 Dual min w = 430y1 + 460y2 + 420y3 s.t. x1 + 2x2 + x3 ≤ 430 s.t. y1 + 3y2 + y3 ≥ 3 3x1 + 2x3 ≤ 460 2y1 + 4y3 ≥ 2 x1 + 4x2 ≤ 420 y1 + 2y2 ≥ 5 x1 , x2 , x3 ≥ 0. y1 , y2 , y3 ≥ 0. z ∗ = $1350 w ∗ = $1350 x ∗ = (0, 100, 230). y ∗ = (1, 2, 0). Constructing Dual LP Constructing Dual LP I Transpose all coefficients. I Flip max/min. Primal max z = 3x1 + 2x2 + 5x3 Dual min w = 430y1 + 460y2 + 420y3 s.t. x1 + 2x2 + x3 ≤ 430 s.t. y1 + 3y2 + y3 (?) 3 3x1 + 2x3 ≤ 460 2y1 + 4y3 (?) 2 x1 + 4x2 ≤ 420 y1 + 2y2 (?) 5 x1 , x2 , x3 ≥ 0. y1 , y2 , y3 (?) 0. Constructing Dual LP Constraints max ≥ ≤ = min ≥ ≤ = ⇔ ⇔ ⇔ ⇔ ⇔ ⇔ Variables min ≤0 ≥0 Unrestricted max ≥0 ≤0 Unrestricted Constructing Dual LP TOYCO’s example: primal max z = 3x1 + 2x2 + 5x3 s.t. x1 + 2x2 + x3 3x1 + 2x3 x1 + 4x2 x1 , x2 , x3 ≤ 430 ≤ 460 ≤ 420 ≥ 0. Constructing Dual LP TOYCO’s example: dual max w = 430y1 + 460y2 + 420y3 s.t. y1 + 3y2 + y3 2y1 + 4y3 y1 + 2y2 y1 , y2 , y3 ≥3 ≥2 ≥5 ≥ 0. Quiz Maximization, all variables nonnegative. Basic z x5 x2 x6 I I I I I I x1 7 2 −3 1 x2 0 0 1 0 x3 a c d e x4 0 3 −1 2 x5 0 1 0 0 x6 0 0 0 1 Solution 210 9 b 8 (a) Assume b ≥ 0. What are the basic variables? What is the current objective value? What is the current solution? (b) Given a = 2, b = 3, is the tableau optimal? (c) Given a = 2, b = 3, find another optimal solution. (d) For what values of a, b, c, d, e is the current table optimal? (e) If a = −1, b ≥ 0, c, d, e ≤ 0, what can you conclude about the optimal value? (f) Give a possible value of (a, b, c, d, e) so that x3 would replace x2 in the basis. You can Obtain an optimal tableau by simply knowing two things: I Initial table. I Optimal basic variables. Example: Initial Table Basic z s1 s2 s3 s4 x1 −5 6 1 −1 0 x2 −4 4 2 1 1 s1 0 1 0 0 0 s2 0 0 1 0 0 s3 0 0 0 1 0 s4 0 0 0 0 1 RHS 0 24 6 1 2 Example: Intermediate Table Basic z x1 s2 s3 s4 x1 0 1 0 0 0 x2 −2/3 2/3 4/3 5/3 1 s1 5/6 1/6 −1/6 1/6 0 s2 0 0 1 0 0 There can be many intermediate tables. s3 0 0 0 1 0 s4 0 0 0 0 1 RHS 20 4 2 5 2 Example: Final(Optimal) Table Basic z x1 x2 s3 s4 x1 0 1 0 0 0 x2 0 0 1 0 0 s1 3/4 1/4 −1/8 3/8 1/8 s2 1/2 −1/2 3/4 −5/4 −3/4 s3 0 0 0 1 0 s4 0 0 0 0 1 RHS 21 3 3/2 5/2 1/2 Constructing Dual LP Constructing Dual LP Constraints max ≥ ≤ = min ≥ ≤ = ⇔ ⇔ ⇔ ⇔ ⇔ ⇔ Variables min ≤0 ≥0 Unrestricted max ≥0 ≤0 Unrestricted Constructing Dual LP Primal(Ex 4.1-1) max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. Constructing Dual LP Dual(Ex 4.1-1) min w = 10y1 + 8y2 s.t. y1 + 2y2 2y1 − y2 y1 + 3y2 y1 ≥5 ≥ 12 ≥4 ≥0 Constructing Dual LP from standard form Standard form: I Constraints: =. I Variables: ≥ 0. Dual of standard form: I I Dual variables: unrestricted. Dual Constraints: I I ≥ 0 if dual is min. ≤ 0 if dual is max. Constructing Dual LP from standard form Ex 4.1-1 max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. Constructing Dual LP from standard form Ex 4.1-1, standard form max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 + x4 = 10 2x1 − x2 + 3x3 =8 x1 , · · · , x4 ≥ 0. Constructing Dual LP from standard form Dual of Ex 4.1-1 min w = 10y1 + 8y2 s.t. y1 + 2y2 2y1 − y2 y1 + 3y2 y1 ≥5 ≥ 12 ≥4 ≥0 Constructing Dual LP from standard form Primal of Ex 4.1-2 min z = 15x1 + 12x2 s.t. x1 + 2x2 ≥3 2x1 − 4x2 ≤5 x1 , x2 ≥ 0. Constructing Dual LP from standard form Ex 4.1-2, standard form min z = 15x1 + 12x2 s.t. x1 + 2x2 − x3 =3 2x1 − 4x2 + x4 =5 x1 , · · · , x4 ≥ 0. Constructing Dual LP from standard form Dual of Ex 4.1-2 min w = 3y1 + 5y2 s.t. y1 + 2y2 2y1 − 4y2 y1 y2 ≤ 15 ≤ 12 ≥0 ≤ 0. Constructing Dual LP from standard form Primal of Ex 4.1-3 max z = 5x1 + 6x2 s.t. x1 + 2x2 −x1 + 5x2 4x1 + 7x2 x1 x2 =5 ≥3 ≤8 unrestricted ≥ 0. Constructing Dual LP from standard form Substitute x1 = x1+ − x1− : Ex 4.1-3, standard form max z = 5x1+ − 5x1− + 6x2 s.t. x1+ − x1− + 2x2 −x1+ + x1− + 5x2 − x3 4x1+ − 4x1− + 7x2 + x4 x1+ , x1− , x2 , x3 , x4 =5 =3 =8 ≥ 0. Constructing Dual LP from standard form Dual of Ex 4.1-3 min w = 5y1 + 3y2 + 8y3 s.t. y1 − y2 + 4y3 2y1 + 5y2 + 7y3 y1 y2 y3 =5 ≥6 unrestricted ≤0 ≥ 0. Optimal Dual Solution Primal and Dual solution meet at optimality. How do you determine the optimal dual variables when you solved the primal? Ex 4.2-1 max z = 5x1 + 12x2 + 4x3 s.t. x1 + 2x2 + x3 ≤ 10 2x1 − x2 + 3x3 =8 x1 , x2 , x3 ≥ 0. Optimal Dual Solution Primal max z = 5x1 + 12x2 + 4x3 − MR s.t. x1 + 2x2 + x3 + x4 = 10 Dual min w = 10y1 + 8y2 s.t. y1 + 2y2 ≥ 5 2x1 − x2 + 3x3 + R = 8 2y1 − y2 ≥ 12 x1 , · · · , x4 , R ≥ 0 y1 + 3y2 ≥ 4 y1 ≥ 0 y2 ≥ −M. Optimal Dual Solution Initial Table Basic x1 x2 x3 x4 R RHS z −5 −12 −4 0 M 0 x4 1 2 1 1 0 10 R 2 −1 3 0 1 8 Optimal Table Basic x1 x2 x3 3 z 0 0 5 x2 0 1 − 15 7 x1 1 0 5 x4 29 5 2 5 1 5 R RHS − 25 + M 54 45 12 − 51 5 2 5 26 5 Method 1 Optimal value of dual variable yi = Optimal primal z-coefficient of starting basic variable xi + Original objective coefficient of xi . y1 y2 ! = 29/5 −2/5 + M ! + 0 −M ! = 29/5 −2/5 ! I Distinguish between starting basis and optimal basis. I Distinguish between z-coefficient and objective coefficient. Method 2 Optimal value of dual variables = Row vectors of original objective coefficients × of optimal primal basic variables I y1 y2 = !−1 × 2 1 −1 2 × 2/5 −1/5 1/5 2/5 12 5 = 12 5 = 29/5 −2/5 (·)−1 means matrix inversion. ! Optimal primal inverse !
© Copyright 2026 Paperzz