You are on page 1of 77

Operations Research IChapter V: Duality Theory

M. NACEUR AZAIEZ, Professor


Tunis Business School
Tunis University
https://sites.google.com/site/naceurazaiez/

Content

Introduction & Motivation


Definition of the dual of LP
Primal-Dual Relationships
Results on duality theory
Dual of LP in non-canonical form
Economic interpretations

Introduction & Motivation

The theory of duality is a very elegant


and important concept within the field
of operations research.
This theory was first developed in
relation to linear programming.

Introduction & Motivation

Next, it was found out that it has many


applications, and perhaps even a more
natural and intuitive interpretation, in
several related areas such as
nonlinear programming, networks and
game theory

Introduction & Motivation

The notion of duality within LP asserts that


every LP has associated with it a related LP
called its dual.
The original problem in relation to its dual is
termed the primal.
It is the relationship between the primal and
its dual, both on a mathematical and economic
level, that is truly the essence of duality theory.

Example 1

There is a small company in Melbourne


which has recently become engaged in the
production of office furniture.
The company manufactures tables, desks and
chairs.
The production of a table requires 8 Kgs of
wood and 5 Kgs of metal and is sold for $80.

Example 1-continued

A desk uses 6 Kgs of wood and 4 Kgs of


metal and is sold for $60; and a chair requires
4 Kgs of both metal and wood and is sold for
$50.
We would like to determine the revenue
maximizing strategy for this company,
given that their resources are limited to 100
Kgs of wood and 60 Kgs of metal.

Formulation-example 1
max Z 80 x1 60 x 2 50 x 3
x

8 x1 6 x 2 4 x3 100
5x1 4 x2 4 x 3 60
x1 , x 2 , x3 0

Duality-example 1

Now consider that there is a much bigger


company in Melbourne which has been the lone
producer of this type of furniture for many
years.
They don't appreciate the competition from
this new company; so they have decided to
tender an offer to buy all of their competitor's
resources and therefore put them out of
business.

Formulating the dual LP

The challenge for this large company then is


to develop a linear program which will
determine the appropriate amount of money
that should be offered for a unit of each type
of resource, such that the offer will be
acceptable to the smaller company while
minimizing the expenditures of the larger
company.

Problem D1
min w 100 y1 60 y2
y

8 y1 5 y2 80
6 y1 4 y2 60
4 y1 4 y2 50
y1, y2 0

Example 2: A Diet Problem

An individual has a choice of two types of


food to eat, meat and potatoes, each offering
varying degrees of nutritional benefit.
He has been warned by his doctor that he
must receive at least 400 units of protein,
200 units of carbohydrates and 100 units of fat
from his daily diet

Example 2-continued

Given that a kg of steak costs $10 and provides


80 units of protein, 20 units of carbohydrates
and 30 units of fat, and that a kg of potatoes
costs $2 and provides 40 units of protein, 50
units of carbohydrates and 20 units of fat, he
would like to find the minimum cost diet
which satisfies his nutritional requirements.

Formulating example 2
min Z 10 x1 2 x2
x

80 x1 40 x 2 400
20 x1 50 x 2 200
30 x1 20 x 2 100
x1 , x 2 0

The Dual of example 2

Now consider a chemical company which


hopes to attract this individual away from
his present diet by offering him synthetic
nutrients in the form of pills.
This company would like to determine
prices per unit for their synthetic nutrients
which will bring them the highest possible
revenue while still providing an acceptable
dietary alternative to the individual.

Dual Problem of example 2


max w 400 y1 200 y2 100 y3
y

80 y1 20 y2 30 y3 10
40 y1 50 y2 20 y3 2
y1, y2 , y3 0

Comments

Each of the two examples describes some kind


of competition between two decision makers.
The notion of competition could be
investigated more formally in Game Theory.
We shall investigate the economic
interpretation of the primal/dual relationship
later in this chapter.

Canonical form of the Primal


Problem
n

max Z c j x j
x

j 1

a11 x1 a12 x 2 ... a1n xn b1


a21 x 1 a22 x 2 ... a2 n x n b2
...
...
...
...
...
...
...
...
am1 x1 a m2 x 2 ... amn x n bm
x1 , x 2 ,..., x n 0

Canonical form of the Dual


Problem
m
min w bi yi
y

i 1

a11 y1 a21 y 2 ... a m1 y m c1


a12 y1 a 22 y 2 ... a m2 ym c 2
...
...
...
...
...
...
...
...
a1n y1 a 2 n y2 ... a mn y m c n
y1 , y 2 ,..., ym 0

Definition
Dual Problem

Primal Problem

z*: max Z cx

w* : min w yb
x

s.t.

s. t .
Ax b
x 0

yA c
y 0

b is not assumed to be non-negative

Example
Max Z = 10X1 + 5X2

2X1 + 3X2 10
6X1 + X2 15

4X1 5X2 35
X1, X2 0
21

Max ZX= 10X1 + 5 X2


2 X1 + 3 X2 10

Y1

6 X1 + X2 15

Y2

4 X1 5 X2 35

Y3

X1, X2 0
1st constraint
Min ZY =

Y1+

2nd constraint
Y2 +

Y3

Y1 +

Y2 +

Y3

Y1

Y2

Y3

Y1,Y2,Y3 0

22

Example
Primal

max Z 5x1 3x 2 8 x3 0 x 4 12 x5
x

3 x1 8x 2

9 x 4 15x 5 20

18x1 5x 2 8 x3 4 x4 12 x5 30
x1, x2 , x3 , x4 , x5 0

Dual

min w 20 y1 30 y2
y

3y1 18 y2 5

8 y1 5y 2 3
8y2 8
9y1 4 y2 0
15 y1 12 y2 12
y1, y 2 0

Primal-Dual relationship

D ual
(m in w )

y1 0
y2 0

x1 0
a11
a21

x2 0
a12
a22

.. .

. ..

...

am1

am2

ym 0
Z=

c1

c2

xn 0
a1n
a2n
amn

cn

w =

b1
b2

. ..

. ..

bn

Example
max Z 4 x1 10 x2 9 x3
x

5 x1 18 x2 5 x3 15
8 x1 12 x2 8x3 8
12 x1 4 x 2 8 x3 10
2 x1
5 x3 5
x1, x2 , x3 0

Dual
(min w)

y1 0
y2 0
y3 0
y4 0

Z=

x1 0

5
8
12
2

x2 0

x3 0

- 18
12
-4
0

5
0
8
-5

10

-9

w=
15
8
10
5

Dual

min w 15 y1 8y2 10 y3 5y4


y

5 y1 8 y2 12 y 3 2 y 4 4
18 y1 12 y 2 4 y 3
10
5 y1
8y 3 5 y 4 9
y1 , y2 , y 3 , y4 0

FINDING THE DUAL OF NONCANONICAL LP

Handling Equality Constraints


k

di xi e

i1

di xi e

i1
k

di xi e

i1

d x
i

i 1
k

di x i e
i 1

Canonical form!

Handling variables unrestricted in


sign

Replace the variable unrestricted in sign, , by


the difference of two nonnegative variables.

Example
max Z x1 x2 x3
x

2 x2 x 3 4
x1 3x 2 4 x 3 5
x1 2 x 2

x1 , x 2 0; x3 urs:= unrestricted sign

Conversion

Multiply through the greater-than-or-equal-to


inequality constraint by -1
Use the approach described above to convert
the equality constraint to a pair of inequality
constraints.
Replace the variable unrestricted in sign, , by
the difference of two nonnegative variables.

Dual
min w 4 y1 5 y2 5y3 3 y4
y

y2 y3 y4 1
2 y1 3y2 3y3 2y4 1
y1 4y2 4y3
y1 4y2 4y3
y1, y2 , y3, y4 0

1
1

Streamlining the conversion ...

An equality constraint in the primal


generates a dual variable that is
unrestricted in sign.
An unrestricted in sign variable in the
primal generates an equality constraint in
the dual.

Example (Continued)
min w 4 y1 5 y2 5y3 3 y4
y

y2 y3 y4 1
2 y1 3y2 3y3 2y4 1
y1 4y2 4y3
y1 4y2 4y3
y1, y2 , y3, y4 0

1
1

,
,
,
min
w

4
y

5
y

3
y
1
2
3
,
y
,
,
y2 y3 1
,
,
,
2 y1 3 y2 2 y3 1
,
,
y1 + 4 y2
1
correction
,
,
,
y1, y3 0; y2 urs

Primal-Dual relationship
Primal Problem

Dual Problem

opt=max

opt=min

Constraint i :
<= form
= form

Variable i :
yi >= 0
yi urs

Variable j:
xj >= 0
xj urs

Constraint j:
>= form
= form

Example

max Z 5x1 4 x 2
x

3x1 8 x2 6
x1 6 x 2 5
8 x1

10

x 2 0; x1 urs

Equivalent non-standard form


max Z 5x1 4 x 2
x

3 x1 8 x 2 6
x1 6 x2 5
8 x1
10
x 2 0; x1 urs

Dual from the recipe


min w 6 y1 5 y2 10 y3
y

3 y1 y2 8 y3 5
8y1 6 y2
4
y1 0; y2 , y3 urs

What about opt=min ?

Can use the usual trick of multiplying the


objective function by -1 (remembering to
undo this when the dual is constructed.)
It is instructive to use this method to construct
the dual of the dual of the standard form.
i.e, what is the dual of the dual of the
standard primal problem?

What is the dual of

w* : min w yb
x

s.t.
yA c
y 0

max w yb

max w yb

s.t.

s.t.

yA c
y 0

yA c
y 0

min Z cx

max Z cx

s. t .

s. t .
Ax b
x 0

Ax b
x 0

Important Observation

FOR ANY PRIMAL LINEAR


PROGRAM, THE DUAL OF THE
DUAL IS THE PRIMAL

Primal-Dual Relationship
Primal or Dual
opt=max
Constraint i :
<= form
= form

Variable j:
xj >= 0
xj urs

Dual or Primal
opt=min
Variable i :
yi >= 0
yi urs
Constraint j:
>= form
= form

Example
min Z 6 x1 4 x2
x

3x1 5 x2 12
x1 2 x 2 8
5x1 x2 10
x1, x1 0

Equivalent form
min Z 6 x1 4 x2
x

3x1 5x 2 12
x1 2 x2 8

5 x1 x2 10
x1 , x 2 0

Dual
max w 12 y1 8 y2 10 y3
y

3y1 y2 5 y3 6
5 y1 2 y2 y3 4
y1, y3 0; y2 urs

Maximization
Number of constraints
constraint
constraint
constraint =
Number of variables
Variable positive or zero
Variable negative or zero
Unconstrained Variable
Coefficient of the jth variable
In the objective function
RHS of the

ith

constraint

Minimization
Number of variables
Variable positive or zero
Variable negative or zero
Unconstrained Variable
Number of constraints
constraint
constraint
constraint =
RHS of the jth constraint

Coefficient of the ith variable


In the objective function

Technological coefficient of the Technological coefficient of the


jth variable in the ith constraint ith variable in the jth constraint52

Example
Primal
Max ZX = 5X1 + 4X2 2X3
2X1 + 3X2 20
X1 4X3 5
X1 + X2 + X3 = 30

X1, X2 0

Dual
Min ZY = 20Y1 + 5Y2 + 30Y3

2Y1 + Y2 + Y3 5
3Y1 + Y3

- 4Y2 + Y3

=- 2

Y1 0 , Y2 0, Y3 IR

Primal

Dual

Min ZX = 15X1 + 2X2

Max ZY = 10Y1+50Y2+2Y3+120Y4

X1 X2 10

Y1 + 7Y2 - Y3 + 9Y4 15

7X1 + 2X2 50

-Y1 + 2Y2 +3Y3 + Y4 = 2

- X1 + 3X2 2

Y1 0 , Y2 0, Y3 0, Y4 IR

9X1 + X2 = 120
X1 0, X2 IR

Note that the dual of the dual is the primal

54

Results

Consider the primal and dual LP:

55

Theorem
Theorem. The dual of the dual is the primal.
Proof: The dual problem LP2 is equivalent to the following problem:
Max

- bT y

s. t.

- AT y c
y 0.

By definition, the dual of this problem is


Min cT x
s. t.

( AT x b
x 0,

or equivalently,
Max

cT x

s. t.

Ax b
x 0.

which is the primal problem.

56

Various theorems related to duality


(without proof)

If x is primal feasible and y is dual feasible,


then cTx bTy (weak duality theorem).
If x* is primal feasible and y* is dual feasible
and cTx* bTy* then x* and y* are optimal
If one of a pair of primal and dual problems
has an optimal solution, then the other also
has an optimal solution and the optimal values
of their objective functions are equal.

57

Theorems-continued

If the primal is feasible and unbounded, then


dual is infeasible.
If the dual is feasible and unbounded, then the
primal is infeasible.
(Complementary Slackness Theorem). A
primal feasible solution x* and a dual feasible
solution y* are optimal if and only if
(b-Ax*)Ty* = 0 and (ATy* - c)Tx* = 0.

Interpretation of Duality

The dual variable y* measures the change in optimal


profit due to a unit change in resource i.
The fact that profit would increase by yi* if an
additional unit of resourcei were available imputes a
value or price to resource i.
This value or price is called a shadow price. Thus,
the shadow price is the amount of contribution of an
additional unit of a resource to total profit.
More will be said later in this context.
59

Discussion

Note from the weak duality theorem that we


always have

The inequality is strict except at optimal


solution where equality holds.
At optimality yi, is interpreted as the worth of
resource i.

Discussion-continued

Thus, the weak duality theorem states that the


profit is less than or equal to the worth of
resources.
That is, the resources are not exploited
according to the best allocation except at
optimality.

Discussion-continued

The yi's are the shadow prices of the resources.


A shadow price can be interpreted as the
additional unit profit that could be made by
acquiring additional units of resource i.
In particular, when a resource is not totally
consumed at optimal exploitation the related
constraint is inactive and the corresponding
shadow price must be zero.

Discussion-continued

Note that in that case, the corresponding slack


variable is basic
If however the constraint is active (i.e., the
resource is entirely consumed at optimal
exploitation), then the corresponding shadow
price is positive and therefore it will be
profitable to acquire additional units of that
resource.

Example
Consider the following LP and its dual :
Max ZX = 5X1 + 2X2 + 7X3

Min ZY = 50Y1 + 75Y2

X1 + X2 + X3 50

Y1 + 2Y2 5

2X1 + 4X2 + 3X3 75

Y1 + 4Y2 2

X1, X2, X3 0

Y1 + 3Y2 7
Y1 0 , Y2 0

The optimal tableau is given by

CJ

Basis
0
S1
5
X1
J
Dual
Solution

5
X1
0
1
0
E1
0

2
X2
-1
2
-8
E2
8

7
X3
-1/2
3/2
-1/2
E3
1/2

0
S1
1
0
0
Y1
0

0
S2
bI
-1/2 12,5
1/2
37,5
-5/2 187,5
Y2
ZY
5/2 187,5
65

Economic Interpretation of the


dual problem
Assume that in the context of the previous LP, 3
products P1, P2 et P3 are to be manufactured.
The production process requires the use of 2
resources R1 & R2 , which are available in limited

quantities of 50 et 75 units respectively.


66

Let Xi be the quantity of Pi to produce, i=1,3. As


the producer seeks to maximize his profit, his LP

can be written as:


Max ZX = 5X1 + 2X2 + 7X3

X1 + X2 + X3 50
2X1 + 4X2 + 3X3 75
X1, X2, X3 0
67

Assume that a person is willing to buy from the


producer all the available resources R1 & R2.

Let Yi be the amount of money this person should


give the producer against resource Ri, i = 1, 2.

Certainly, this person will have as objective to


minimize the amount to pay:

Min ZY = 50Y1 + 75Y2


68

However, when the producer sells his resources,


he will renounce to produce P1, P2 & P3.
Hence, he will lose the corresponding profit.
Consequently, the producer will not accept the
offer unless he gets sufficient compensation for his

lost profit.

69

The manufacturing of P1 requires one unit


of R1 and 2 units of R2.
Hence, the producer is willing to sell one
unit of R1 and two units of R2 for an
amount of at least 5 dinars (unit profit of
P1).
As Yi is the amount of money proposed
against one unit of Ri, i =1,2,then the sum
received against the amounts of resources
necessary for manufacturing 1 unit of P1 is
Y1+2Y2.
70

We must ensure that:


Y1 + 2Y2 5
Similarly, the sale of 1 unit of R1 and 4 units
of R2 must provide at least a profit of 2
dinars.
In addition, the sale of 1 unit of R1 and 3
units of R2 must provide a profit of at least 7
dinars. This leads to the following two
constraints:
Y1 + 4Y2 2
Y1 + 3Y2 7

71

Finally, given that Y1 &Y2 are amounts of money,


they cannot be negative.
It follows that the problem is formulated as:
Min ZY = 50Y1 + 75Y2

Y1 + 2Y2 5
Y1 + 4Y2 2

Y1 + 3Y2 7
Y1, Y2 0

Clearly, this LP is the dual of the original LP.


72

We Call the marginal value of a resource the


amount of change (increase or decrease) in
the value of Z due to the use of an additional
unit of the resource.
If the problem is a maximization of profit, the
marginal value of a resource is also called
marginal gain or shadow price (introduced
above)
If the problem is a minimization of cost, the
marginal value is also called marginal cost
or reduced cost.
73

Reconsider the following example


Max ZX = 5X1 + 2X2 + 7X3
X1 + X2 + X3 50

(R1)

2X1 + 4X2 + 3X3 75

(R2)

X1, X2, X3 0

CJ
0
5

Basis
S1
X1
CJ-ZJ

5
X1
0
1
0

2
X2
-1
2
-8

7
X3
-1/2
3/2
-1/2

0
S1
1
0
0

0
S2
-1/2
1/2
-5/2

bi
12,5
37,5
187,5

From the corresponding optimal Tableau,


the marginal value or shadow price of R1
is 0 and the shadow price of R2 is 2.5.
That is, an additional unit of R1 has no
effect on the value of Z, whereas an
additional unit of R2 will increase Z by 2.5
dinars.

75

The producer will not be ready to cede a


unit of R1 (respectively R2) unless he
obtains against it at least 0 (respectively
2.5 dinars) additional gain.
Equivalently, in order to acquire one more
unit of R1 (respectively R2), the producer
will be willing to pay additional cost of 0
(respectively 2.5 dinars).

76

The CJ-ZJ of a decision variable


CJ-ZJ is called the reduced cost of the
corresponding decision variable
It is interpreted as the deficit for the
decision variable to become basic
In the last tableau, C2-Z2 =-8. This says
that the unit profit of P2 must increase at
least by 8 dinars for P2 to become
profitable.
77

The CJ-ZJ of a decision variable


Equivalently, by forcing one unit of P2 to be
produced, the profit will be reduced by 8
dinars.
Similarly, the unit profit of P3 must increase
at least by 0.5 dinars for P3 to become
profitable

78

You might also like