Week_7: Duality 1 1- Define dual problem The dual problem is an LP defined directly and systematically from the primal (or original) LP model. The two problems are so closely related that the optimal solution of one problem automatically provides the optimal solution to the other. The dual is defined for various forms of the primal depending on the sense of optimization (maximization or minimization), types of constraints (≥, ≤, or =), and orientation of the variables (nonnegative or unrestricted). define the primal in equation form as follows: maximize or minimize 𝑧 = subject to 𝑛 𝑗 =1 𝑐𝑗 𝑛 𝑗 =1 𝑎𝑖𝑗 𝑥𝑖𝑗 𝑥𝑗 ≥0 𝑥𝑗 = 𝑏𝑖𝑗 𝑖 = 1,2,3 … … … 𝑚 𝑗 = 1,2,3 … . . 𝑛 The variables xi, j = 1, 2, ... , n, include the surplus, slack, and artificial variables. the dual problem is constructed from the primal. Effectively, we have 1. A dual variable is defined for each primal (constraint) equation. 2. A dual constraint is defined for each primal variable. 1. The constraint (column) coefficients of a primal variable define the left-hand side coefficients of the dual constraint and its objective coefficient define the right-hand side. 3. The objective coefficients of the dual equal the right-hand side of the primal constraint equations. dual variable y1 y2 . . ym primal variable ……. xj …… xn …… cj ……. cn x1 c1 x2 c2 a11 a21 . . am1 a12 a22 a1j a2j a1n a2n b1 b2 am2 amj jth dual constrian amn bm dual objective coficient right hand side The rules for determining the sense of optimization (maximization or minimization), the type of the constraint or =, and the sign of the dual variables are summarized in Table below: 2 Objective Primal problem(objective) Maximization Minimization Minimization maximization Dual problem Constraints type Variable sign ≥ ≤ Unrestricted unrestricted Example: Primal primal in equation form dual variable Maximize z=5x1+12x2+4x3 maximize z=5x1+12x2+4x3+0x4 Subject to subject to x1+2x2+x3≤10 x1+2x2+x3+x4=10 y1 2x1-x2-3x3=8 2x1-x2+3x3+0x4=8 y2 x1,x2,x3≥0 x1,x2,x3x4≥0 ----------------------------------------------------------------------------------------------------------------Dual Problem Minimize w=10y1+8y2 Subject to y1+2y2≥5 2y1-y2≥12 y1+3y2≥4 y1+0y2≥0 →)y1≥0,y2 unrestricted) y1,y2 unrestricted } Example: Primal primal in equation form dual variable Minimize z=15x1+12x2 minimize z=15x1+12x2+0x3+0x4 Subject to subject to x1+2x2≥3 x1+2x2-x3+0x4=3 y1 2x1-4x2≤5 2x1-4x2+0x3+x4=5 y2 x1,x2≥0 x1,x2,x3,x4≥0 ----------------------------------------------------------------------------------------------------------------Dual Problem Maximize w=3y1+5y2 Subject to y1+2y2≤15 2y1-4y2≤12 -y1 ≤0 y2≤0 →)y1≥0,y2≤0) y1,y2 unrestricted } 3 Summary of the Rules for Constructing the Dual. The general conclusion from the preceding examples is that the variables and constraints in the primal and dual problems are defined by the rules in Table below. It is a good exercise to verify that these explicit rules are subsumed by the general rules in Table below Table: rules for constructing the dual problem Maximization problem Constraints ≥ ≤ = Variables ≥0 ≤0 Unrestricted minimize problem Variables ≤0 ≥0 unrestricted Constraints ≥ ≤ = 2.Optimal Dual Solution The primal and dual solutions are so closely related that the optimal solution of either problem directly yields (with little additional computation) the optimal solution to the other. Thus, in an LP model in which the number of variables is considerably smaller than the number of constraints, computational savings may be realized by solving the dual, from which the primal solution is determined automatically there are two methods for determining the dual values. Note that the dual of the dual is itself the primal, which means that the dual solution can also be used to yield the optimal primal solution automatically. Method 1. 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 = 𝑑𝑢𝑎𝑙 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑝𝑟𝑖𝑚𝑎𝑙 𝑧 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑥𝑖 + 𝑜𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑜𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑥𝑖 4 Method 2: 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑣𝑎𝑙𝑢𝑒𝑠 = 𝑜𝑓 𝑑𝑢𝑎𝑙 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑟𝑜𝑤 𝑣𝑒𝑐𝑡𝑜𝑟 𝑜𝑓 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑜𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑜𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡𝑠 × 𝑝𝑟𝑖𝑚𝑎𝑙 𝑜𝑓 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑝𝑟𝑖𝑚𝑎𝑙 𝑏𝑎𝑠𝑖𝑐 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑖𝑛𝑣𝑒𝑟𝑠𝑒 Example: Consider the following LP: Maximize z=5x1+12x2+4x3 Subject to x1+2x2+x3≤10 2x1-x2+3x3=8 x1,x2,x3≥0 To prepare the problem for solution by the simplex method, we add a slack x4 in the first constraint and an artificial R in the second. The resulting primal and the associated dual problems are thus defined as follows: Primal Dual - ----------------------------------------------------------------------------------------------------------------maximize z=5x1+12x2+4x3-MR minimize w=10y1+8y2 subject to subject to x1+2x2+x3+x4 2x1-x2+3x3 y1+2y2≥5 =10 + R=8 2y1-y2≥12 x1,x2,x3,x4,R≥0 y1+3y2≥4 y1 ≥0 y2≥-M(→y2 unrestricted) table below provides the optimal primal tableau. Basic Z X2 X1 X1 0 0 1 X2 0 1 0 X3 3/5 -1/5 7/5 5 X4 29/5 2/5 1/5 R -2/5+M -1/5 2/5 solution 54.8 12/5 26/5 Method 1: In Table above, the starting primal variables x4 and R uniquely correspond to the dual variables yl and y2, respectively. Thus, we determine the optimum dual solution as follows: Start primal basic variables z-equation coefficients Original objective coefficient Dual variables Optimal dual values X4 29/5 R -2/5+M 0 -M y1 29/5+0=29/5 y2 -2/5+M+(-M)=-2/5 Method 2_ The optimal inverse matrix, highlighted under the starting variables X4 and R, is given in Table as 2 −1 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑖𝑛𝑣𝑒𝑟𝑠𝑒 = 5 5 1 2 5 5 First, we note that the optimal primal variables are listed in the tableau in row order as x2 and then x1 This means that the elements of the original objective coefficients for the two variables must appear in the same order-namely, (Original objective coefficients) = (Coefficient of x2, coefficient of x1 ) = (12,5) Thus, the optimal dual values are computed as 𝑦1, 𝑦2 = 𝑜𝑟𝑖𝑔𝑖𝑛𝑎𝑙 𝑜𝑏𝑗𝑒𝑐𝑡𝑖𝑣𝑒 × 𝑜𝑝𝑡𝑖𝑚𝑎𝑙 𝑖𝑛𝑣𝑒𝑟𝑠𝑒 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑥2, 𝑥1 = 12 5 2 −1 5 5 1 2 5 5 6 = 29 5 −2 5