Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Mtodos Cuantitativos
Duality
Mtodos Cuantitativos
Duality
Every LP problem has a twin problem
associated with it. One problem is called
primal, while the other is called dual.
These problems possess very closely related
properties so that the optimal solution of
one problem can yield complete information
about the optimal solution of the other
problem!
Mtodos Cuantitativos
Duality
In certain cases, these relationships may
prove useful in reducing the computational
effort associated with solving LP problems
Mtodos Cuantitativos
Duality
Primal
Dual
Max Zx = cj x j
Min Z y = bi yi
j =1
i =1
s.t.
a x
j =1
ij j
bi , i =1,2,..,m
s.t.
a y c , j = 1,2,..,n
i =1
x j 0, j=1,2,...,n
Mtodos Cuantitativos
ij i
yi 0, i = 1,2,...,m
EXAMPLE
Primal:
MAX Z= 45X1 + 17X2 + 55X3
st:
X1 + X2 + X3 200
9X1 + 8X2 + 10X3 5000
10X1+ 7X2 + 21 X3 4000
Xj 0
Mtodos Cuantitativos
Dual:
MAX Z= 45X1 + 17X2 + 55X3
st:
X1 + X2 + X3 200
9X1 + 8X2 + 10X3 5000
10X1+ 7X2 + 21 X3 4000
Xj 0
Mtodos Cuantitativos
st:
Y1 + 9Y2 + 10Y3 45
Y1 + 8Y2 + 7Y3 17
Y1 + 10Y2 + 21Y3 55
Yj 0
: y1
2 x1 + 3 x2 45
: y2
5 x1 2 x2 20
: y3
x2 30
: y4
x1 , x2 0
Example
Dual
Min Z y = 60 y1 + 45 y2 + 20 y3 + 30 y4
s.t.
y1 + 2 y2 + 5 y3
5 : x1
9 y1 + 3 y2 2 y3 + y4 6 : x2
y1 , y2 , y3 , y4 0
Mtodos Cuantitativos
10
Primal Variables
s.t. x1 + 9 x2 60
Dual Variables
Primal
Max Z x = 5 x1 + 6 x2
: y1
: y2
: y3
: y4
Dual Variables
Example
x1 , x2 , s1 , s2 , s3 , s4 0
s.t .
y1 + 2 y 2 + 5 y 3
=5
: x1
9 y1 + 3 y 2 2 y 3 + y 4 s 2 + A2 = 6
: x2
Mtodos Cuantitativos
s1 + A1
Primal
Variables
y1 , y2 , y3 , y4 , s1 , A1 , s2 , A2 0
11
Observations
Notice in the preceding example, the dual
problem has fewer constraints than the
primal, and may be computationally more
efficient to solve than the primal
Computational difficulty in LPs is mainly
associated with the number of constraints
rather than the number of variables
Mtodos Cuantitativos
12
Primal-Dual Relationships
The optimal solution of the primal (dual)
gives, directly the optimal solution of the
dual (primal)
The following two rules are used to
determine the optimal solution of one
problem from the optimal (simplex)
solution of the other problem
Mtodos Cuantitativos
13
Rule 1
If the dual variable corresponds to a slack
holgura
starting variable in the primal problem, its
optimum value is given directly by the
coefficient of this slack variable in the
optimal Z-equation row
Mtodos Cuantitativos
14
Example
Max Z x = 5x1 + 6 x2
s. t . x1 + 9 x2 + s1 = 60
2 x1 + 3x2 + s2 = 45
5x1 2 x2 + s3 = 20
x2 + s4 = 30
: y1
: y2
: y3
: y4
Dual Variables
x1 , x2 , s1 , s2 , s3 , s4 0
Mtodos Cuantitativos
15
Z x1 x2
Z 1 0 0
x2 0 0 1
s2 0 0
x1 0 1
s4 0 0
Mtodos Cuantitativos
Dual variables
y2
y3
y4
s1
.85
.11
s2 s3
0 .83
0 .02
0 .41 1 .32
0 .04 0 .19
0 .11 0 .02
M. En C. Eduardo Bustos Farias
s4
b
0 67.66
0 596
.
0 14.36
0 638
.
1 24.04
16
Rule 2
If the dual variable corresponds to an
artificial starting variable in the primal
problem, its optimal value is given by the
coefficient of this artificial variable in the
optimal Z-equation row of the simplex
tableau, ignoring any Big M term
Mtodos Cuantitativos
17
Example
Max Z 'y = 60 y1 45 y 2 20 y 3 30 y 4 MA1 MA2
s. t .
Mtodos Cuantitativos
y1 + 2 y 2 + 5 y 3
s1 + A1
9 y1 + 3 y 2 2 y 3 + y 4 s2 + A2
y1 , y 2 , y 3 , y 4 , s1 , A1 , s2 , A2 0
=5
=6
: x1
: x2
18
Primal Variables
1
0
0
y2
0 14.36
0 .32
1 .40
Mtodos Cuantitativos
y3
0
1
0
y4
s1
A1
x2
s2
A2
.
.
67.66
M 596
24.04 6.38 M 6.38 596
.19
.02
.
.02 .19
.02
083
.11
.04
.04
.11
.11
.
085
19
Sensitivity Analysis
Mtodos Cuantitativos
20
Sensitivity Analysis
Coefficients in an LP formulation are
assumed to be known with absolute
certainty!
Sensitivity analysis provides an approach
for studying the effect upon the optimal
solution of variations in the cost/profit
coefficients in the objective function, or in
the resource availabilities of the constraints.
Mtodos Cuantitativos
21
General Form of a
Linear Programming (LP) Problem
MAX (or MIN): c1X1 + c2X2 + + cnXn
Subject to:
22
Sensitivity Problem 1
A Change in objective function coefficients
The goal of this sensitivity analysis is to
determine the range of variation in each of
the objective function coefficients that will
corner
point
of
keep
the
current
optimum
mantendr
the feasible solution space unchanged.
Mtodos Cuantitativos
23
24
x2 60
50
3x1 + 5 x2 150
5 x1 + 4 x2 100
40
30
Optimal Solution
20
Max Z = 138.5
x1=30.77, x2=11.54
10
10 20
4
Mtodos Cuantitativos
30 40
3
50
60
8 x1 + 4 x2 80
x1 0, x2 0
x1
2
25
Example
In the previous example, if p2 is held
constant at 4, we can determine the
permissible range values on p1 so that the
current solution remains optimal as follows:
3
5
p1
5
4
4
12
p1 5
5
Mtodos Cuantitativos
26
Example
Similarly, if p1 is held constant at 3, then
or
so
Mtodos Cuantitativos
3
3
5
p2
5
4
p2
5
4
3
3
5
12
p2 5
5
M. En C. Eduardo Bustos Farias
27
Sensitivity Problem 2
How much is a resource unit worth?
vale
Mtodos Cuantitativos
28
Sensitivity Problem 2
This amounts to changing the availability of
a resource. The results are given as
predetermined ranges of the r.h.s. within
which the optimum objective value will
increase or decrease at a given, constant
rate.
Mtodos Cuantitativos
29
3 x1 + 5 x2 150
30
Mtodos Cuantitativos
Shadow Prices
Goods (resources) having positive shadow
prices are called scarce goods
Goods (resources) having zero shadow
prices are called free goods
Mtodos Cuantitativos
32
Blending Example
Max Z x = 3x1 + 4 x2 MA1 MA2
s. t . 5x1 + 4 x2 + s1
= 200
: y1
3x1 + 5x2 + s2
= 150
: y2
5x1 + 4 x2 s3 + A3 = 100
: y3
8 x1 + 4 x2 s4 + A4 = 80
: y4
x1 , x2 , s1 , s2 , s3 , A3 , s4 , A4 0
Mtodos Cuantitativos
Dual Variables
33
y2
Z
x1
s3
Z x1 x2
1 0 0
0 1 0
0 0 0
s1
.23
.38
1
s2
.62
.31
0
s4
x2
0
0
2.15 .92
.23 .38
0
0
0
1
y3
y4
s3 A3
0 M
0 0
1 1
s4
0
0
0
A4
b
M 138.46
0 30.77
0
100
0
0
1
0
1 212.3
.
0 1154
0
0
Shadow Prices
(ignore Ms)
Mtodos Cuantitativos
34
Blending Example
Max Z 'y = 200 y1 150 y 2 + 100 y 3 + 80 y 4 MA1 MA2
s. t .
Mtodos Cuantitativos
5 y1 + 3 y 2 5 y 3 8 y 4 s1 + A1
4 y1 + 5 y 2 4 y 3 4 y 4 s2 + A2
y1 , y 2 , y 3 , y 4 , s1 , A1 , s2 , A2 0
=3
=4
: x1
: x2
35
Primal Variables
1
0
0
0
1
0
y3
y4
s1
A1
x2
s2
A2
.
.
.
.
.
13846
M 3077
M 1154
0 100 212.31 3077
1154
.
.38
.23
.
.38
.23
0 1 215
023
.92
.31
.38
.
.31
.38
1 0
062
Mtodos Cuantitativos
36
Mtodos Cuantitativos
37
38
39
40
Mtodos Cuantitativos
41
42
Mtodos Cuantitativos
43
Mtodos Cuantitativos
44
45
Mtodos Cuantitativos
} profit
} pumps
} labor
} tubing
} non-negativity
46
Answer Report
Microsoft Excel 9.0 Answer Report
Worksheet: [Solver Class Examples Solved.xls]Blue Ridge
Report Created: 7/17/2005 2:56:10 PM
Original Value
$66,100
Final Value
$66,100
Adjustable Cells
Cell
Name
Original Value
$B$5 Number to Make Aqua-Spas
122
$C$5 Number to Make Hydro-Luxes
78
Final Value
122
78
Constraints
Cell
Name
$D$10 - Labor Req'd Used
$D$11 - Tubing Req'd Used
$D$9 - Pumps Req'd Used
Mtodos Cuantitativos
Cell Value
Formula
Status Slack
1566 $D$10<=$E$10 Binding
0
2712 $D$11<=$E$11 Not Binding 168
200 $D$9<=$E$9
Binding
0
M. En C. Eduardo Bustos Farias
47
Sensitivity Report
Microsoft Excel 9.0 Sensitivity Report
Worksheet: [Solver Class Examples Solved.xls]Blue Ridge
Report Created: 7/17/2005 2:56:10 PM
Adjustable Cells
Final
Cell
Name
Value
$B$5 Number to Make Aqua-Spas
122
$C$5 Number to Make Hydro-Luxes
78
Reduced
Cost
Constraints
Cell
Name
$D$10 - Labor Req'd Used
$D$11 - Tubing Req'd Used
$D$9 - Pumps Req'd Used
Mtodos Cuantitativos
48
Mtodos Cuantitativos
49
Mtodos Cuantitativos
50
Mtodos Cuantitativos
51
Mtodos Cuantitativos
52
Mtodos Cuantitativos
53
Mtodos Cuantitativos
54
produce any?
A: $320 - $200*1 - $16.67*7 - $0*13 = $3.31 = Yes!
Q: What is the maximum amount of labor TyphoonLagoons could require and still be profitable?
A: We need $320 - $200*1 - $16.67*L3 - $0*13 >=0
The above is true if L3 <= $120/$16.67 = $7.20
Mtodos Cuantitativos
55
Key Points - I
The shadow prices of resources equate the
marginal value of the resources consumed with the
marginal benefit of the goods being produced.
Resources in excess supply have a shadow price
(or marginal value) of zero.
Mtodos Cuantitativos
56
Key Points-II
The reduced cost of a product is the difference
between its marginal profit and the marginal value
of the resources it consumes.
Products whose marginal profits are less than the
marginal value of the goods required for their
production will NOT be produced in an optimal
solution.
Mtodos Cuantitativos
57
Escom computers
Mtodo simplex, dualidad y anlisis
de sensibilidad
Mtodos Cuantitativos
58
59
OPERACIN
PRODUCCIN DE CAJAS
MONTAJE DE CIRCUITOS
ENSAMBLADO DE PORTTILES
ENSAMBLADO PARA ESCRITORIO
PORTATIL
4000
2500
2000
-------
PARA ESCRITORIO
2000
3000
---------1800
60
61
PARA ESCRITORIO
PORTTILES
MATERIALES DIRECTOS
$690
$800
PRODUCCIN
EXTERNAS
DE
CAJAS
$20
$15
MONTAJE DE TARJETAS
100
90
ENSAMBLADO FINAL
10
$125
115
PRODUCCIN
EXTERNAS
DE
CAJAS
$95
95
LLENADO DE TARJETAS
205
205
MONTAJE FINAL
415
115
$715
Mtodos Cuantitativos
$1640
415
62
$1220
Mtodos Cuantitativos
GASTOS
INDIRECTOS
TOTALES (X $1000)
$247
533
de 249
FIJOS GASTOS
INDIRECTOS
UNITARIOS
$95
205
415
230
$1259
115
63
FIJOS
64
CAJAS
OPERACIN
PRODUCCIN DE CAJAS
MONTAJE DE CIRCUITOS
ENSAMBLADO DE PORTTILES
ENSAMBLADO PARA ESCRITORIO
Mtodos Cuantitativos
PORTATIL
4000
2500
2000
-------
PARA ESCRITORIO
2000
3000
---------1800
65
PREGUNTAS
1. Formule un programa lineal para
determinar la mezcla ptima de productos.
Suponga que no se permite la
subcontratacin.
Mtodos Cuantitativos
66
VARIABLES DE DECISIN
X1 = Nmero de computadoras de porttiles
que se fabrican en un mes.
X2= Nmero de computadoras escritorio
que se fabrican en un mes.
Mtodos Cuantitativos
67
Solucin
Max Z = 180 X1 -140 x2
Sujeta a:
() x1 + x2 <= 2000
(1)
X1 <= 2000
(2)
X2 <= 1800
(3)
1.2 X1 + x2 <= 3000 (4)
X1, X2 >= 0, y enteros
PARA GENERAR LAS RESTRICCIONES:
(x1,y1)
(x2, y2)
(4000,0) y (0, 2000)
y-y1 = ((y2-y1)/(x2-x1)) (x-x1)
Mtodos Cuantitativos
68
Mtodos Cuantitativos
69
Mtodos Cuantitativos
70
Mtodos Cuantitativos
71
Mtodos Cuantitativos
72
Mtodos Cuantitativos
73
SOLUCIN
3. Nada, la solucin sera la misma.
Mtodos Cuantitativos
74
Mtodos Cuantitativos
75
Mtodos Cuantitativos
76
SOLUCIN
4. 1 (c1-z1)>= 0
1 (-140-0)>= 0
1 +140 >= 0
1 >=140
C1 = -140 + 1
C1=-140+140 =0
Por lo tanto, M.
valores
de c1 superiores a cero.
Mtodos Cuantitativos
En C. Eduardo Bustos Farias
77
78
PREGUNTAS
5. Debe Escom utilizar subcontratistas para
montar las tarjetas de circuitos? Argumente
porqu si o porqu no, sin formular y
resolver el problema lineal.
Mtodos Cuantitativos
79
TABLA INICIAL
PARA ESCRITORIO
PORTTILES
MATERIALES DIRECTOS
$690
$800
PRODUCCIN
EXTERNAS
DE
CAJAS
$20
$15
MONTAJE DE TARJETAS
100
90
ENSAMBLADO FINAL
10
$125
115
PRODUCCIN
EXTERNAS
DE
CAJAS
$95
95
LLENADO DE TARJETAS
205
205
MONTAJE FINAL
415
115
$715
Mtodos Cuantitativos
$1640
415
80
$1220
PARA ESCRITORIO
TABLA CON
SUBCONTRATACIN
PORTTILES
MATERIALES DIRECTOS
$690
$800
PRODUCCIN
EXTERNAS
DE
CAJAS
$20
$15
MONTAJE DE TARJETAS
100
90
ENSAMBLADO FINAL
10
$125
115
PRODUCCIN
EXTERNAS
DE
CAJAS
$95
95
LLENADO DE TARJETAS
110
100
MONTAJE FINAL
415
115
$620
Mtodos Cuantitativos
$1545
310
81
$1115
Mtodos Cuantitativos
82
Mtodos Cuantitativos
83
SIN SUBCONTRATAR
Max Z = 180 X1 -140 x2
C2= 1500-1640
C1=1400-1220
CON SUBCONTRATACIN
C2=1500-1545=-45
C1=1400-1115=285
Mtodos Cuantitativos
84
85
ESCRITORIO
C1= 1500-1545=-45
Mtodos Cuantitativos
PORTTILES
C2=1400-1115=285
86
6. CON
SUBCONTRATACIN
Max Z = 285 X1 -45 x2
Sujeta a:
() x1 + x2 <= 2000
(1)
X1 <= 2000
(2)
X2 <= 1800
(3)
1.2 X1 + x2 <= 3000 (4)
X1, X2 >= 0
Mtodos Cuantitativos
SIN SUBCONTRATACIN
Max Z = 180 X1-140 x2
Sujeta a:
() x1 + x2 <= 2000
(1)
X1 <= 2000
(2)
X2 <= 1800
(3)
1.2 X1 + x2 <= 3000 (4)
X1, X2 >= 0
87
Mtodos Cuantitativos
88
Mtodos Cuantitativos
89
Mtodos Cuantitativos
90