Beruflich Dokumente
Kultur Dokumente
Optimizacin lineal
Andrs Ramos
Universidad Pontificia Comillas
http://www.iit.upcomillas.es/aramos/
Andres.Ramos@upcomillas.es
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
Optimizacin lineal - 1
Optimizacin lineal - 2
Optimizacin lineal - 3
Datos necesarios:
Nmero de horas de tiempo de produccin disponibles por semana en
cada fbrica para los nuevos productos (el resto de tiempo estn
ocupadas en la fabricacin de los productos actuales)
Nmero de horas de tiempo de produccin de cada fbrica necesarias
para fabricar cada lote de cada producto
Beneficio neto por lote de cada nuevo producto fabricado. El beneficio
por lote se mantiene constante independientemente del nmero de lotes
fabricados.
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 4
Fbrica
1
2
3
Beneficio por lote ()
HORAS DE TIEMPO DE
PRODUCCIN POR LOTE
Producto 1
Producto 2
1
2
3
2
300
500
HORAS DISPONIBLES
POR SEMANA
4
12
18
Optimizacin lineal - 5
3x1
2 x2
+2 x2
4
12
18
x1 , x2 0
Solucin ptima:
(x1,x2) = (2, 6)
z = 36
Optimizacin lineal - 6
Formulacin genrica
Funci
Funcin objetivo lineal
max z = c1 x1 + c2 x2 + + cn xn
cantidad de recurso i
consumido por cada
unidad de actividad j
am1 x1 + am 2 x2 + + amn xn bm
incremento en z resultante de
un incremento en el nivel de
actividad j
max z = cT x
Ax b
x0
Matriz de restricciones
x1 , x2 ,, xn 0
Variables continuas
ACTIVIDADES
Restricciones lineales
RECURSOS
Optimizacin lineal - 7
Nomenclatura
Funcin objetivo lineal: medida cuantitativa de
funcionamiento (bondad) del sistema z
Beneficios, costes, flujo de mercancas
Optimizacin lineal - 8
Hiptesis
Proporcionalidad, linealidad
La contribucin de cada actividad xj al valor de la funcin objetivo
z es proporcional al nivel de la actividad, cj xj. La contribucin de
cada actividad xj al valor de la parte izquierda de cada restriccin
es proporcional al nivel de la actividad, aij xj.
Aditividad
Cada ecuacin en un problema LP es la suma de las contribuciones
individuales de las respectivas actividades.
Divisibilidad, continuidad
Cualquier variable puede tomar cualquier valor, no necesariamente
entero, que satisfaga las restricciones incluyendo las de no
negatividad.
Certidumbre
Los parmetros (constantes) de un problema LP se suponen
conocidos con certidumbre.
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 9
Geometra
Hiperplano
Cada ecuacin del problema. Un hiperplano divide el espacio en
dos semiespacios
Poliedro
ai1 x1 + ai 2 x2 + + ain xn = bi
Politopo
Poliedro no vaco y acotado
Optimizacin lineal - 10
Optimizacin lineal - 11
Convexidad (regin)
S
T
x
y
T no es convexo
S es convexo
x2
x = i i xi
x1
x3
x5
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
x4
=1
1 ,, k 0
Optimizacin lineal - 12
Convexidad (funcin)
Una funcin es convexa si cumple
f ( x + (1 ) y ) f ( x) + (1 ) f ( y )
x
y
Optimizacin lineal - 13
Geometra
Vrtice o punto extremo
Interseccin de n hiperplanos.
No puede ponerse como combinacin lineal convexa de dos puntos
diferentes del conjunto.
Cualquier punto de un politopo se puede expresar como
combinacin lineal convexa de los vrtices del mismo
Arista
Segmento obtenido por solucin de n-1 hiperplanos, siendo sus
extremos soluciones factibles vrtices
Contorno
Contiene las soluciones factibles que estn en uno o ms
hiperplanos
Optimizacin lineal - 14
n
n!
= =
m m !( n m)!
Optimizacin lineal - 15
Optimizacin lineal
Forma estndar
min c x
x
Ax = b
x0
b0
x n , c n , A mn , b m
Mtodos de resolucin
simplex (primal y dual)
punto interior (primal-dual predictivo-correctivo, proyectivo,
escalado afn)
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 16
Caso ejemplo
x2
max z = 3x1 + 5 x2
x1
3x1
2 x2
+2 x 2
(0,6)
4
12
18
x1 , x2 0
(2,6)
PI
(4,3)
SX
(0,0)
Rectas de
isofuncin
objetivo
(4,0)
x1
Optimizacin lineal - 17
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
Optimizacin lineal - 18
Optimizacin lineal - 19
3. Iteracin
Movimiento hacia un vrtice adyacente que sea una solucin
mejor
Se elige entre las aristas del vrtice la que lleva a una mejora
mayor en la f.o.
Se mueve hasta encontrar una nueva restriccin
Se determina el nuevo vrtice
4. Ir a 2.
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 20
3x1
2 x2
+2 x2
x1 , x2 0
x1 ,
x2 ,
x1
3x1
min z = 3x1 5 x2
2 x2
+2 x2
+ x3
x1
=4
+ x4
x3 ,
x4 ,
+ x5
= 12
= 18
x5
Optimizacin lineal - 21
Restricciones
a x
ij
bi aij x j + ui = bi
a x
ij
= bi aij x j + yi = bi
a x
ij
bi aij x j vi + yi = bi
Optimizacin lineal - 22
Optimizacin lineal - 23
Caso ejemplo
min z = 3x1 5 x2
+ x3
x1
3
5
c=
3x1
2 x2
+2 x 2
x1 ,
x2 ,
=4
+ x4
x3 ,
x4 ,
1 1
A = 2 1
3 2 1
+ x5
= 12
= 18
x5
4
b = 12
18
Optimizacin lineal - 24
(0,6)
min z = 3x1 5 x2
+ x3
x1
3x1
2 x2
+2 x 2
x1 ,
x2 ,
x3 ,
x4 ,
+ x5
= 12
= 18
x5
2 x2 = 12
x4
=4
+ x4
x1 = 4
x5
(4,3)
3x1 + 2 x2 = 18
x3
(0,0)
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
(4,0)
x1
Optimizacin lineal - 25
Solucin bsica
Si se fijan n-m variables a 0, el resto (m) quedan determinadas por el
sistema de ecuaciones
x3 = 4 x1
x1 = x2 = 0
x4 = 12 2 x2
x5 = 18 3x1 2 x2
Variables con valor = 0, no bsicas x1 , x2
x3 , x4 , x5
Variables con valor 0, bsicas
Esto es un vrtice del poliedro
Particin: separacin entre variables bsicas y no bsicas
Optimizacin lineal - 26
Particin
x T = [ xB
A = [B
c T = [ cB
xN ]
N]
cN ]
xB m
x N n m
B m m
N m( n m )
cB m
Ax = b
cN n m
BxB + Nx N = b x B = B 1 (b Nx N ) = B 1b B 1 Nx N
xN 0
x = b = B 1b
B
Optimizacin lineal - 27
Particin
Dada una base (particin) se puede calcular:
el valor de las variables bsicas y no bsicas y
el valor de la funcin objetivo
Optimizacin lineal - 28
x5 = 18 3x1 2 x2
Funcin objetivo
La funcin objetivo puede cambiar
z = 3x1 5 x2
Optimizacin lineal - 29
Adyacencia
Dos soluciones factibles vrtices son adyacentes si la lnea que
los conecta es una arista, es decir, si todas excepto una de sus
variables no bsicas son iguales. Cada solucin factible vrtice
tiene n-m soluciones factibles vrtices adyacentes.
Moverse de una solucin bsica factible a otra adyacente es
cambiar de una variable no bsica a bsica y al contrario para
otra variable
Optimizacin lineal - 30
Optimizacin lineal - 31
Coste reducido
Definimos:
wT cBT B 1
Y B 1 N
cTN cNT cBT B 1 N = cNT wT N = cNT cBT Y
c x
jI N
= z +
(c
jI N
z j )x j
Optimizacin lineal - 32
Costes reducidos
Si el coste reducido de una variable no bsica es cero en la
solucin ptima entonces pueden existir mltiples soluciones
ptimas, siendo al menos dos de ellas soluciones vrtices.
En el ptimo de un problema de minimizacin todos los costes
reducidos de las variables no bsicas son positivos o nulos.
Los costes reducidos de las variables bsicas son cero.
Optimizacin lineal - 33
Pivotamiento
Intercambio entre variables en la particin
Incremento de la variable no bsica, variable bsica entrante xt
Modificacin de las variables bsicas
Determinacin de variable bsica que se hace 0, variable bsica saliente
1
x3 = 4 x1
xB = B (b NxN ) = B b B NxN
x4 = 12 2 x2
x5 = 18 3x1 2 x2
xt = bi / yit
yit > 0
bi > 0
bi
y
:
>
0
La variable xt puede aumentar su valor hasta xt = 1min
it
i m y
it
z = z + c x
Optimizacin lineal - 34
2. Prueba de optimalidad
T
T
T 1
T
T
Clculo de costes reducidos cN = cN cB B N = cN cBY . Si todos los costes
reducidos son no negativos la base actual es ptima. En caso contrario, se
selecciona como variable bsica entrante VBE xt una variable con coste
reducido estrictamente negativo.
La prueba de optimalidad es local pero como los problemas de programacin
lineal son convexos, la solucin ptima ser global.
3. Iteracin
Sea yt = B 1at , la columna pivote t correspondiente a la variable bsica entrante.
Se busca la fila pivote s que verifica
bi
bs
= min : yit > 0
yst 1i m yit
Optimizacin lineal - 35
Optimizacin lineal - 36
Optimizacin lineal - 37
Optimizacin lineal - 38
Casos especiales
Conflicto entre variables bsicas entrantes
Variables con el mismo coste reducido en la ecuacin de la f.o., se puede elegir
cualquiera
Optimizacin lineal - 39
Degeneracin
La variable x6 es degenerada (variable bsica con valor 0)
x1 = 4
x2
(2,6)
(0,6)
min z = 3x1 5 x2
+ x3
x1
3x1
x1
x1 ,
2 x2
+2 x 2
+ x2
x2 ,
+ x4
+ x5
x3 ,
x4
=4
x4 ,
x5 ,
+ x6
x6
= 12
= 18
=8
0
2 x2 = 12
x1 + x2 = 8
x6
x5
(4,3)
3x1 + 2 x2 = 18
x3
(0,0)
(4,0)
x1
Optimizacin lineal - 40
Caracterizacin de soluciones
Solucin factible
Solucin que satisface todas las restricciones. Puntos del interior y contorno de la regin
factible.
Solucin infactible
Solucin que viola al menos una restriccin. Puntos exteriores a la regin factible.
Solucin ptima
Solucin factible vrtice con el valor ms favorable de la funcin objetivo
Puede haber mltiples soluciones ptimas. Es una situacin muy frecuente en la realidad.
Solucin no acotada
Optimizacin lineal - 41
xB
Cotas
z
1
cTB
B
xB
cTN
N
Variables bsicas
z
xB
z
1
0
xN
cTN cBT B 1N
xB
0
Cotas
cTB B 1b
B 1N
B 1b
Optimizacin lineal - 42
z
xB
x N
cNT
N
z
1
0
x B
0
Cotas
0
z
xB
z
1
0
x N
cNT cTB B 1N
B 1N
x B
cTB B 1
Cotas
cTB B 1b
B 1
B 1b
Optimizacin lineal - 43
Optimizacin lineal - 44
+0.1x 2
2.7
0.5x 1 +0.5x 2
=6
0.6x 1 +0.4x 2
x 1,
x2
Optimizacin lineal - 45
Optimizacin lineal - 46
Convergencia
Converge en un nmero finito de iteraciones
Caso peor
convergencia exponencial
Caso medio
nmero de iteraciones proporcional al nmero de restricciones m
tiempo de solucin proporcional a m3
Optimizacin lineal - 47
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
Optimizacin lineal - 48
Desarrollos adicionales
Mtodo simplex revisado
Forma producto de la inversa
Factorizacin de la matriz base
Estrategias de clculo de costes reducidos
Optimizacin lineal - 49
B 1
Valores
z = cTB B 1b
b = B 1b
Optimizacin lineal - 50
Optimizacin lineal - 51
Mtodo simplex
1. Calcular costes reducidos de VNB
2. Seleccionar VBE xt y calcular elementos columna pivote
3. Determinar VBS xs . Elemento pivote yst
yit
Determinar el mnimo bs
= min : yit > 0
y st 1i m yit
Actualizacin de la inversa
y
Se suma a la ecuacin i la ecuacin s multiplicada por it para i=1,,m
y st
is
La ecuacin s se divide por el elemento pivote
yit 1
1
(
)
( B ) sj
B
ij
yst
( B 1 )ij =
1 ( B 1 )
sj
yst
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
is
i=s
Optimizacin lineal - 52
F =
yt
B 1 = EB 1
E = F 1
yt = B 1at
E =
y1t yst
= 1 yst
ymt yst
Optimizacin lineal - 53
Optimizacin lineal - 54
Optimizacin lineal - 55
as = 0 + as s
Ea =
s
a a
1
m
m
m
m
cT E = ( c1 c2 cs
1
1
cm )
1
m
= ( c1 c2 cs 1 cT
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
cs +1 cm )
Optimizacin lineal - 56
LUb = b
Optimizacin lineal - 57
Optimizacin lineal - 58
Coste
reducido
ct = min
jxN
Escala de
la arista
c j
1
B Ne j
+1
= min
jxN
c j
1
B aj
+1
Optimizacin lineal - 59
0 xj uj
Si
Si
0 xj uj
xj = 0
xj = uj yj = 0
0 yj uj
xj es no bsica
yj es no bsica
Optimizacin lineal - 60
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
Optimizacin lineal - 61
Optimizacin lineal - 62
Purchasing decision
The Purchasing Director of the department store The English
Suit (TES) is interested in the acquisition of a certain amount
of Manchego cheese, called d, from different cheese factories
for the next discount campaign. At the moment he has three
suppliers available, A, B and C. He has contacted with the
Operations Engineers of the factories that have given him the
per unit cost and production capacity of each factory, which
correspond respectively to ci and pi, and are expressed in /kg
and kg.
Assess the optimization problem to be solved by the TEC
Purchasing Director
Optimizacin lineal - 63
Decisions to be made/Variables
Xi how much cheese to purchase to each factory i [kg]
Optimizacin lineal - 64
pC
cC
pB
cB
cA
Objective function
is this area
pA
d
XA
XB
XC
Demand [kg]
Optimizacin lineal - 65
min cAX A + cB X B + cC XC
Constraints:
XA ,XB ,XC
X A + X B + XC d
X A pA
X B pB
XC pC
XA 0
XB 0
XC 0
Optimizacin lineal - 66
min z = cAX A + cB X B + cC XC
X A ,X B ,XC
X A + X B + XC d
X A pA
X B pB
XC pC
X A, X B , XC 0
Optimizacin lineal - 67
Selling decision
Three companies devoted to producing Manchego cheese have
constituted an association, the Manchego Cheese Association
(MCA), to join efforts in commercializing their products. The
Economy Director of this association has been contacted by an
important department store interested in purchasing d kg of
cheese for the next month. The Director knows the per unit
cost ci and capacity pi of each factory.
Assess the optimization problem to be solved by the MCA
Economy Director. Determine the selling price that maximizes
its revenues.
Optimizacin lineal - 68
Decisions to be made/Variables
Z cheese unit price [/kg]
Yi penalty by limit in each factory i [/kg]
Optimizacin lineal - 69
YC
pC
cC
pB
cB
cA
Objective function
is this area
YB
YA
pA
d
Demand [kg]
Optimizacin lineal - 70
Constraints:
Companies want the maximum marginal price below their marginal
(per unit) cost [/kg]
It is a perfect competitive market. If a factory sells above its variable
cost it will be out of the market
Z YA cA
Z YB cB
Z ,YA,YB ,YC 0
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Z YC cC
Optimizacin lineal - 71
Z YA cA
Z YB cB
Z YC cC
Z ,YA,YB ,YC 0
Optimizacin lineal - 72
Aesthetic relations
PRIMAL: TES cost minimization DUAL: MCA revenue maximization
min z = cAX A + cB X B + cC XC
X A ,X B ,XC
X A + X B + XC d
Z YA cA
X A pA
Z YB cB
X B pB
Z YC cC
XC pC
Z ,YA,YB ,YC 0
X A, X B , XC 0
1
1
A =
1 1
T
A = 1
1
Optimizacin lineal - 73
Aesthetic relations
PRIMAL problem
Minimization
RHS
O.F. coefficients
Constraint matrix
# of variables
# of constraints
DUAL problem
Maximization
O.F. coefficients
RHS
Transposed constraint matrix
# of constraints
# of variables
Primal and dual words can be used for any problem (from a
mathematical point of view)
Usually
primal problem is called the cost minimization with quantities as variables and
dual problem is called the revenue maximization with prices as variables
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 74
Two perspectives
Engineers:
Decide quantities: how much cheese to produce in each factory [kg]
Work with primal variables
Economists:
Decide prices: what price to ask for a kg of cheese [/kg]
Work with dual variables
Optimizacin lineal - 75
Behavioral relations
Objective function at the optimal solution of primal and dual
problems coincide z * = y 0*
How much does the total cost increase when the expected
cheese demand increases in one unit [/kg]? Z
How much does the total cost decrease when the production
capacity of factory A increases in one unit [/kg]? YA
Optimizacin lineal - 76
factory
factory
factory
factory
factory
factory
A
B
C
A
B
C
[kg]
[ per kg]
[ per kg]
[ per kg]
[kg]
[kg]
[kg]
positive variables
xA how much cheese to purchase to factory A [kg]
XB how much cheese to purchase to factory B [kg]
XC how much cheese to purchase to factory C [kg]
variable
z acquisition cost []
equations
of Minimize the acquisition cost
ecd Satisfy the estimated cheese demand
ecA Observe the limits of factory A
ecB Observe the limits of factory B
ecc Observe the limits of factory C
of
ecd
ecA
ecB
ecC
..
..
..
..
..
model cm / all / ;
=
=
=
=
=
=
=
8
10
12
100
120
150
300
;
;
;
;
;
;
;
[]
[kg]
[kg]
[kg]
[kg] ;
m in z = c A X A + c B X B + cC X C
X A ,X B ,X C
X A + X B + XC d
X A p A
X B p B
X C pC
X A, X B , XC 0
Optimizacin lineal - 77
factory
factory
factory
factory
factory
factory
A
B
C
A
B
C
[kg]
[ per kg]
[ per kg]
[ per kg]
[kg]
[kg]
[kg]
positive variables
yA penalty by limit in factory A [ per
yB penalty by limit in factory B [ per
yC penalty by limit in factory C [ per
z cheese unit price
[ per
kg]
kg]
kg]
kg]
variable
y0 revenues []
equations
of Maximize the revenues
ecA Company A want the maximum price below their per unit cost
ecB Company B want the maximum price below their per unit cost
ecC Company C want the maximum price below their per unit cost
of
ecA
ecB
ecC
..
..
..
..
y0 =e=
z - yA
z - yB
z - yC
d*z
=l=
=l=
=l=
model rm / all / ;
=
=
=
=
=
=
=
8
10
12
100
120
150
300
[]
[ per kg]
[ per kg]
[ per kg] ;
;
;
;
;
;
;
;
m ax y 0 = dZ p AY A p BY B pCYC
Z YA cA
Z YB cB
Z YC cC
Z ,Y A ,Y B ,YC 0
Optimizacin lineal - 78
Optimizacin lineal - 79
Optimizacin lineal - 80
Model results
Values (levels) of variables
Values (levels) of constraints
Dual variables (shadow prices, Lagrange multipliers)
Marginal values of constraints
o.f. dimension
Dimension:
constraint dimension
Reduced costs
Marginal values of variables
o.f. dimension
Dimension:
variable dimension
Its value is only valid in the neighborhood of the optimal solution
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 81
Problema dual
Problema estndar primal (P)
Cota inferior de este problema
min z = cT x
Ax = b
x0
Operamos con las filas de la matriz, las multiplicamos por algn valor
y T Ax = y T b las sumamos entre ellas de modo que no se superen los
coeficientes de la funcin objetivo y T A cT , en tal caso el lado derecho
resultante de tales operaciones sera una cota inferior para el valor de la
funcin objetivo y T b cT x .
Esa cota queremos que sea lo ms alta posible.
max y0 = bT y
AT y c
Optimizacin lineal - 82
Interpretacin econmica
Precio sombra (variable dual, multiplicador simplex, precio de
equilibrio, precio justo) del recurso i (yi) mide el valor
marginal del recurso, es decir, el incremento marginal de z al
aumentar marginalmente el recurso bi.
Fuente: OMEL
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 83
max
Restriccin
=
Variable
0
0
no restringida
Optimizacin lineal - 84
Ejemplo (i)
Dual
Primal
max z = 3 x1 + 5 x2
x1
3 x1
2 x2
+2 x2
x1 ,
x2
12
18
x
max z = [3 5] 1
x2
1
4
2 x1 12
x2
3 2
18
x1 0
x 0
2
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
min y0 = 4 y1 + 12 y2 + 18 y3
y1
2 y2
y1 , y2 ,
+3 y3
+2 y3
y3
3
5
0
y1
min y0 = [ 4 12 18] y2
y3
y1
1
3
3
2 2 y2 5
y
3
y1 0
y 0
2
y3 0
Optimizacin lineal - 85
Ejemplo (ii)
min c1 x1 + c2 x2 + c3 x3
x1 , x2 , x3
y1 , y2 , y3
x1 0, x2 0, x3 libre
y1 0, y2 0, y3 libre
Optimizacin lineal - 86
Maximizacin de la funcin
de utilidad
P1 ,P2 ,P3
P1
+P2
+P3
P1
: 1
P2
: 2
P3
P3
: 3
P3
P1
P2
P1,
P2 ,
max d + P11 + P2 2 + P3 3
,1 ,2 ,3
+1
c1
: P1
c2
: P2
+3 c3
: P3
+2
1,
2 ,
Optimizacin lineal - 87
Optimizacin lineal - 88
z
1
0
z
xB
Variables bsicas
z
1
xB
x N
cNT cTB B 1N
B 1N
x B
cTB B 1
Cotas
cTB B 1b
B 1
B 1b
VARIABLES
x N
x B
DEL DUAL
variables duales de variables duales
exceso y de holgura
originales
B 1N
B 1
VARIABLES
DEL PRIMAL
Cotas
cTB B 1b
B 1b
DERIVADAS FO CON
RESPECTO VAR DUAL
Optimizacin lineal - 89
Optimizacin lineal - 90
x0
Dual (D)
max y0 = b y
T
A yc
T
max y0 = bT y
AT y + s = c
s0
x j s j = 0 j = 1,, n
Ax = b
AT y + s = c
x0
s0
c x b y = ( A y + s ) x b y = y Ax + s x b y = x s = x j s j
T
j =1
Optimizacin lineal - 91
Teorema de dualidad
Las nicas relaciones posibles entre primal y dual son:
Si un problema tiene soluciones ptimas factibles entonces tambin las
tiene el otro. Se pueden aplicar las propiedades dbil y fuerte de
dualidad.
Si un problema tiene soluciones factibles y funcin objetivo no
acotada, el otro problema no tiene soluciones factibles.
Si un problema no tiene soluciones factibles, el otro o no tiene
soluciones factibles o no tiene funcin objetivo acotada.
Optimizacin lineal - 92
Ejemplo 1 (i)
max z =
x, y
x
+ y6
3
2 x + y 12
2x+y=12
3
x+ y
4
z=9
z=6
z=12
4
x/3+y=6
2
6
x
10
12
Optimizacin lineal - 93
VBS
-0.75
-1
0.33
max z =
u
x, y
x
+ y6
3
2 x + y 12
0
1
12
12
VBE
VBS
: 1
:2
( 1 , 2 ) = (0.75,0.25)
-0.41666
-6
1.67
-1
3.6
0.333
18
Var
dual
R1
3
x+ y
4
Var
dual
R2
z
0.75
0.25
-7.5
-0.6
0.6
3.6
1.2
-0.2
4.8
Optimizacin lineal - 94
Ejemplo 1 (ii)
9
Variable
dual R1
2x+y=12
max z =
x, y
Gradiente
f.o.
z=7.5
x
+ y6
3
2 x + y 12
( 1 , 2 ) = (0.75,0.25)
Variable
dual R2
(3.6,4.8)
3
x+ y
4
x/3+y=6
2
6
x
10
12
Optimizacin lineal - 95
Variables de holgura:
Distancia por exceso (valor negativo) o defecto (valor positivo) a cada
restriccin de desigualdad
Variables artificiales:
Distancia por exceso (valor negativo) o defecto (valor positivo) a cada
restriccin de igualdad
Costes reducidos:
Derivadas direccionales de las variables
Proyeccin del gradiente de la funcin objetivo sobre el eje de la
variable correspondiente
Variables duales:
Costes reducidos de las variables de holgura y de las variables
artificiales
Proyeccin del gradiente de la funcin objetivo sobre el vector
ortogonal
a la restriccin correspondiente
ESCUELA TCNICA
SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
Optimizacin lineal - 96
Ejemplo 2
Se introduce una nueva restriccin que pasa por el ptimo
9
max z =
2x+y=12
x, y
3
x+ y
4
x
+ y6
3
2 x + y 12
z=7.5
11
x+ y7
18
(3.6,4.8)
4
x/3+y=6
2
11x/18+y=7
0
2
4
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
6
x
10
12
Optimizacin lineal - 97
-0.75
-1
0.33
0.611
1
1
12
12
-0.42
0.333
18
1.667
-1
3.6
0.278
-1
3.6
0.75
0.25
7.5
1.2
-0.2
4.8
-0.6
0.6
3.6
-0.83
-0.17
B) elijo w como
VBS
z
-0.5
1.5
7.5
2.2
-1.2
4.8
-6
-3.6
3.6
3.6
0.1
0.9
7.5
-0.44
1.44
4.8
0.2
-1.2
0.72
-0.72
3.6
Optimizacin lineal - 98
Degeneracin en primal
En el problema anterior, el punto (3.6,4.8) queda determinado
por cualquier pareja de las tres restricciones.
Hay 5 variables (2 originales y 3 de holgura). Como hay 3
restricciones hay 3 variables bsicas con valores x=3.6, y=4.8
y u=0 v=0 w=0, pero slo una. Luego, hay una variable
bsica con valor 0 (solucin degenerada).
Degeneracin en primal es igual a mltiples ptimos en dual.
Estos valores son soluciones ptimas del dual y, a priori, se
podra obtener cualquiera de ellas.
( 1 , 2 , 3 ) = (0,0.1,0.9)
( 1 , 2 , 3 ) = (0.75,0.25,0)
Optimizacin lineal - 99
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
Anlisis de sensibilidad
Efectos sobre la solucin ptima debidos a cambios en aij, bi
y c j.
NO se hace aplicando de nuevo el mtodo simplex.
Procedimiento completo:
y* , B 1* no cambian aunque cambien b , c y A
bb c c A A
se recalcula la tabla final para los nuevos valores b , c y A o de forma
incremental
slo se efectan los cambios asociados a los cambios en los elementos
correspondientes de b , c y A
preparacin de la tabla del simplex para resolver por eliminacin de
Gauss
prueba de factibilidad (todas las variables bsicas no negativas)
prueba de optimalidad (coeficientes no negativos en ecuacin 0)
ESCUELA TCNICA SUPERIOR DE INGENIERA
nueva iteracin del simplex
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
b = B 1b
y* = 1.5 1
1 0.33 0.33
B1* = 0.5
0.33 0.33
bb
4 4
12 24
18 18
Optimizacin lineal - 103
x3 6
x = 12
2 2
x1
4
1 24 = 54
18
1 0.33 0.33 4 6
b = B1b = 0.5
24 = 12
18 2
0.33 0.33
2 0.33
= 6 + 0.5 b2 0
2 0.33
2 + 0.33b2 = 0
b2 = 2 / 0.33 = 6
6 + 0.5b2 = 0
b2 = 6 / 0.5 = 12
2 0.33b2 = 0
b2 = 2 / 0.33 = 6
6 b2 6
b2 = 12 + b2
6 b2 18
ESCUELA TCNICA SUPERIOR DE INGENIERA
DEPARTAMENTO DE ORGANIZACIN INDUSTRIAL
En dual
a
i =1
ij
yi c j
siendo j conocida
c j c j z j
Inicializacin
Problema en forma estndar (min, restricciones tipo =, variables )
Solucin bsica inicial cuyas variables bsicas tienen coeficientes 0 en la
ecuacin f.o. y las no bsicas coeficientes 0.
2.
Prueba de optimalidad
Comprobar si variables bsicas 0. S solucin ptima. NO siguiente
iteracin
3.
Siguiente iteracin
Determinar variable bsica saliente (fila pivote): variable bsica negativa con
mayor valor absoluto
Determinar variable bsica entrante (columna pivote): variable no bsica cuyo
coeficiente en la ecuacin de f.o. alcanza antes 0.
Se comprueba entre las variables no bsicas con coeficiente < 0 en fila pivote y
se selecciona el menor cociente entre su coeficiente en la ecuacin de la f.o. y esa
fila.
c j z j
min
: ykj < 0
y
kj
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)
min z = cT x
Ax = b
x0
Dual (D)
max y0 = bT y
AT y + s = c
s0
(m + n)
A y+s=c
T
s0
x jsj =
AT ( y k + y k ) + s k + s k = c
Ax k = 0
AT y k + s k = 0
x kj +1s kj +1 = ( x kj + x kj )( s kj + s kj ) = k +1 s kj x kj + x kj s kj + x kj s kj = k +1 x kj s kj
S x + X s = e XSe
Ax = 0
S = diag(s )
e = (1 1)
XSe = e
AT y + s = 0
Desarrollos adicionales
Mantenimiento de estricta factibilidad
Solucin inicial infactible
Mtodo primal-dual predictivo correctivo
P = min ( x j x j )
x j < 0
D = min ( s j s j )
s j < 0
= min( P , D )
x j + x j 0
s j + s j 0
( xk , sk ) C k
(0,1)
Ax k = b Ax k rP
AT ( y k + y k ) + s k + s k = c
AT y k + s k = c ( AT y k + s k ) rD
S x + X s = e XSe v ( )
Ax = b Ax rP
AT y + s = c AT y s rD
y = ( ADAT ) 1 AS 1v ( ) ADrD rP
s = AT y + rD
x = S 1v ( ) Ds
AT y + s = c AT y s rD
X = diag( x )
S = diag( s )
Caso ejemplo
6
min x1 + x2
2 x1 + x2 2
x1 + 2 x2 6
x1 2 x2 5
x2
x1 + 2 x2 10
3
x1 x2 4
x1 , x2 0
3
x1
4
4.27
4.19
1.53
0.76
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
(4,4)
4
x2
x2
1
2.19
2.18
1.42
1.77
2.27
2.4
2.4
2.4
2.4
2.4
2.4
2.4
k +1 = k /10
4
1.74
1.74
1.74
2.13
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
(1,1)
0
3
x1
0
0
3
x1
2
4.44
4.36
1.59
0.83
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
(2,4)
4
x2
x2
2
1.88
1.88
1.59
2.02
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
k +1 = k /10
4
1.75
1.75
1.7
2.09
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
(4,2)
2
3
x1
3
x1
(2,4)
x2
3
x1
4
1.75
1.85
2.54
2.21
1.6
1.9
2.28
2.33
2.4
2.38
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
2.4
k +1 = k / 20
2
4.44
4.38
3.29
1.37
0.39
0.21
0.2
0.2
0.2
0.2
(2,4)
4
x2
k +1 = k / 2
2
4.44
4.22
1.35
2.21
2.17
1.75
0.59
0.46
0.24
0.26
0.2
0.22
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
0.2
4
1.75
1.74
1.59
1.94
2.34
2.41
2.4
2.4
2.4
2.4
3
x1
Convergencia
120
100
k +1 = k /10
Daulity Gap
80
60
40
20
6
iteraciones
10
12
Actualizacin de
x kj +1s kj +1 = ( x kj + x kj )( s kj + s kj ) = k +1
CONTENIDO
INTRODUCCIN
MTODO SIMPLEX
ADDITIONAL DEVELOPMENTS (master)
DUALIDAD
ANLISIS DE SENSIBILIDAD
INTERIOR POINT METHOD (master)
COMPARISON AMONG CPLEX ALGORITHMS
(master)