You are on page 1of 103

Linear Programming a

geometrical preview

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

1 / 103

Linear Programming
Learning Objectives
Ability to formulate a linear program:
define the decision variables (elements under control of the decision maker whose values determine
the solution of the model);
define the objective function as linear combinations of the decision variables (criterion the decision
maker will use to evaluate alternative solutions to the problem);
define the constraints of the problem as linear combinations of the decision variables (restrictions
imposed upon the values of the decision variables by the caracteristics of the problem under study);

Ability to represent graphically the decision space of a linear program.


Ability to find, based on the graphical representation, the optimal solution of the linear
program.
Ability to determine, based on the graphical representation, the shadow price on a constraint:
How much does the objective function increase if there is a unit increase in a constraint
resource?
Ability to determine, based on the graphical representation, over what range can a particular
objective-function coefficient vary without changing the optimal solution.
Ability to determine, based on the graphical representation, over what range can the
right-hand-side of a constraint change in order to maintain the shadow price.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

2 / 103

Production Planning at BA
The factory of Barbosa & Almeida (BA) in Avintes produces glass containers through mould
injection.
BA recently won two new clients and intends to assign this production to one of its furnaces. The
orders were of bottles of Sandeman Ruby Port (75cl) and one liter bottles of olive oil Oliveira da
Serra. Both customers buy all the bottles that BA can produce.
Due to differences in the production (number of cavities and different cycle times), each batch of
portwine bottles takes 50 hours to produce, whereas each batch of oil bottles requires only 30
hours. There are a total of 2000 hours available at the oven.
Moreover, there are restrictions in the storage capacity of the bottles prior to their dispatch. The
warehouse has 300m3 available and each batch of portwine bottles occupies 6m3 of warehouse
space, while each batch of bottles of olive oil holds 5m3 .
Finally we must also consider the capacity available in the decoration sector (e.g. labels,
packaging), which is 200 hours. The portwine bottles spend 3 hours per batch and the olive oil
bottles 5 hours per batch.
Barbosa & Almeida wants to maximize the profit from these two orders, knowing that the profit
per batch is 50e and 60e, respectively.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

3 / 103

Production Planning at BA
Linear Programming Model
Decision variables
xVP Number of batches of Vinho do Porto Ruby Sandeman bottles to produce;
xA Number of batches of Azeite Oliveira da Serra bottles to produce.

Objective:
max

Z = 50xVP + 60xA

Subject to:
50xVP +

30xA

2000

6xVP +

5xA

300

(space in the warehouse)

3xVP +

5xA

200

(capacity in the decoration sector)

xVP ,

xA

(time in the oven)

In this model xVP and xA may not be integer.


U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

4 / 103

Production Planning at BA
Graphical resolution Active and redundant constraints
80
XA

50XVP + 30XA = 2000

70

Sentido de crescimento de Z

(restrio ativa)

Z = 50XVP + 60XA

60

Tempo no Forno

50

Espao no armazm
Capacidade na decorao

40

Funo objectivo
30

XVP =0
20

3XVP + 5XA = 200


(restrio ativa)

10

0
0

10

XA=0

20

30

40

50

60

70

6XVP + 5XA = 300

(restrio redundante)

80
XVP

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

5 / 103

Production Planning at BA
Graphical resolution Optimal solution
XA

80

70

50XVP + 30XA = 2000

60

50

Z = 50XVP + 60XA

20

3XVP + 5XA = 200

10

0
0

10

20

30

40

50

30xA =
5xA =

2000
200

xVP =
xA =

25
25

Optimal solution:
= 25, x = 25, Z = 2750
xVP
A

40

30

50xVP +
3xVP +

60

70

6XVP + 5XA = 300


Tempo no Forno

Capacidade na decorao

Espao no armazm

Funo objectivo

80
XVP

The optimal solution must be in a vertex of the


solution space:
The solutions inside the admissible region cannot
be optimal because the profit may always
increase by increasing xVP , xA or both.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

6 / 103

Production Planning at BA
Graphical resolution Relation between vertices and basic solutions
XA

80

X = (XVP; XA; Folgaf; Folgaa; Folgad)


A = (0; 40; 800; 100; 0)

70

B = (0; 0; 2000; 300; 200)

50XVP + 30XA = 2000


60

C = (40; 0; 0; 60; 80)


D = (25; 25; 0; 25; 0)

50

U = (10; 20; 900; 140; 70)


W = (50; 0; -500; 0; 50)

40 A

Z = 50XVP + 60XA

30

A, B, C e D are admissible basic solutions;


W is a basic, non-admissible solution;

U is not a basic solution.

20

The vertices of the admissible region are admissible basic solutions. The other vertices correspond
to basic, non-admissible solutions (negative variables). All the points inside the admissible region
are non-basic solutions.

3XVP + 5XA = 200

10

0B
0

10

20

30

40

50

60

70

6XVP + 5XA = 300


Tempo no forno

Capacidade na decorao

Espao no armazm

Funo objectivo

80
XVP

When moving from one vertex to another


adjacent vertex one basic variable becomes
non-basic and one non-basic variable becomes
basic.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

7 / 103

Production Planning at BA
Graphical resolution (Sensitivity analysis Coefficients of the objective
function)
80
XA
70

50XVP + 30XA = 2000


60

The optimal solution ramains unchanged while


the slope of the objective function is maintained
between the slope of the restriction time in the
oven and the slope of the constaint decoration
capacity.

50

40

Z = 50XVP + 60XA

30

20

Varying the slope of the objective function the


optimal solution jumps from vertex to vertex.

3XVP + 5XA = 200

10

0
0

10

20

30

40

50

60

70

6XVP + 5XA = 300


Tempo no Forno

Capacidade na decorao

Espao no armazm

Funo objectivo

80
XVP

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

8 / 103

Production Planning at BA
Graphical resolution (Sensitivity analysis Coefficients of the objective
function)

In order to calculate the variation of the coefficient of xVP


(CVP xVP + 60xA ) we can write the two active constraints
in the optimal solution with coefficient 60 in xA :
100xVP +

60xA

4000

(time in the oven)

36xVP +

60xA

2400

(decoration cap.)

The coefficients of xVP in the two constraints will then be


the limits for the variation of CVP such that the optimal
solution does not change.
36

CVP

100

36

CVP (initial value 50)

100

In order to calculate the variation of the coefficient of xA


(50xVP + CA xA ) we can write the two active constraints in
the optimal solution with coefficient 50 em xVP :
50xVP +

30xA

2000

50xVP +

250 x
3 A

(time in the oven)

100000
3

(decoration cap.)

The coefficients of xA in the two constraints will then be the


limits for the variation of CA such that the optimal solution
does not change.
30

CA

30

CA (initial value 60)

250
3
250
3

In both cases, the initial value of the coefficients is within the calculated range of variation.
If the initial values were not contained in this interval, which ranges should be considered?

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

9 / 103

Production Planning at BA
Graphical resolution (Sensitivity analysis RHS of the constraints)
80
XA
70

50XVP + 30XA = b1
60

50

Active constraint with another slope:


the optimal value changes but the vertex does
not change.

40

Z = 50XVP + 60XA

30

20

A change in the RHS value of a constraint


translates the constraint into a paralel position.

3XVP + 5XA = 200

10

0
0

10

20

30

40

50

60

70

6XVP + 5XA = 300


Tempo no Forno

Capacidade na decorao

Espao no armazm

Funo objectivo

80
XVP

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

10 / 103

Production Planning at BA
Graphical resolution (Sensitivity analysis RHS of the constraints)
Reducing the number of available hours in
theoven time(b1 ) translates the line downwards.
If the line surpasses the intersection between the constraint decoration capacity
and xVP 0

Increasing the number of available hours in


the oven time (b1 ) translates the line upwards.
If the line surpasses the intersection between
the constraint space in the warehouse and
decoration capacity:

(xVP , xA ) = (0, 40)

(xVP , xA ) = (33 31 , 20)

the constraint decoration capacity will not


be an active constraint any more and the
optimal vertex changes.

the constraint oven time is not active anymore and the optimal vertex changes.
(33 13 , 20) line oven time
50 33 13 + 30 20 = b1
b1 = 2266 32

(0, 40) line oven time


50 0 + 30 40 = b1
b1 = 1200
The optimal vertex will remain the same while:
1200 b1 2266
(FEUP | DEGI)

2
3

Operations Research

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

11 / 103

Production Planning at BA
Graphical resolution (Shadow prices1 of the constraints)
The shadow price of one constraint represents the variation in the objective function value if we increase the
RHS of the constraint by one unit.
Example:
By how much would the profit increase if we could have an additional hour in the decoration? (increase the
RHS of the contraint from 200 to 201)


xVP = 24 13
50xVP + 30xA = 2000
16

5
3xVP +
5xA =
201
xA = 25 16

13
5
Optimal solution: xVP
= 24 16
, xA = 25 16
, Z = 2759 38

With an additional hour in the decoration (an increase from 200 to 201) the value of the optimal solution
increased from 2750 to 2759 38 . The constraint decoration capacity has therefore a shadow price of 9 83 .
The shadow price remains the same while the optimal vertex does not change
(see the sensitivity analysis for the RHS of the constraints).

The shadow price of a non-active constraint is zero.


U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

The shadow prices are also called dual variables, marginal values or pi values.
(FEUP | DEGI)

Operations Research

2012/2013

12 / 103

Linear Programming
Graphical resolution

(Unique optimal solution)

x2

Z = 4 x1 + x2

Objective:
max

Z = 4x1 + x2

8 12

16

20

x1 - x2 = 2

Subject to:
x1

x2

x1 +

2x2

x1 ,

x2

x1 + 2x2 = 8
x1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

13 / 103

Linear Programming
Graphical resolution

(Non-unique optimal solution)

x2

- 34
Z = x1 - x2 - 30

- 32
- 30

- 28

Objective:
max

Z = x1 x2 30

x1 - x2 = 2

Subject to:
x1

x2

x1 +

2x2

x1 ,

x2

x1 + 2x2 = 8
x1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

14 / 103

Linear Programming
Graphical resolution

(Unlimited solution)

x2

Z = 4 x1 + x2

8 12

16

20

Objective:
max

x1 - x2 = 2

Z = 4x1 + x2

Subject to:
x1

x2

x1 ,

x2

0
x1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

15 / 103

Linear Programming
Graphical resolution

(Without admissible solution)

x2
x1 - x2 = -5

Objective:
max

Subject to:
x1

x2

x1 +

2x2

x1 ,

x2

x1 + 2x2 = 8
x1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

16 / 103

Mathematical Programming

We consider only very special Mathematical Programming Models:


All the variables take values in R or in Z.
There is only one objective to minimize or to maximize.
The objective and the constraints are linear functions of the decision variables.
Linear Programming Models if all the variables take values in R.
Integer Programming Models if all the variables take values in Z.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

17 / 103

Mathematical Programming: fundamentals

Objective:
min

f (X )

Subject to:
gi (X )

i{1,...,m}

hi (X )

=0

i{1,...,l}

Admissible set All the points S Rn that satisfy the constraints.


Admissible solution Each X S is an admissible solution.
Optimal solution X S
f (X )

f (X )

X S

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

18 / 103

Mathematical Programming
Non-linear programming example

Curvas de nvel de f

Objective:

x2
(3, 6)

min

f (X ) = (x1 3)2 + (x2 6)2

Subject to:
x12 + x2 0
x1 + x2 6
x1 , x2 0
Conjunto
admissvel

Optimal solution: x1 = 32 , x2 = 92 , f =

9
2

x1
x 2 = x 12

x1 + x 2 = 6

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

19 / 103

Simplex Method
based on:
Bradley, Hax, and Magnanti; Applied
Mathematical Programming, Addison-Wesley,
1977

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

20 / 103

Simplex Method
Learning Objectives
Canonical Form
Ability to transform any linear program to a canonical form:

with nonnegative variables


by replacing each decision variable unconstrained in sign by a difference between two nonnegative
variables. This replacement applies to all equations including the objective function.
with equality constraints
by changing inequalities to equalities by the introduction of slack and surplus variables. For
inequalities, let the nonnegative surplus variable represent the amount by which the lefthand side
exceeds the righthand side; for inequalities, let the nonnegative slack variable represent the
amount by which the righthand side exceeds the lefthand side.
with non-negative righthand-side coefficients
by multiplying equations with a negative righthand side coefficient by -1.
with one basic variable isolated in each constraint
by adding a (nonnegative) artificial variable to any equation that does not have an isolated variable
readily apparent, and construct the BIG M objective function.
Simplex Method
Ability to use the simplex method in tableau form to solve a linear program represented in the Canonical Form, i.e.:

Ability to determine the starting point to initiate the simplex method.


Ability to write the linear program in tableau form.
Ability to use the improvement mechanism for moving from a point to another point with a better
value of the objective function.
Improvement Criterion
In a maximization (minimization) problem, choose the nonbasic variable that has the most positive (negative)
coefficient in the objective function of a canonical form. If that variable has a positive coefficient in some
constraint, then a new basic feasible solution may be obtained by pivoting
Ratio and Pivoting Criterion
U. PORTO
FEUP that
When improving a given canonical form by introducing variable xs into the basis, pivot in a constraint
gives the minimum ratio of righthand-side coefficient to the corresponding xs coefficient. Compute these ratios
only for constraints that have a positive coefficient for xs .

FACULDADE DE ENGENHARIA
UNIVERSIDADE DO PORTO

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP
DEGI)
Ability | to
detect

Operations
Research
2012/2013
termination criteria
to indicate
when a solution has been obtained.

21 / 103

Simplex method: A systematic procedure for solving linear


programs
The method proceeds by moving from one feasible solution to another, at each step improving
the value of the objective function and terminates after a finite number of such transitions.
Two important characteristics of the simplex method:
The method is robust

it solves any linear program;


it detects redundant constraints in the problem formulation;
it identifies instances when the objective value is unbounded over
the feasible region;
it solves problems with one or more optimal solutions;
the method is also self-initiating: it uses itself either to generate
an appropriate feasible solution, as required, to start the method,
or to show that the problem has no feasible solution.

The method provides much more than just optimal solutions. .


it indicates how the optimal solution varies as a function of the
problem data (cost coefficients, constraint coefficients, and
righthand-side data).
it gives information intimately related with a linear program called
the dual of the given problem: the simplex method automatically
solves this dual problem along with the given problem.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

22 / 103

Production Planning at BA
Linear Programming Model
Objective:
max

Z = 50xVP + 60xA

Subject to:
50xVP +

30xA

2000

6xVP +

5xA

300

(space in the warehouse)

3xVP +

5xA

200

(capacity in the decoration sector)

xVP ,

xA

(time in the oven)

Adding slack variables s1 , s2 and s3 :


Objective:
max 50xVP + 60xA
Subject to:
50xVP
+30xA
6xVP
+5xA
3xVP
+5xA
xVP ,
xA ,

+s1
+s2
s1 ,

s2 ,

+s3
s3

=
=
=

2000
300
200
0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

23 / 103

XA

80

70

50XVP + 30XA = 2000

Objective:
max Z = 50xVP + 60xA
Subject to:
50xVP
+30xA
6xVP
+5xA
3xVP
+5xA
xVP ,
xA ,

60

50

Z = 50XVP + 60XA

40

+s1
+s2
s1 ,

s2 ,

+s3
s3

=
=
=

2000
300
200
0

Basic (admissible) solution:

Basic variables:

20

10

3XVP + 5XA = 200

0
0


Non-basic variables:

30

xVP
xA

s1
s2
s
3

10

20

30

40

50

60

6XVP + 5XA = 300

=0
=0
= 2000
= 300
= 200

Z=0

70

80
XVP

Objective: maximize Z ; choose the variable


with the most positive coeficient in the
objective function: xA
s3 is the first variable that turns zero when
xA grows.
xA grows from 0 until 40, a value such that
s3 = 0; s1 and s2 remain 0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

24 / 103

XA

Objective:
max Z = 50xVP
= 50xVP
=
2400

80

70

50XVP + 30XA = 2000

+60xA
+60(40 53 xVP 15 xd )
+14xVP
12s3

60

50

Z = 50XVP + 60XA

40

Subject to:
32xVP
3xVP
3
+xA
5 xVP
xVP ,
xA ,

30

+s1
+s2
s1 ,

s2 ,

6s3
s3
+ 15 s3
s3

=
=
=

800
100
40
0

3XVP + 5XA = 200

0
10

20

30

40

50

60

6XVP + 5XA = 300

Basic variables:

10

Basic (admissible) solution:


Non-basic variables:

20

xVP
s3

s1
s2
x
A

=0
=0
= 800
= 100
= 40

Z = 2400

70

80
XVP

Objective: maximize Z ; choose the variable


with maximum coeficient in the objective
function: xVP
s1 is the first variable that turns zero when
xVP grows.
xVP grows from 0 until 25, a value such that
s1 = 0; xA and s2 remain 0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

25 / 103

Objective:
max Z = 2400
= 2400
= 2750

+14xVP
12s3
1
+14(25 32
s1 +
7
16 s1 75
8 s3

3
16 s3 )

12s3

XA

80

70

50XVP + 30XA = 2000

Subject to:
xVP

60

1
+ 32
s1

3
16
s3

25

3
32
s1

5
16
s3

25

+s2

50

Z = 50XVP + 60XA

40

30

xVP ,

+xA
xA ,

3
s1
160
s1 ,

71
80 s3
s3

s2 ,

25
0

20

10

3XVP + 5XA = 200

Basic (admissible) solution:


0


Non-basic variables:

Basic variables:

s1
s3


xVP
s
x2
A

=0
=0

10

20

30

40

50

60

6XVP + 5XA = 300

= 25
= 25
= 25

70

80
XVP

This solution is optimal because an increase


in s1 or s3 reduction of Z.

Z = 2750

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

26 / 103

Simplex Method
Steps of the algorithm

Initial Basic Admissible Solution (BAS) :


Obtain an initial Basic Admissible Solution (BAS).
BAS is optimal? 2
Maximization if all the marginal costs are negative then the solution is optimal;
Minimization if all the marginal costs are positive then the solution is optimal.
If the BAS is not optimal then ITERATE.
ITERATE :
1 Choose the variable that enters the basis:3
Maximization the non-basic variable with the most positive marginal cost.
Minimization the non-basic variable with the most negative marginal cost.
2 Choose the variable that enters the basis:
divide the RHS of all the equations by the positive coefficients of the variable that will
enter the basis;
the variable that will leave the basis will be the basic variable of the equation with the
lowest ratio;
if all the coefficients of the variable that will enter the basis are negative or zero then
the solution is non-limited.
3

Change the lines in the tableau in order to obtain coeficient equal to one for the
pivot element and zero for all the other elements of the column, including the
objective function.
BAS is optimal?

There are alternative optimal solutions when, in the optimal solution, one non-basic variable has a zero marginal
cost.
3
If there is more than one variable that fulfills the criterion choose one arbitrarilly.
(FEUP | DEGI)

Operations Research

2012/2013

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

27 / 103

Production Planning at BA
Simplex method
Objective:
max
Subject to:

Objective:
max
Subject to:

Z =

Z =

50xVP +

60xA

50xVP +
6xVP +
3xVP +
xVP ,

30xA
5xA
5xA
xA

50xVP +

60xA

50xVP +
6xVP +
3xVP +
xVP ,

30xA +
5xA +
5xA +
xA ,

2000
300
200
0

s1
s2
s1 ,

s2 ,

s3
s3

= 2000
= 300
= 200
0
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

28 / 103

Production Planning at BA
Simplex method
s1
s2
s3
Z

xVP
50
6
3
50

xA
30
5
5
60


s1
1
0
0
0

s2
0
1
0
0

xVP

xA

s1

s2

s3

s1

160
5

30
5

800

0
1
0

0
0
0

1
0
0

100
40
2400

xA
0
0
1
0

s1
5
160
15
160
3
160
7
16

s2
0
1
0
0

s2
xA
Z

xVP
s2
xA
Z

3
3
5

14

xVP
1
0
0
0

s3
0
0
1
0

1
5

12

s3
3
16
7
16
5
16

75
8

2000
300
200
0

25
25
25
2750

xA enters the basis because:


max(50, 60) = 60
s3 leaves the basis because:
300 200
200
min( 2000
30 , 5 , 5 ) = 5

xVP enters the basis because:


max(14) = 14
s1 leaves the basis because:
100 40
800
min( 800
150 , 3 , 3 ) = 150
5

All the coefficients of the objective function


are 0.
Optimal solution:
(xVP , xA ) = (25, 25) and Z = 2750
What does s2 = 25 mean?

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

29 / 103

Finding an initial Basic Admissible Solution (BAS)

An important condition for the Simplex method is the availability of an initial Basic
Admissible Solution in the canonical form.
Sometimes this initial BAS is not evident or it may evn not exist (and sometimes there is no
Basic Admissible Solution!).
Solutions:
Trial and error solve the system for different sets of variables, reduce it to the canonical form and
test if the resulting solution is admissible.
Using artificial variables.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

30 / 103

Using artificial variables


max

Pn

j=1

cj xj

Subject to:
n
X

1. Convert the LP problem to a normalized form.

aij xj

= bi

i{1,...,m}

xj

j{1,...,n}

j=1

2. Examine each constraint and verify if there is


some variable that can be basic for that constraint.
If it does not exist, then sum an artificial variable
yi , yi 0.

max

Pn

aij xj

= bi

i{1,...,k}

aij xj + yi

= bi

i{k+1,...,m}

xj

j{1,...,n}

yi

i{k+1,...,m}

j=1

cj xj

Subject to:

Obs: The articial variables do not have any meaning in the


original problem, that is why they are called artificial. They
are only used to built an initial basis for the problem.

n
X
j=1
n
X
j=1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

31 / 103

3. The artificial problem will only be equivalent to the original one if all the artificial variables
have value zero.
Objective all the artificial variables must leave the basis.
1

Two-fase method
Big M method

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

32 / 103

Big M method

Assign the artificial variables a very high cost (M) (minimization problem) in the objective
function.
The simplex method will take care, by improving the objective function, to expel the arficicial
variables from the basis artificial variables equal to zero.
min

Pn

j=1 cj xj

Pm

i=k+1

Myi

Subject to:
n
X

aij xj

= bi

i{1,...,k}

aij xj + yi

= bi

i{k+1,...,m}

xj

j{1,...,n}

yi

i{k+1,...,m}

j=1
n
X
j=1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

33 / 103

Big M method
example

Objective:
min
Z
Subject to:
x1
4x1
2x1
x1
Objective:
min
Z
Subject to:
x1
4x1
2x1
x1

3x1

x2

x3

2x2
x2

s1

x2

x3
2x3
x3
x3

+
+
+
,

3x1

x2

x3

2x2
x2

s1

x2

x3
2x3
x3
x3

+
+
+
,

s1

=
=
=

s2

s1

s2

My1

My2

s2

y1

s2

y1

11
3
1
0

+
,

y2
y2

=
=
=

11
3
1
0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

34 / 103

3x1 + x2 + x3 + M(3 + 4x1 x2 2x3 + s2 ) + M(1 + 2x1 x3 )

4M + (3 + 6M)x1 + (1 M)x2 + (1 3M)x3 + Ms2

s1
y1
y2
Z

x1
1
4
2
3
6M

x2
2
1
0
1
M

x3
1
2
1
1
3M


s1
1
0
0
0
0

s2
0
1
0
0
M

y1
0
1
0
0
0

y2
0
0
1
0
0

11
3
1
0
4M

s1
y1
x3
Z

x1
3
0
2
1
0

x2
2
1
0
1
M


x3
0
0
1
0
0

s1
1
0
0
0
0

s2
0
1
0
0
M

y1
0
1
0
0
0

y2
1
2
1
1
3M

10
1
1
1
M

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

35 / 103

s1
x2
x3
Z

x1
x2
x3
Z

x1
3
0
2
1
0


x2
0
1
0
0
0

x3
0
0
1
0
0

s1
1
0
0
0
0

s2
2
1
0
1
0

x1
1
0
0
0

x2
0
1
0
0

x3
0
0
1
0

s1

s2
32
1
34

1
3

0
2
3
1
3

y1
2
1
0
1
M

y2
5
2
1
+1
M

1
3

12
1
1
2
0

4
1
9
2

Optimal solution: (x1 , x2 , x3 , s1 , s2 )? = (4, 1, 9, 0, 0) with Z ? = 2

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

36 / 103

Some remarks

The artificial variables are only used to serve as basic variables in a given equation. Once replaced
in the base by the original variables, the artificial variables can be eliminated from the simplex
tableau (eliminating the respective columns).

If, in the optimal simplex tableau, some artificial variables have a value > 0, it means that the
original problem has no admissible solution, and therefore it is an impossible problem.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

37 / 103

Sensitivity Analysis
based on:
Bradley, Hax, and Magnanti; Applied
Mathematical Programming, Addison-Wesley,
1977
Chapter 3, sections 3.1, 3.2, 3.3, 3.4 and 3.5

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

38 / 103

Sensitivity Analysis

We have already been introduced to sensitivity analysis via the geometry of a simple example. We
saw that the values of the decision variables and those of the slack and surplus variables remain
unchanged even though some coefficients in the objective function are varied. We also saw that
varying the righthand-side value for a particular constraint alters the optimal value of the
objective function in a way that allows us to impute a per-unit value, or shadow price, to that
constraint. These shadow prices and the shadow prices on the implicit nonnegativity constraints,
called reduced costs, remain unchanged even though some of the righthand-side values are varied.
Since there is always some uncertainty in the data, it is useful to know over what range and under
what conditions the components of a particular solution remain unchanged. Further, the
sensitivity of a solution to changes in the data gives us insight into possible technological
improvements in the process being modeled. For instance, it might be that the available resources
are not balanced properly and the primary issue is not to resolve the most effective allocation of
these resources, but to investigate what additional resources should be acquired to eliminate
possible bottlenecks. Sensitivity analysis provides an invaluable tool for addressing such issues.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

39 / 103

Sensitivity Analysis
Learning Objectives
Define shadow price of a constraint.
Calculate shadow prices using only the initial and final simplex tableaux.
Define reduced cost of a decision variable (activity).
Calculate reduced costs using only the initial and final simplex tableaux.
Price out an activity.
Calculate the reduced cost of a variable using the shadow prices and the problem data.
Calculate shadow prices using the problem data and the optimal basis.
Determine how much the objective function coefficients can vary without changing the values of the
decision variables in the optimal solution.
Determine which variables will enter and leave the basis when the new cost coefficient reaches either of
the extreme values of the range.
Determine how much the right-hand-side values can vary such that the variables that constitute the basis
remain the same.
Determine which variables will enter and leave the basis when the new right-hand-side reaches either of
the extreme values of the range.
Identify alternative optimal solutions when they exist.
Identify alternative optimal shadow prices when they exist.
U. PORTO
Analyze Solver (Microsoft Excel) sensitivity report and identify there shadow prices, reduced costs,
and
FEUP
variation ranges for objective coefficients and right-hand-sides.

FACULDADE DE ENGENHARIA
UNIVERSIDADE DO PORTO

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

40 / 103

Production Planning at BA with Favaios Bottles


The factory of Barbosa & Almeida (BA) in Avintes produces glass containers through mould
injection.
BA recently won two new clients and intends to assign this production to one of its furnaces. The
orders were of bottles of Sandeman Ruby Port (75cl), one liter bottles of olive oil Oliveira da Serra
and one liter bottles of Favaios Moscatel. The customers buy all the bottles that BA can produce.
Due to differences in the production (number of cavities and different cycle times), each batch of
portwine bottles takes 50 hours to produce, whereas each batch of oil bottles requires only 30
hours and a batch of favaios takes 50 hours to produce. There are a total of 2000 hours available
at the oven.
Moreover, there are restrictions in the storage capacity of the bottles prior to their dispatch. The
warehouse has 300m3 available and each batch of portwine bottles occupies 6m3 of warehouse
space, each batch of bottles of olive oil holds 5m3 and each batch of favaios holds 6m3 .
Finally we must also consider the capacity available in the decoration sector (e.g. labels,
packaging), which is 200 hours. The portwine bottles spend 3 hours per batch, the olive oil
bottles 5 hours per batch and the favaios bottles also 5 hours per batch.
Barbosa & Almeida wants to maximize the profit from these two orders, knowing that the profit
per batch is 50e 60e and 20e, respectively.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

41 / 103

Production Planning at BA with Favaios Bottles


Decision variables
xVP Number of batches of Vinho do Porto Ruby Sandeman bottles to produce;
xA Number of batches of Azeite Oliveira da Serra bottles to produce;
xF Number of batches of Favaios bottles to produce.

Objective:
max

Z = 50xVP + 60xA + 20xF

Subject to:
50xVP

+30xA

+50xF 2000

6xVP

+5xA

+6xF 300

(space in the warehouse)

3xVP

+5xA

+5xF 200

(capacity in the decoration sector)

xVP ,

xA ,

(time in the oven)

xF 0

In this model xVP , xA and xF may not be integer.


U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

42 / 103

Production Planning at BA
Producing Favaios Bottles
s1
s2
s3
Z

s1
s2
xA
Z

xVP
s2
xA
Z

xVP
50
6
3
50

xA
30
5
5
60


xF
50
6
5
20

s1
1
0
0
0

s2
0
1
0
0

xVP

xA

xF

s1

s2

s3

32
3

0
0
1
0

20
1
1
40

1
0
0
0

0
1
0
0

6
1

xA
0
0
1
0

xF

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

3
5

14

xVP
1
0
0
0

5
8
78
5
8
48 34

s3
0
0
1
0

1
5

12

s3
3
16
7
16
5
16

9 83

2000
300
200
0

800
100
40
2400

25
25
25
2750

xA enters the basis because:


max(50, 60, 20) = 60
s3 leaves the basis because:
300 200
200
min( 2000
30 , 5 , 5 ) = 5

xVP enters the basis because:


max(14) = 14
s1 leaves the basis because:
100 40
800
min( 800
32 , 3 , 3 ) = 32 = 25
5

All the coefficients of the objective


function are 0.
Optimal solution:
(xVP , xA , xF ) = (25, 25, 0) and
Z = 2750
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

43 / 103

Some remarks about the sensitivity analysis

We wish to analyze the effect on the optimal solution of changing various elements of the
problem data without re-solving the linear program or having to remember any of the
intermediate tableaux generated in solving the problem by the simplex method.
The type of results that can be derived in this way are conservative, in the sense that they
provide sensitivity analysis for changes in the problem data small enough so that the same
decision variables remain basic, but not for larger changes in the data.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

44 / 103

Shadow Prices
Reduced Costs

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

45 / 103

Production Planning at BA
Producing Favaios Bottles
xVP
s2
xA
Z

xVP
1
0
0
0

xA
0
0
1
0

xF
5
8
78
5
8
48 34

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16
5
16

9 38

25
25
25
2750

The complete optimal solution for the problem is


(xVP , xA , xF , s1 , s2 , s3 ) = (25, 25, 0, 0, 25, 0) and Z = 2750
The binding constraints in this optimal solution are therefore:
the first one (time in the oven, s1 = 0);
the third one (capacity in the decoration sector, s3 = 0);
and xF = 0.
50xVP
3xVP

+30xA
+5xA

+50xF
+5xF
xF

(FEUP | DEGI)

=
=
=

2000
200
0

(xVP , xA , xF ) = (25, 25, 0)


Z = 2750

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

Operations Research

2012/2013

46 / 103

Shadow Price
Definition
The shadow price associated with a particular constraint is the
change in the optimal value of the objective function per unit
increase in the righthand-side value of that constraint, all other
problem data remaining unchanged.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

47 / 103

Production Planning at BA
Producing Favaios Bottles Shadow Prices
What will be the increase of the profit per unit increase in the oven time?
50xVP
3xVP

+30xA
+5xA

50xVP
3xVP

+30xA
+5xA

50xVP
18xVP

+50xF
+5xF
xF

=
=
=

2001
200
0

xF

=
=
=

2001
200
0

xF

=
=
=

2001
1200
0

+30xA
+30xA

xVP
xA
xF

=
=
=

1
25 32
24 157
160
0

1
, 24 157
, 0)
(xVP , xA , xF ) = (25 32
160
1
7
Z = 50 25 32
+ 60 24 157
+ 20 0 = 2750 16
160
7
2750 =
Profit increase: 2750 16

7
16

xVP

xA

xF

s1

s2

s3

xVP

5
8

1
32

3
16

25

s2

7
8

3
32

7
16

25

3
160

5
16

25

7
16

9 3
8

2750

xA

5
8

48 3
4

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

48 / 103

Production Planning at BA
Producing Favaios Bottles Shadow Prices
What will be the increase of the profit per unit increase in the decoration capacity?
50xVP
3xVP

50xVP
3xVP

50xVP
18xVP

+30xA
+5xA

+50xF
+5xF
xF

=
=
=

2000
201
0

xF

=
=
=

2000
201
0

xF

=
=
=

2000
1206
0

+30xA
+5xA

+30xA
+30xA

xVP
xA
xF

5
, 25 16
, 0)
(xVP , xA , xF ) = (24 13
16
13
Z = 50 24 16
+ 60

5
16

+ 20 0 = 2759 38

Profit increase: 2759 38 2750 = 9 38


xVP
xVP

xA

xF

s1

s2

s3

5
8

1
32

3
16

25

3
32

7
16

25

s2

7
8

24 13
16

xA

5
8

3
160

5
16

25

83
25 240

48 3
4

7
16

9 3
8

2750

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

49 / 103

Each constraint of a problem has as shadow


price.

The shadow price for a constraint is the negative of the coefficient


of the appropriate slack (or artificial) variable in the objective
function of the final tableau.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

50 / 103

Reduced Cost
Definition
The reduced cost associated with the nonnegativity constraint for
each variable is the shadow price of that constraint (i.e., the
corresponding change in the objective function per unit increase in
the lower bound of the variable).

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

51 / 103

Production Planning at BA
Producing Favaios Bottles Reduced costs
What will be the reduction of the profit if we must produce at least one batch of favaios bottles?
50xVP
3xVP

+30xA
+5xA

50xVP
3xVP

+30xA
+5xA

50xVP
3xVP

+30xA
+5xA

+50xF
+5xF
xF

=
=
=

2000
200
1

+50
+5
xF

=
=
=

2000
200
1

xF

=
=
=

1950
195
1

xVP
xA
xF

=
=
=

195/8
195/8
1

195
, 1)
8
195
+ 20
8

,
(xVP , xA , xF ) = ( 195
8
Z = 50

195
8

+ 60

1 = 2701, 25

Profit reduction:
2750 2701, 25 = 48, 75 = 48 43
xVP

xA

xF

s1

s2

s3

xVP

5
8

1
32

3
16

25

s2

7
8

3
32

7
16

25

3
160

5
16

25

7
16

9 3
8

2750

xA

5
8

48 3
4

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

52 / 103

Production Planning at BA
Producing Favaios Bottles Reduced costs
What will be the reduction of the profit if we must produce at least one batch of favaios bottles?

s1
s2
s3
Z

xVP
50
6
3
50

xA
30
5
5
60

xF
50
6
5
20

s1
1
0
0
0

s2
0
1
0
0

s3
0
0
1
0

xVP
1
0
0
0

xA
0
0
1
0

xF

xVP
s2
xA
Z

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16

5
8
78
5
8
48 43

5
16

9 38

2000
300
200
0

25
25
25
2750

We can compute the reduced cost of


xF in a different way by computing the
oportunity cost for producing 1 batch of
favaios bottles:
7
50 16
+ 6 0 + 5 9 38 = 21 78 + 46 78 =
3
68 4

As the revenue of 1 batch of favaios


bottles is 20, the profit will change by
20 68 34 = 48 43

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

53 / 103

General Discussion
Fundamental relationship between shadow prices, reduced
costs, and the problem data.
s1
1
.
.
.
0
0

...
...

...
...

xn
a1n
.
.
.
amn
cn

...
...

sm
0
.
.
.
1
0

At the final tableau:


Z
c1
...

cn

c n+1
=
y1

...
...
...

c n+m
=
ym

s1
.
.
.
sm
Z

x1
a11
.
.
.
am1
c1

...
...

b1
.
.
.
bm
0

Shadow
price
y1
.
.
.
ym

z 0

Recall that, at each iteration of the simplex method, the objective function is transformed by subtracting from
it a multiple of the row in which the pivot was performed. Consequently, the final form of the objective function
could be obtained by subtracting multiples of the original constraints from the original objective function.
Consider first the final objective coefficients associated with the original basic variables: s1 , . . ., sm . Let 1 ,
. . ., m be the multiples of each row that are subtracted from the original objective function to obtain its final
form. Since si appears only in the ith constraint and has a +1 coefficient we should have
c n+i = 0 1i = i = yi . Thus the shadow prices are the multiples i .
Since these multiples can be usedPto obtain every objective coefficient in the final form, the reduced cost c j of
variable xj is given by c j = cj m
. . . n).
i=1 aij yi (j = 1
P
Since c j = 0 for the m basic variables: 0 = cj m
i=1 aij yi (for j basic). This is a system of m equations in m
unknowns that uniquely determines the values of the shadow
P prices yi . Pm
U. PORTO
FEUP
The current value of the objective function is z 0 = m
i=1 bi yi , z 0 =
i=1 bi yi

FACULDADE DE ENGENHARIA
UNIVERSIDADE DO PORTO

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

54 / 103

Variation in the objective coefficients


How much the objective-function coefficients can vary without
changing the values of the decision variables in the optimal solution?

We will make the changes one at a time, holding all other


coefficients and righthand-side values constant.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

55 / 103

Production Planning at BA
Producing Favaios Bottles
Variation in the objective coefficient of xF
Suppose that we increase the objective function coefficient of xF in the original problem
formulation by cF :
In applying the simplex method, multiples of the rows were subtracted from the objective function
to yield the final system of equations. Therefore, the objective function in the final tableau will
remain unchanged except for the addition of cF xF .
s1
s2
s3
Z

xVP
50
6
3
50

xA
30
5
5
60

xF
50
6
5
20 + cF

s1
1
0
0
0

s2
0
1
0
0

s3
0
0
1
0

xVP
1
0
0
0

xA
0
0
1
0

xF

xVP
s2
xA
Z

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16

48 43 +

5
8
78
5
8
cF

5
16
9 38

2000
300
200
0

25
25
25
2750

xF will become a candidate to


enter the basis, only when its
objective-function coefficient is
positive.
The optimal solution remains unchanged as long as:
48 34 + cF 0
cF 48 34
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

56 / 103

Production Planning at BA
Producing Favaios Bottles
Variation in the objective coefficient of xVP
s1
s2
s3
Z

xVP
s2
xA
Z

xVP
s2
xA
Z

xVP
50
6
3
50
+cVP

xA
30
5
5
60

xF
50
6
5
20

s1
1
0
0
0

s2
0
1
0
0

s3
0
0
1
0

xVP
1
0
0
cVP

xA
0
0
1
0

xF

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16

xVP
1
0
0
0
0

xA
0
0
1
0
0

s1
1
32
3
32
3
160
7
16
1
32
cVP

s2
0
1
0
0
0

5
8
78
5
8
48 43

xF
5
8
78
5
8
48 43
58 cVP

5
16

9 38

s3
3
16
7
16

5
16
9 38
3
+ 16
cVP

2000
300
200
0

25
25
25
2750

25
25
25
2750
25cVP

The current solution remains unchanged while:


48 34 85 cVP 0
(cVP 78)
7
1
16
32
cVP 0
(cVP 14)
3
3
9 8 + 16 cVP 0
(cVP 50)
Taking the most limiting inequalities, the bounds on
cVP are:
14 cVP 50
new
14 + 50 cVP
50 + 50
new
36 cVP
100
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

57 / 103

General Discussion
Ranges of the cost coefficients in the optimal solution.
s1
1
.
.
.
0
0

...
...

...
...

xn
a1n
.
.
.
amn
cn

At the final tableau:


Z
c1
...

cn

c n+1

s1
.
.
.
sm
Z

x1
a11
.
.
.
am1
c1

...
...

...
...

sm
0
.
.
.
1
0

b1
.
.
.
bm
0

...

c n+m

z 0

Shadow
price
y1
.
.
.
ym

If xj is a non-basic variable at the final tableau with objective function coefficient cj that was
changed to cjnew = cj + cj , then the current solution remains unchanged so long as the new reduced
P
cost c new
remains nonnegative, that is, c new
= cj + cj m
j
j
i=1 aij yi = c j + cj 0.
The range on the variation of the objective-function coefficient of a nonbasic variable is then given by:
< cj < c j ; ( < cj + cj = cjnew < cj c j ).
If xr is a basic variable at the final tableau
P with objective function coefficient cr that was changed to
crnew = cr + cr , then c new
= cr + cr m
r
i=1 aij yi = c r + cr .
Since xr is a basic variable, c r = 0. So, to recover a canonical form with c new
= 0, we subtract cr
r
times the rth constraint in the final tableau from the final form of the objective function, obtaining new
reduced costs for all nonbasic variables: c new
= c j arj cr , where arj is the coefficient of variable xj in
j
the rth constraint in the final tableau.
For all basic variables c new
= 0 and the current basis remains optimal if c new
0.
j
j
The range on the variation of the objective-function coefficient is:
nc
o
nc
o
U. PORTO
FEUP
Maxj a j | arj > 0 cr Minj a j | arj < 0
rj

(FEUP | DEGI)

FACULDADE DE ENGENHARIA
UNIVERSIDADE DO PORTO

rj

Operations Research

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

58 / 103

Variations on the righthand-side values

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

59 / 103

Production Planning at BA
Producing Favaios Bottles
Variations on the righthand-side values
Varying the righthand-side value of a constraint that is non-binding in the optimal solution:
the warehouse constraint.

s1
s2
s3
Z

xVP
50
6
3
50

xA
30
5
5
60

xF
50
6
5
20

s1
1
0
0
0

s2
0
1
0
0

s3
0
0
1
0

xVP
1
0
0
0

xA
0
0
1
0

xF

xVP
s2
xA
Z

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16

5
8
78
5
8
48 34

5
16
9 38

2000
300 + b2
200
0

We add an amount b2 to the righthand side of the warehouse constraint.


s2 was basic in the initial tableau and is
basic in the optimal tableau.
625+525+60+s2 = 300+b2
s2 = 25 + b2
In order to keep the solution feasible:

25
25 + b2
25
2750

b2new

25 + b2 0
b2 25
= 300 + b2 275
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

60 / 103

Production Planning at BA
Producing Favaios Bottles
Variations on the righthand-side values
Varying the righthand-side value of a constraint that is binding in the optimal solution:
the decoration constraint.

We add an amount b3 to the righthand side


of the decoration constraint.
This is equivalent to decreasing the value of the
slack variable s3 by b3 , that is substituting s3
by s3 b3 in the original problem formulation.
s3 , which is zero in the final solution, is changed
to s3 = b3
3
16 b3
7
16 b3

2516
3
2516
7

xVP = 25
0 that is b3
0 that is b3
s2 = 25
5
xA = 25 + 16
b3 0 that is b3 5 16
2516
b3 80
7
2516
200 + 7 b3new 200 80

s1
s2
s3
Z

xVP
s2

xVP
50
6
3
50

xA
30
5
5
60

xF
50
6
5
20

s1
1
0
0
0

s2
0
1
0
0

s3
0
0
1
0

2000
300
200 + b3
0

xVP
1

xA
0
0

xF
5
8
7
8
5
8
3
48
4

s1
1
32
3
32
3
160
7
16

s2
0

s3
3
16
7
16
5
16
9 3
8

25 3 b3
16
25 7 b3
16
25 + 5 b3
16
2750 9 3 b3
8

xA
Z

1
0
0

b3new

For
< 200 80 (b3 < 80) the basic variable xA
becomes negative.
What variable should enter the basis to take its place?
In order for the new basis to be an optimal solution, the entering variable must be chosen so that the reduced costs are
not allowed to become positive.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

61 / 103

xVP
s2

xVP
1

xA
0

xA
Z

xF
5
8
15
8
5
8
48 3
4

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16
5
16
9 3
8

25 3 b3
16
25 7 b3
16
25 + 5 b3
16
2750 9 3 b3
8

The final tableau for b3new = 120 (b3 = 80) will be:
xVP
s2
xA
Z

xVP
1

xA
0

xF
5
8
7
8
5
8
48 3
4

s1
1
32
3
32
3
160
7
16

s2
0
1
0
0

s3
3
16
7
16
5
16
9 3
8

40
60
0
2480

For b3new < 120 the basic variable xA becomes negative.


What variable should enter the basis to take its place?
In order for the new basis to be an optimal solution, the entering variable must be chosen so that the reduced
costs are not allowed to become positive.
Regardless of which variable enters the basis, the entering variable will be isolated in row 3 of the final tableau
to replace xA , which leaves the basis.
To isolate the entering variable, we must perform a pivot operation, and a multiple, say t, of row 3 in the final
tableau will be subtracted from the objective-function row.
xVP
s2
xA
Z

xVP
1

xA
0

0
t

xF
5
8
7
8
5
8
48 3
4
t 5
8

s1
1
32
3
32
3
160
7
16
+t 3
160

s2
0
1
0
0

s3
3
16
7
16
5
16
9 3
8
t 5
16

40
60
0
2480
t 0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

62 / 103

xVP
s2
xA
Z

xVP
1
0
0
0

xA
0
0
1
0
t

xF
5
8
78
5
8
48 34
t 58

+t

s1
1
32
3
32
3
160
7
16
3
160

s2
0
1
0
0

s3
3
16
7
16
5
16

9 83
5
t 16

40
60
0
2480
t 0

t 0 that is t 0
48 43 t 58 0 that is t 288
5
7
3
16
+ t 160
0 that is t 70
3
5
9 38 t 16
0 that is t 30
0 t 70
3
Since the coefficient of s1 is most constraining on t, s1 will enter the basis. Note that the range
on the righthand-side value and the variable transitions that would occur if that range were
exceeded by a small amount are easily computed. However, the pivot operation actually
introducing s1 into the basis and eliminating xA need not be performed.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

63 / 103

General Discussion
Variations in the Righthand-Side values.
s1
1
.
.
.
0
0

...
...

...
...

xn
a1n
.
.
.
amn
cn

At the final tableau:


x1
...
s1
a11
...
.
.
.
.
.
.
am1
...
sm
Z
c1
...

xn
a1n
.
.
.
amn
cn

s1
11
.
.
.
m1
c n+1

...
...

s1
.
.
.
sm
Z

x1
a11
.
.
.
am1
c1

...
...

...
...

...
...

sm
0
.
.
.
1
0

b1
.
.
.
bm
0

sm
1m
.
.
.
mm
c n+m

b1
.
.
.
bm
z 0

As this is a canonical form, aij and ij in the final tableau will be structured so that one basic variable is
isolated in each contraint.
We can change the coefficient bk in the kth righthand-side by bk with all the other data held fixed, simply by
substituting sk bk for sk in the initial tableau. To see how this change affects the updated righthand-side
coefficients, we make the same substitution in the final tableau. The terms ik sk become
ik (sk bk ) = ik sk ik bk . As ik bk is a constant, we move it to the righthand side to give modified
righthand-side values b i + ik bk for (i = 1, 2, . . . , m).
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

64 / 103

As long as all of these values are nonnegative, the basis specified by the final tableau remains
optimal, since the reduced costs have not been changed. Consequently, the current basis is
optimal
+ ik bk 0 forn(i = 1, 2, . . . , o
m) or equivalently,
n whenever b i o

Maxi

b i
ik

| ik > 0

bk Mini

b i
ik

| ik < 0

When bk reaches either its upper or lower bound any further increase (or decrease) in its value
makes one of the updated righthand sides, say b r + rk bk negative. At this point the basic
variable in row r leaves the basis, and we must pivot in row r of the final tableau to find the
variable to be introduced in its place. Since pivoting subtracts a multiple t of the pivot row from
the objective equation, the new objective equation has coefficients c j tarj (j = 1, 2, . . . , n).
For the basis to be optimal, each of these coefficients must be nonpositive. Since c j = 0 for the
basic variable being dropped and since its coefficient in costraint r is arj = 1, we must have t 0.
For any nonnegative t, the updated coefficient c j tarj for any other variable remains nonpositive
if arj 0.nConsequently
o we need only to consider arj < 0, and t is given by:
c

t = Minj a j | arj < 0


rj
The index u giving this minimum has c u taru = 0, and the corresponding variable xu can
become the new basic variable in row r by pivoting on aru . Note that the pivot is made on a
negative coefficient.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

65 / 103

Alternative optimal solutions


As in the case of the objective function and righthand-side ranges,
the final tableau of the linear program tells us something
conservative about the possibility of alternative optimal solutions.

If all reduced costs of the nonbasic variables are strictly negative


(positive) in a maximization (minimization) problem, then there is
no alternative optimal solution, because introducing any variable
into the basis at a positive level would reduce (increase) the value of
the objective function.

If one or more of the reduced costs are zero, there may exist
alternative optimal solutions.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

66 / 103

Alternative shadow prices


Independent of the question of whether or not alternative optimal
solutions exist in the sense that different values of the decision
variables yield the same optimal value of the objective function,
there may exist alternative optimal shadow prices.

If all righthand-side values in the final tableau are positive, then


there do not exist alternative optimal shadow prices.

If one or more of these values are zero, then there may exist
alternative optimal shadow prices.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

67 / 103

Alternative Shadow Prices


Example

xVP

xA

xF

s1

s2

s3

xVP

5
8

1
32

3
16

40

s2

78

3
32

7
16

60

xA

5
8

3
160

5
16

48 34

7
16

9 38

2480

Since the righthand-side value in row 3 is zero, it is possible to take xA (basic variable in row 3)
out of the basis as long as there is a variable to introduce into the basis.
The candidates to be introduced
 7 into
 the basis are xF , s1 and s3 , the one that corresponds to:
o
nc
16
j
s1 will enter the basis.
Minj a | arj < 0 = Min
3
rj

160

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

68 / 103

Duality in Linear Programming


based on:
Bradley, Hax, and Magnanti; Applied
Mathematical Programming, Addison-Wesley,
1977
Chapter 4, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6 and 4.7

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

69 / 103

Duality in Linear Programming

In the preceding chapter on sensitivity analysis, we saw that the shadow-price interpretation of the
optimal simplex multipliers is a very useful concept.
First, these shadow prices give us directly the marginal worth of an additional unit of any of the
resources.
Second, when an activity is priced out using these shadow prices, the opportunity cost of
allocating resources to that activity relative to other activities is determined.
Duality in linear programming is essentially a unifying theory that develops the relationships
between a given linear program and another related linear program stated in terms of variables
with this shadow-price interpretation.
The importance of duality is twofold:
First, fully understanding the shadow-price interpretation of the optimal simplex multipliers can
prove very useful in understanding the implications of a particular linear-programming model.
Second, it is often possible to solve the related linear program with the shadow prices as the
variables in place of, or in conjunction with, the original linear program, thereby taking advantage
of some computational efficiencies.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

70 / 103

Duality in Linear Programming


Learning Objectives
Write the dual problem of a linear programming problem.
Understand the:
weak duality property,
optimality property,
unboundedness property,
strong duality property.
Verify that the complementary slackness conditions hold for a given problem.
Apply the dual simplex method.
Apply the parametric primal-dual algorithm.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

71 / 103

A Preview of Duality

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

72 / 103

Production Planning at BA

The factory of Barbosa & Almeida (BA) in Avintes produces glass containers through mould
injection.
BA recently won two new clients and intends to assign this production to one of its furnaces. The
orders were of bottles of Sandeman Ruby Port (75cl), one liter bottles of olive oil Oliveira da Serra
and one liter bottles of Favaios Moscatel. The customers buy all the bottles that BA can produce.
Due to differences in the production (number of cavities and different cycle times), each batch of
portwine bottles takes 50 hours to produce, whereas each batch of oil bottles requires only 30
hours and a batch of favaios takes 50 hours to produce. There are a total of 2000 hours available
at the oven.
Moreover we must also consider the capacity available in the decoration sector (e.g. labels,
packaging), which is 200 hours. The portwine bottles spend 3 hours per batch, the olive oil
bottles 5 hours per batch and the favaios bottles also 5 hours per batch.
Barbosa & Almeida wants to maximize the profit from these two orders, knowing that the profit
per batch is 50e 60e and 20e, respectively.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

73 / 103

Production Planning at BA
Decision variables
xVP Number of batches of Vinho do Porto Ruby Sandeman bottles to produce;
xA Number of batches of Azeite Oliveira da Serra bottles to produce;
xF Number of batches of Favaios bottles to produce.

Objective:
max

Z = 50xVP + 60xA + 20xF

Subject to:
50xVP

+30xA

+50xF 2000

3xVP

+5xA

+5xF 200

xVP ,

xA ,

(time in the oven)


(capacity in the decoration sector)

xF 0

In this model xVP , xA and xF may not be integer.


U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

74 / 103

Production Planning at BA
Shadow prices

xA
30
5
60

xF
50
5
20

sO
1
0
0

sD
0
1
0

At the final tableau:


xVP
xA

xF

sO

sD

sO
sD
Z

xVP
50
3
50

2000
200
0

xVP

5
8

1
32

3
16

25

xA

5
8

3
160

5
16

25

48 34

7
16

9 38

2750

The shadow prices, yO for the oven capacity and yD for the decoration capacity can be determined from the final
tableau as the negative of the reduced
costs associated with the slack variables
sO and sD .
7
Thus these shadow prices are yO = 16
3
and yD = 9 8

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

75 / 103

Economic properties of the shadow prices associated with


the resources
s1
1
.
.
.
0
0

...
...

...
...

xn
a1n
.
.
.
amn
cn

At the final tableau:


Z
c1
...

cn

c n+1

s1
.
.
.
sm
Z

x1
a11
.
.
.
am1
c1

...
...

...
...

sm
0
.
.
.
1
0

b1
.
.
.
bm
0

...

c n+m

z 0

Shadow
price
y1
.
.
.
ym

Reduced costs in terms of shadow prices:


c j = cj

Pm

i=1 aij yi

(j = 1 . . . n)

aij is the amount of resource i used per unit of activity j, and yi is the imputed value of that
resource. P
The term m
i=1 aij yi is the total value of the resources used per unit of activity j and is thus the
marginal resource cost per unit of activity j.
If we think of the objective coefficients cj as being marginal revenues, the reduced costs
P
c j = cj m
i=1 aij yi (j = 1 . . . n)
are simply net marginal revenues (i.e., marginal revenue minus marginal cost).

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

76 / 103

Production Planning at BA
Reduced cost (net marginal revenue) for each type of
bottle (decision variable)
xVP
xA
sO
50
30
sD
3
5
Z
50
60
At the final tableau:
xVP
xA

xF
50
5
20

sO
1
0
0

sD
0
1
0

xF

sO

sD

2000
200
0

xVP

5
8

1
32

3
16

25

xA

5
8

3
160

5
16

25

48 34

7
16

9 38

2750

For the basic variables the reduced costs are


zero.
The marginal revenue is equal to the
marginal cost for these activities.
For all nonbasic variables the reduced costs
are negative.
The marginal revenue is less than the
marginal cost for these activities, so they
should not be pursued.

7
.
Shadow price for the oven capacity: yO = 16
Shadow price for the decoration capacity: yD = 9 38 .
Net marginal P
revenue for the production of portwine bottles:
7
3
c VP = cVP m
i=1 aiVP yi = 50 (50 16 + 3 9 8 ) = 0
Net marginal
revenue
for
the
production
of
azeite
bottles:
P
7
3
c A = cA m
i=1 aiA yi = 60 (30 16 + 5 9 8 ) = 0
Net marginal
revenue
for
the
production
of
favaios
bottles:
P
7
3
3
c F = cF m
i=1 aiF yi = 20 (50 16 + 5 9 8 ) = 48 4
(FEUP | DEGI)

Operations Research

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

77 / 103

Production Planning at BA
Shadow prices (opportunity costs) associated with the
consumption of the resources (constraints)
xVP
xA
sO
50
30
sD
3
5
Z
50
60
At the final tableau:
xVP
xA

xF
50
5
20

sO
1
0
0

sD
0
1
0

xF

sO

sD

2000
200
0

xVP

5
8

1
32

3
16

25

xA

5
8

3
160

5
16

25

48 43

7
16

9 38

2750

If we value the total resources at the shadow prices, we find their value is exactly equal to the
optimal value of the objective function:
2000

7
16

+ 200 9 38 = 2750

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

78 / 103

Production Planning at BA
Can shadow prices be determined directly?
For a maximization decision problem, the shadow prices must satisfy the requirement that
marginal revenue be less than or equal to marginal cost for all activities.
The shadow prices must be nonnegative since they are associated with less-than-or-equal-to
constraints in a maximization decision problem.
Imagine that BA does not own its productive capacity but has to rent it. In this case the
shadow prices could be seen as rent rates.
Objective:

Objective:

min V = 2000yO + 200yD

max Z = 50xVP + 60xA + 20xF

Subject to:

Subject to:
50xVP + 30xA + 50xF

2000

3xVP + 5xA + 5xF

200

xVP , xA , xF

50yO + 3yD

50

30yO + 5yD

60

50yO + 5yD

20

yO , yD

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

79 / 103

Production Planning at BA
Primal and Dual Decision Problems
DUAL Decision Problem:

PRIMAL Decision Problem:

Objective:

Objective:

min V = 2000yO + 200yD

max Z = 50xVP + 60xA + 20xF

Subject to:

Subject to:
50xVP + 30xA + 50xF

2000

3xVP + 5xA + 5xF

200

xVP , xA , xF
Optimal solution:
xVP = 25
xA = 25
xF = 0
Z = 2750
with shadow prices:
7
yO = 16
yD = 9 38
(FEUP | DEGI)

50yO + 3yD

50

30yO + 5yD

60

50yO + 5yD

20

yO , yD

Optimal solution:
7
yO = 16
yD = 9 38
V = 2750
with shadow prices:
xVP = 25
xA = 25
xF = 0
Operations Research

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

80 / 103

Production Planning at BA
Requirements of the optimality conditions of the Simplex
Method
The reduced costs of the basic
variables are zero.
If a decision variable of the primal is positive, then the
corresponding constraint in the dual must hold with
equality.

The variables with negative


reduced costs are nonbasic
variables (zero valued)

If b
xVP 0 then c VP = 50 (50b
yO + 3b
yD ) = 0
If b
xA 0 then c A = 60 (30b
yO + 5b
yD ) = 0

If c F = 20 (50b
yO + 5b
yD ) < 0 then b
xF = 0

If a constraint holds as a strict inequality, then the


corresponding decision variable must be zero.

If a shadow price is positive,


then the corresponding
constraint must hold with
equality.
(FEUP | DEGI)

If b
yO > 0 then 50b
xVP + 30b
xA + 50b
xF = 2000
If b
yD > 0 then 3b
xVP + 5b
xA + 5b
xF = 200

Operations Research

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

81 / 103

Complementary Slackness Conditions

If a primal variable is
positive,
then its corresponding
(complementary) dual
constraint holds with
equality.

If a dual constraint holds


with strict inequality,
then its corresponding
(complementary) primal
variable must be zero.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

82 / 103

Finding the dual in general


Definition of the dual problem

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

83 / 103

PRIMAL is a maximization problem

PRIMAL

DUAL

Objective:

Objective:

max Z =
n
X
cj xj

min V =
0

m
X

j=1

0
bi yi

m
X

i=m0 +1

i=m00 +1

00

m
X

bi

(i = 1, 2, . . . , m )

m
X
i=1

aij xj

bi

00

aij yi +

m
X
i=m0 +1

0
aij yi

(i = m , 2, . . . , m )

yi
0
yi
00
yi

00

aij xj

= bi

(i = m , 2, . . . , m)

xj

(j = 1, 2, . . . , n)

00

aij yi

cj

(j = 1, 2, . . . , n)

(i = 1, . . . , m )

i=m00 +1

j=1
n
X

00

bi yi

Subject to:
aij xj

j=1
n
X

bi yi +

i=1

Subject to:
n
X

00

m
X

j=1

00

(i = m + 1, . . . , m )

(i = m

00

+ 1, . . . , m)

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

84 / 103

PRIMAL is a minimization problem

PRIMAL

DUAL

Objective:

Objective:

min Z =
n
X
cj xj

max V =
0

m
X

j=1

0
bi yi

m
X

i=m0 +1

i=m00 +1

00

m
X

bi

(i = 1, 2, . . . , m )

m
X
i=1

aij xj

bi

00

aij yi +

m
X
i=m0 +1

0
aij yi

(i = m , 2, . . . , m )

yi
0
yi
00
yi

00

aij xj

= bi

(i = m , 2, . . . , m)

xj

(j = 1, 2, . . . , n)

00

aij yi

cj

(j = 1, 2, . . . , n)

(i = 1, . . . , m )

i=m00 +1

j=1
n
X

00

bi yi

Subject to:
aij xj

j=1
n
X

bi yi +

i=1

Subject to:
n
X

00

m
X

j=1

00

(i = m + 1, . . . , m )

(i = m

00

+ 1, . . . , m)

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

85 / 103

Summary of the correspondences between PRIMAL and


DUAL decision problems

Primal (Maximize)
ith constraint
ith constraint
ith constraint =
jth variable 0
jth variable 0
jth variable unrestricted

Dual (Minimize)
ith variable 0
ith variable 0
ith variable unrestricted
jth constraint
jth constraint
jth constraint =

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

86 / 103

The fundamental duality


properties

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

87 / 103

Weak duality property

DUAL

PRIMAL

Objective:

Objective:
max Z

Subject to:
n
X
aij xj

min V

Pn

j=1 cj xj

bi

(i = 1, 2, . . . , m)

Subject to:
m
X
aij yi

(j = 1, 2, . . . , n)

yi

j=1

xj

Pn

j=1 cj x j

Pm

i=1

Pm

i=1

bi yi

cj

(j = 1, 2, . . . , n)

(i = 1, . . . , m)

i=1

bi y i

If x j , j = 1, 2, . . . , n is a feasible solution to
the primal problem
and y i , i = 1, 2, . . . , m is a feasible solution
to the dual problem.

DUAL feasible

V decreasing

PRIMAL feasible

Z increasing

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

88 / 103

Optimality property

DUAL

PRIMAL

Objective:

Objective:
max Z
Subject to:
n
X
aij xj

min V

Pn

j=1 cj xj

bi

(i = 1, 2, . . . , m)

Subject to:
m
X
aij yi

(j = 1, 2, . . . , n)

yi

j=1

xj

Pm

i=1

bi yi

cj

(j = 1, 2, . . . , n)

(i = 1, . . . , m)

i=1

If b
xj , j = 1, 2, . . . , n is a feasible solution to the primal problem
and ybi , i = 1, 2, . . . , m is a feasible
solution
to the dual problem
Pn
Pm
and j=1 cj b
xj = i=1 bi ybi
then b
xj , j = 1, 2, . . . , n is an optimal solution for the primal problem
and ybi , i = 1, 2, . . . , m is an optimal solution for the dual problem
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

89 / 103

Unboundedness Property

If the PRIMAL problem has


an unbounded solution
then the DUAL problem is
infeasible

If the DUAL problem has an


unbounded solution
then the PRIMAL problem is
infeasible

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

90 / 103

Strong Duality Property

If the PRIMAL problem has a


finite optimal solution,
then so does the DUAL
problem
and these two values are
equal

If the DUAL problem has a


finite optimal solution,
then so does the PRIMAL
problem
and these two values are
equal

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

91 / 103

The complementary slackness

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

92 / 103

Complementary Slackness Property

In an optimal solution of a linear program:

For the PRIMAL linear program


posed as a maximization problem with
less-than-or-equal-to constraints, this
means:

If the value of the dual variable


(shadow price) associated with a
constraint is nonzero, then that
constraint must be satisfied with
equality.

If ybi > 0, then

If a constraint is satisfied with


strict inequality, then its
corresponding dual variable must be
zero.

If

Pn

xj
j=1 aij b

Pn

xj
j=1 aij b

= bi

< bi then ybi = 0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

93 / 103

Complementary Slackness Property

In an optimal solution of a linear program:

For the DUAL linear program posed as


a minimization problem with greaterthan-or-equal-to
constraints,
this
means:

If the value of the dual variable


(shadow price) associated with a
constraint is nonzero, then that
constraint must be satisfied with
equality.

If b
xj > 0, then

If a constraint is satisfied with


strict inequality, then its
corresponding dual variable must be
zero.

If

Pm

bi
i=1 aij y

Pm

bi
i=1 aij y

= cj

< cj then b
xj = 0

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

94 / 103

Optimality conditions

If b
xj , j = 1, 2, . . . , n is a feasible solution to the
PRIMAL problem
and ybi , i = 1, 2, . . . , m, is a feasible solution to the
DUAL problem,
then they are optimal solutions to these problems if,
and only if, the complementary-slackness conditions
hold for both the primal and the dual problems.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

95 / 103

The dual Simplex Algorithm

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

96 / 103

The DUAL Simplex Algorithm

Solving the primal problem, moving through


solutions (simplex tableaux) that are dual feasible
but primal unfeasible.a
a

Different from solving the DUAL problem with the (PRIMAL) simplex method

PRIMAL feasible: b i 0
DUAL feasible: c i 0

An optimal solution is a solution that is both primal


and dual feasible.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

97 / 103

DUAL Simplex Algorithm


Initialization: problem in canonical form with all c j 0.
Optimality test :
if b i 0 for all i = 1, 2, . . . , m, then stop optimal solution found;
else:
Iterate :
Choose the variable to leave the basis by4 :


b r = mini b i |b i < 0 .
If arj 0 for j = 1, 2, . . . , n, then stop the PRIMAL problem is infeasible
(DUAL is unbounded);
else choose the variable to enter the basis by5 :
nc
o
cs
= mini a j |arj < 0 .
a
rs

rj

Replace the basic variable in row r with variable in column s and reestablish
the canonical form (i.e. pivot on the coefficient ars ).
Return to the optimality test.

4
5

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO

find the most promissing candidate for an improvement in feasibility


guarantee that c s 0 in each iteration
(FEUP | DEGI)

Operations Research

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

2012/2013

98 / 103

The DUAL Simplex Algorithm An example

x1
1
2
3

x2
1
-3
1


x3
1
0
0

x4
0
1
0

x1

x2

x3

x4

x3

13

31

13

x2

2
3

31

2
3

73

31


2
3

x4
x2
Z

x1
1
1
2

x2
0
1
0

x3
3
1
1

x4
1
0
0

x3
x4
Z

1
2
0

x4 leaves
n the basis
o because:
mini b i |b i < 0 = min {1, 2} = 2
x2 enters
n c the basisobecause:n
o
1
minj a j |arj < 0 = min 3
= 13
2 , 3
rj

1
1
1

x3 leaves
o because:
n the basis


mini b i |b i < 0 = min 13 = 31
x4 enters the basis because:

o
nc
7 1
3 ,
3
= min {7, 1} = 1
minj a j |arj < 0 = min
1
1
rj

All the b i are 0.


Optimal solution:
(x1 , x2 , x3 , x4 ) = (0, 1, 0, 1) and Z = 1

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

99 / 103

Parametric PRIMAL-DUAL
Algorithm
Primal-dual algorithms are useful when
simultaneous changes of both righthand-side and
cost coefficients are imposed on a previous
optimal solution, and a new optimal solution is
to be recovered.

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

100 / 103

Parametric PRIMAL-DUAL Algorithm an example I


Objective:
=

2x1 + 3x2

x1 + x2

x1 + 2x2

x1 3x2

1
2
1

x1 , x2

max Z
Subject to:

This example can easily be put in canonical


form by addition of slack variables.

x3
x4
x5
Z

x1
1
1
1
2

x2
1
2
3
3

x3
1
0
0
0

x4
0
1
0
0

x5
0
0
1
0

x3
x4
x5
Z

x1
1
1
1
2

x2
1
2
3
3

x3
1
0
0
0

x4
0
1
0
0

x5
0
0
1
0

6
21
1
0

6
12 +
1 +
0

However, neither primal feasibility nor primal


optimality conditions will be satisfied.

We will arbitrarily consider the example as a


function of the parameter .
If we choose large enough, i.e. 3,
this system of equations satisfies the primal
feasibility and primal optimality conditions.
U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

101 / 103

Parametric PRIMAL-DUAL Algorithm an example II


The idea of the parametric primal-dual algorithm is to initially choose a large so that the primal
feasibility and primal optimality conditions are satisfied, and attempt to reduce to zero through
a sequence of primal and dual pivot operations, depending on where unfeasibility appears.

x3
x4
x5
Z

x1
1
1
1
2

x2
1
2
3
3


x3
1
0
0
0

x4
0
1
0
0

x5
0
0
1
0

6
12 +
1 +
0

For < 3 the solution is no longer optimal (c 2 > 0) and a primal simplex pivot must be performed to
introduce x2 into the basis. To determine the variable to leave the basis we use the minimum-ratio rule of the
primal simplex method:
br
ars

= mini

x3
x2
x5
Z

bi
ais

o 
|ais > 0 =

1
6 2 +3
1,
2

x1

x4
0
1
0
3
1
2 + 2

3
2
12
12
12 12

x2
1
1
0
0

x3
1
0
0
0


=

b2
a22

x5
0
0
1
0

(x4 leaves the basis).

6 41 12
41 + 12
47 + 52
(3 )( 14 + 12 )

7
7
This tableau is dual feasible for 10
3. For < 10
we must perform a dual simplex iteration where x5
7
U. PORTO
leaves the basis (for = 10
, 74 + 25 = 0) and x1 enters the basis.
FEUP

FACULDADE DE ENGENHARIA
UNIVERSIDADE DO PORTO

DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

102 / 103

Parametric PRIMAL-DUAL Algorithm an example III

After the pivot, the new canonical form is represented in the next tableau.
x3
x2
x1
Z

x1
0
0
1
0

x2
0
1
0
0

x3
1
0
0
0

x4
4
1
3
3

x5
3
1
2
1

1 + 7
3
2 2
7
2 5
(3 )( 14 + 12 ) + ( 12 + 21 )( 27 5)

As we continue to decrease to zero, the optimality conditions remain satisfied. Thus the optimal final tableau
for this example is given by setting equal to zero.
x3
x2
x1
Z

x1
0
0
1
0

x2
0
1
0
0

x3
1
0
0
0

x4
4
1
3
3

x5
3
1
2
1

1
3
2
7
2
5
2

U. PORTO

FACULDADE DE ENGENHARIA
FEUP UNIVERSIDADE
DO PORTO
DEPARTAMENTO DE ENGENHARIA E GESTO INDUSTRIAL

(FEUP | DEGI)

Operations Research

2012/2013

103 / 103

You might also like