computational methods for management and economics carla gomes

49
Computational Methods for Management and Economics Carla Gomes Module 7a Duality

Upload: winter-walton

Post on 30-Dec-2015

24 views

Category:

Documents


0 download

DESCRIPTION

Computational Methods for Management and Economics Carla Gomes. Module 7a Duality. Duality. Every maximization LP problem in the standard form gives rise to a minimization LP problem called the dual problem - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computational Methods for Management and Economics Carla Gomes

Computational Methods forManagement and Economics

Carla Gomes

Module 7aDuality

Page 2: Computational Methods for Management and Economics Carla Gomes

Duality

• Every maximization LP problem in the standard form gives rise to a minimization LP problem called the dual problem

• Every feasible solution in one yields a bound on the optimal value of the other

• If one of the problems has an optimal solution, so does the other and the two optimal values coincide

• These results have very interesting economic interpretations

Page 3: Computational Methods for Management and Economics Carla Gomes

Bounds on the optimal value

Let x1 = the number of doors to producex2= the number of windows to produce

Maximize Z= 3 x1 + 5 x2subject to

x1≤ 42x2≤ 123x1 + 2x2≤ 18

andx1 ≥ 0, x2 ≥ 0.

Lower bound (LB) on Z* Z* ≥ LB any feasible solutionUpper bound (UB) on Z* Z* ≤ UB – how do we come up with

upper bounds for Z* for a maximization LP problem?

Page 4: Computational Methods for Management and Economics Carla Gomes

“Guessing” upper bounds

Page 5: Computational Methods for Management and Economics Carla Gomes

A principled way of finding upper-bounds on Z*

Dual Problem

Page 6: Computational Methods for Management and Economics Carla Gomes

Primal vs. Dual Problem

Maximize Z= 3 x1 + 5 x2

subject to

x1 ≤ 4 2x2≤ 123x1 + 2x2≤ 18

and

x1 ≥ 0, x2 ≥ 0.

Minimize W= 4 y1 + 12 y2 + 12 y3

subject to

y1 + 3 y3 ≥ 3 2 y2 + 2 y3 ≥ 5

and

y1 ≥ 0, y2 ≥ 0, y3 ≥ 0

Page 7: Computational Methods for Management and Economics Carla Gomes

Primal vs. dual

• The dual of a maximization problem is a minimization problem; the dual of a minimization problem is a maximization problem

• The m primal constraints are in a one-to-one correspondence with the m dual variables yi, and conversely, the n dual constraints are in a one-to-one correspondence with the n primal variables, xj.

• The coefficient at each variable in the objective function, primal or dual, appears in the other problem the RHS of the corresponding constraint.

ibjxija

jciyija

Page 8: Computational Methods for Management and Economics Carla Gomes

Primal vs. Dual

Max Z = c1 x1 + c2x2 + …. + cnxn

Subject to:

a11 x1 + a12 x2 + … + a1n xn ≤ b1

a21 x1 + a22 x2 + … + a2n xn ≤ b2

am1 x1 + am2 x2 + … + amn xn ≤ bmx1, x2, …, xn ≥ 0

Min W = b1 y1 + b2y2 + …. + bmym

Subject to:

a11 y1 + a21 y2 + … + am1 ym ≥ c1

a12 y1 + a22 y2 + … + am2 ym ≥ c2

a1n y1 + a2n y2 + … + amn yn ≥ cny1, y2, …, ym ≥ 0

Page 9: Computational Methods for Management and Economics Carla Gomes

Primal vs. Dual

Max Z = c x

Ax ≤ bx ≥ 0

Max W = bT y

ATy ≤ cT

y ≥ 0

Page 10: Computational Methods for Management and Economics Carla Gomes

Primal vs. Dual Problem

Maximize Z= 3 x1 + 5 x2

subject to

1 x1 ≤ 4 2 x2≤ 123 x1 + 2 x2≤ 18

and

x1 ≥ 0, x2 ≥ 0.

Minimize W= 4 y1 + 12 y2 + 18 y3

subject to

1 y1 + 3 y3 ≥ 3 2 y2 + 2 y3 ≥ 5

and

y1 ≥ 0, y2 ≥ 0, y3 ≥ 0

Page 11: Computational Methods for Management and Economics Carla Gomes

Wyndor Glass: Primal vs. DualMatrix Notation

Max Z = 3 5 x1

x2

Subject to:

1 0

0 1

3 2

4

12

18

x1

x2

x ≥ 0

Min W= 4 12 18 y1

y2

y3

1 0 3 0 1 2

y1y2y3

≥35

y ≥ 0

Page 12: Computational Methods for Management and Economics Carla Gomes

Primal-dual table for LP

Page 13: Computational Methods for Management and Economics Carla Gomes

Max

n

jj

xj

c1

s.t

),,2,1(1

miibjxn

j ija

),,2,1(0 njjx

m

ii

yi

b1

Min

),,2,1(1

njjciym

i ija

),,2,1(0 miiy

Primal Dual

Page 14: Computational Methods for Management and Economics Carla Gomes

Every feasible dual solution yields an upper-bound on Z* of the primal and every feasible primal solution yields a lower-

bound on Z* of the dual

Z*

Primal feasible solutions(Maximization)

Lower Bounds on Dual Optimum

Dual feasible solutions(Minimization)

Upper Bounds on Primal Optimum

Weak duality property

Page 15: Computational Methods for Management and Economics Carla Gomes

m

ii

yi

bn

jj

xj

c11

Weak duality property

Weak duality property

Every feasible dual solution yields an upper-bound on Z* of the primal and every feasible primal solution yields a lower-bound on Z* of the dual

Page 16: Computational Methods for Management and Economics Carla Gomes

Proof: Weak duality property

m

ii

yi

bn

jj

xj

c11

Page 17: Computational Methods for Management and Economics Carla Gomes

Primal vs. dual Simplex

My-wyndor.txtMy-wyndor-dual.txt

Page 18: Computational Methods for Management and Economics Carla Gomes

The magic continues …Final tableau - primal

Final tableau - dual

Final row (0) of the

simplex automatically

provides the optimal

values of the

dual variables, y*i ,

they correspond to

the slack variables in

the final row(0) of the

simplex method.

Page 19: Computational Methods for Management and Economics Carla Gomes

Strong Duality Property

m

ii

yi

bn

jj

xj

c1

*

1

*

For the proof we’ll use as starting point the final row (0)as generated by the algebraic simplex procedure. We’llalso show how the final row (0) of the simplex algebraicprocedure automatically provides the optimal values of thedual variables. In fact we denote by y*

i the coefficients that correspond to the slack variables in the final row(0) of the simplex method.

Page 20: Computational Methods for Management and Economics Carla Gomes

Every feasible dual solution yields an upper-bound on Z* of the primal and every feasible primal solution yields a lower-

bound on Z* of the dual

Z*

Primal feasible solutions(Maximization)

Lower Bounds on Dual Optimum

Dual feasible solutions(Minimization)

Upper Bounds on Primal Optimum

Weak duality property

Strong duality property

Primal Opt. = Dual Opt.

Page 21: Computational Methods for Management and Economics Carla Gomes

Strong Duality

Property Proof

Page 22: Computational Methods for Management and Economics Carla Gomes

Notation for entries in row 0 of a simplex tableau (textbook)

Dual surplus variables Dual decision variables

Note: Complete basic solutions for the primal and dual problem can be read directly from row (0)

Page 23: Computational Methods for Management and Economics Carla Gomes

Minimize W= 4 y1 + 12 y2 + 12 y3

subject to

y1 + 3 y3 ≥ 3 12 y2 + 12 y3 ≥ 5

and

y1 ≥ 0, y2 ≥ 0, y3 ≥ 0

Minimize W= 4 y1 + 12 y2 + 12 y3

subject to

y1 + 3 y3 – (z1 – c1) = 3

12 y2 + 12 y3 - (z2 – c2) = 5

and

y1, y2 , y3 , (z1 – c1), (z2 – c2) ≥ 0

Introducingsurplus vars

Page 24: Computational Methods for Management and Economics Carla Gomes

Primal Simplex: Weak Duality and strong dualityThe different (non-optimal) basic feasible solutions produced by the

simplex algorithm in each iteration are feasible from the point of view

of the primal but not from the point of view of the dual.

Iteration 0: basic dual solution is infeasible since(z1 – c1) and (z2 – c2) are negative (weak duality)

Iteration 1: basic dual solution is infeasible because (z1 – c1) is negative (weak duality)Final iteration –basic dual solution is feasible and optimal (StrongDuality).

Note: Complete basic solutions for the primal and dual problem can be read directly from row (0)

Page 25: Computational Methods for Management and Economics Carla Gomes

Complementary slackness relationship for complementary basic solutions

Primal Variable Associated Dual Variable

Basic

Non-Basic

Non-basic (m variables)

Basic (n variables)

Page 26: Computational Methods for Management and Economics Carla Gomes
Page 27: Computational Methods for Management and Economics Carla Gomes

Simplex method:Complementary solutions property

• At each iteration the simplex method simultaneously identifies a CPF solution x for the primal problem and a complementary solution y for the dual problem, where:– cx = yb– If x is not optimal for the primal, than y is not

feasible for the dual.

Page 28: Computational Methods for Management and Economics Carla Gomes

Simplex method:Complementary optimal solutions

property

• At final iteration the simplex method simultaneously identifies an optimal solution x* for the primal problem and a complementary optimal solution y* for the dual problem, where:– cx* = yb*

Page 29: Computational Methods for Management and Economics Carla Gomes

Complementary Slackness Optimal solutions

• Let x1*, x2*, …xn* be a primal feasible solution and a y1*, y2*, …ym* dual feasible solution.

• Necessary and sufficient conditions for simultaneous optimality of x1*, x2*, …xn* and y1*, y2*, …ym* are:

),,2,1()(0*

1

* njbothorjxorjcm

ii

yi

b

),,2,1()(0*

1

* mibothoriyoribn

jj

xij

a

This result is very useful for checking the optimality of solutions

Page 30: Computational Methods for Management and Economics Carla Gomes

Complementary Slackness Optimal solutions

Page 31: Computational Methods for Management and Economics Carla Gomes

Relationships between the primal and dual problems

• If one problem has feasible solutions and a bounded objective function (and therefore an optimal solution), then so does the other problem (both weak and strong duality apply)

• If one problem has feasible solutions and an unbounded objective function (therefore no optimal solution) then the other problem has no feasible solutions

• If one problem has no feasible solutions than the other problem has no feasible solutions or an unbounded objective function.

Page 32: Computational Methods for Management and Economics Carla Gomes

Primal-Dual Combinations

Page 33: Computational Methods for Management and Economics Carla Gomes

Adapting to Other Forms

• What if our problem is not in standard form?

– We can always transform it to the standard form and then construct the dual;

Page 34: Computational Methods for Management and Economics Carla Gomes
Page 35: Computational Methods for Management and Economics Carla Gomes

Dual of the dual

Note: it is not important which problem we call dual and whichproblem we call primal given the symmetry property of the primaldual relationships. In general we call primal the model formulatedto fit the actual problem.

Page 36: Computational Methods for Management and Economics Carla Gomes

Shortcut for = constraints

Page 37: Computational Methods for Management and Economics Carla Gomes

Shortcut for dual transformations: = constraints or unconstrained variables

We could still do the conversion into the standard format ,but a shortcut is available for these two formats.

•An equality constraint in the primal should be treated justlike a <= constraint in constructing the dual, except that the non-negativity constraint for the corresponding dual variableshould be deleted•By the symmetry property, a primal variable not subject tonon-negativity constraints affects the dual problem only by changing the corresponding inequality constraint to anequality constraint.

Page 38: Computational Methods for Management and Economics Carla Gomes

Shortcut for dual transformations: >= constraints (Maximization)

Consider:

•Constructing the dual from this expression would lead to –aij ascoefficients of yi in the functional constraint j (of the form >=)and a coefficient –bi in the objective function (which is to beminimized); yi would be subject to a non-negativity constraint (yi ≥ 0);•Cleaner alternative for dual:

•Consider y’i = - yi •Express the dual in terms of y’i

(- the coefficients of the variable become aij for functional constraint j and bi for the objective function- the constraint in the variable becomes y’i ≤ 0;)

ibjxn

j ijaibjxn

j ija

11

Page 39: Computational Methods for Management and Economics Carla Gomes

Sensible, Odd, Byzarre Variable constraints

• Maximization/Minimization problems

• “sensible” x >=0;• “odd” x unrestricted;• “byzarre” x <=0;

Page 40: Computational Methods for Management and Economics Carla Gomes

Sensible, Odd, Byzarre Constraints

• Maximization problems• “sensible” <=

• “odd” =

• “byzarre” >=

• Minimization problems• “sensible” >=

• “odd” =

• “byzarre” <=

Page 41: Computational Methods for Management and Economics Carla Gomes
Page 42: Computational Methods for Management and Economics Carla Gomes

Radiation Therapy Example

Page 43: Computational Methods for Management and Economics Carla Gomes
Page 44: Computational Methods for Management and Economics Carla Gomes
Page 45: Computational Methods for Management and Economics Carla Gomes

Primal-dual correspondence

Page 46: Computational Methods for Management and Economics Carla Gomes

Complexity of Simplex Method Primal vs. Dual

• How long does it take to solve an LP using the simplex method? – Several factors but the most important one seems to be the

number of functional constraints.• Computation tends to be proportional to the cube of the number of

functional constraints in an LP.

– The number of variables is a relatively minor factor (assuming revised simplex method)

– The density of the matrix of technological coefficients is also a factor – the sparser the matrix (i.e., the larger the number of zeroes) the faster the simplex method;

Real world problems tend to be sparse, i.e., “sparcity” of 5% or even 1%, which leads to fast runs.

Page 47: Computational Methods for Management and Economics Carla Gomes

Complexity of Simplex Method Primal vs. Dual

• But the most important one seems to be the number of functional constraints.– Computation tends to be proportional to the

cube of the number of functional constraints in an LP.

Problem A takes 8 times

longer than problem B

Question: So if problem A has twice as many

constraints as problem B how much longer takes

to solve problem A in comparison to problem B?

Page 48: Computational Methods for Management and Economics Carla Gomes

Primal vs. Dual?

So, the size of the problem, may determinewhether to use the simplex method on the

primal or dual problem.

If the primal has a large number of constraints and a small number of variables it is better to apply

the simplex method to the dual (since it will havea small number of constraints).

Page 49: Computational Methods for Management and Economics Carla Gomes

Dual Simplex Method

• This method is based on the duality results.• It is a mirror image of the simplex method:

– the simplex method deals with primal feasible solutions (but not dual feasible), moving toward a solution that is dual feasible;

– the dual method deals with basic solutions in the primal problem that are dual feasible but not primal feasible. It moves toward an optimal solution by striving to achieve primal feasibility as well.