Professional Documents
Culture Documents
Dondeestnlassolucionesptimasdeproblemasdeprogramacinlineal?
ICS1113.Prof.:Pamelalvarez M.
32
PARTEII:ProgramacinLineal
Teorema: Considereelproblemadeprogramacinlineal
min s.a.
cT x Ax b
ICS1113.Prof.:Pamelalvarez M.
33
PARTEII:ProgramacinLineal
Yparalaotraforma. Teorema: Considereelproblemadeprogramacinlineal
min cT x s.a. Ax = b, x 0
conP={x:Ax=b,x0}.Entonces,secumpleunadelassiguientes: 1. 2. 3 3. Elproblemaesinfactible. Elproblemaesnoacotado,yexisteh 0 : Ah=0 y cTh<0. E i unpuntoextremox*de Existe d P tal lquex*essolucin l i ptima i del d lproblema bl
ICS1113.Prof.:Pamelalvarez M. 34
PARTEII:ProgramacinLineal
Entonces:cmoresolvemosunproblemadeprogramacinlineal? Laideaadesarrollar:navegardesdeunpuntoextremodelpoliedroaotromejoren formasistemtica,hastallegaraunpuntoptimo. Yparaesonecesitamoscaracterizarlospuntosextremosdemaneracomputable...
ICS1113.Prof.:Pamelalvarez M.
35
PARTEII:ProgramacinLineal
Aququeremosllegar? Aderivarunmtododeresolucin
HastaelmomentoqusabemossobrelasolucinptimadeunProblemadePL? Quesielproblematienesolucin, solucin staestarenunvrticeopuntoextremo. extremo Ideadealgoritmo: x* Encontrartodoslosvrticesfactiblesdelproblema p Calcularelvalordelafuncinobjetivoencada vrticefactible Determinarelvrticeconmejorvalordefuncin objetivo
ICS1113.Prof.:Pamelalvarez M.
36
PARTEII:ProgramacinLineal
Culeslafactibilidaddehacerloanterior? Pensemosqueunproblemade20variablesy40restriccionespuedellegara tenermsde30millonesdevrticesfactibles. UnmtodoqueexplotalageometradelosproblemasdePL:MtodoSimplex (Dantzig,1947) Esunmtodoextraordinariamenteeficiente E unalgoritmo Es l it ,esdecir, d i unprocesoenel lqueserepite it (it (itera) )un procedimientosistemticounayotravezhastaobtenerelresultadodeseado.
ICS1113.Prof.:Pamelalvarez M.
37
PARTEII:ProgramacinLineal
LaestructurageneraldelmtodoSimplexes:
PasoInicial
PasoIterativo
SolucinNoptima
Pruebade optimalidad
Solucinptima
Fin
ICS1113.Prof.:Pamelalvarez M.
38
PARTEII:ProgramacinLineal
Lastrespropiedadesdelassolucionesfactiblesenunvrticequeformanel fundamentodelmtodoSimplexsonlassiguientes: 1. Siexisteexactamenteunasolucinptima,entoncesdebeserunasolucin factibleenunvrtice.Siexistesolucionesptimasmltiples,almenosdosde ellasdebensersolucionesfactiblesenvrticesadyacentes. 2. Existeslounnmerofinitodesolucionesfactiblesenlosvrtices..Aunque puedellegarasermuuuuuy alta 3. Siunasolucinenunvrticeesigualomejorquetodaslassoluciones f tibl enlos factibles l vrtices ti adyacentes d t aella, ll entonces t esi igual lomejor j que todaslasdemssolucionesenlosvrtices,esdecir,esptima.
ICS1113.Prof.:Pamelalvarez M.
39
PARTEII:ProgramacinLineal
LgicadetrsdelmtodoSimplex: Comienzaenunasolucinbsicafactible,yevalasilasolucinesptima comparndolaconlassolucionesdelosvrticesadyacentes. Sinoesptima,elmtodosedesplazaaunvrticeadyacentequeojalsea mejor(nopuedeserpeor)quelasolucinbsicafactiblevigente.Paraesto,el mtodomantienen1 delasn restriccionesactivasquedefinanlasolucin b i anterior bsica t i ypermuta t la l restante t t porotra t restriccin t i i queantes t se mantena(muyprobablemente)inactiva. Unavezdeterminadaslasn restriccionesactivas, activas identificarlasolucinbsica asociadaesmuysimplepuesbastaresolverelsistemaden x n ecuaciones resultante. Esteprocedimientoserepitehastaalcanzarunasolucinptima.
ICS1113.Prof.:Pamelalvarez M. 40
PARTEII:ProgramacinLineal
LgicadetrsdelmtodoSimplex: EsimportantedestacarqueSimplexexigequetodaslasvariablesseanno negativasyquetodaslasrestriccionesseanecuaciones(igualdad).Esto exigeagregarvariablesdeholgura nonegativasencasosdedesigualdades menoroigualyrestarvariablesdeexceso nonegativasenlas restriccionesdemayor y oigual. g
ICS1113.Prof.:Pamelalvarez M.
41
PARTEII:ProgramacinLineal
FormatoEstndar deunproblemadePL:
min c T x s .a Ax = b x0
Donde:
A M mxn ( ); c , x n ; b m
Adems:
nm
Porqu?
42
ICS1113.Prof.:Pamelalvarez M.
PARTEII:ProgramacinLineal
Transformeelsiguienteproblemaalaformaestndar:
P ) Max 3 x1 + 5 x 2 s .a . x1 4
P ) Min 3 x1 5 x 2 s .a . x1 + y1 = 4 2 x 2 + y 2 = 12 3 x1 + 2 x 2 + y 3 = 18 x1 , x 2 0 y1 , y 2 , y 3 0
x1 x2 x = y1 ; y2 y 3
2 x 2 12 3 x1 + 2 x 2 18 x1 , x 2 0
3 1 0 1 0 0 5 A = 0 2 0 1 0; c = 0 ; 3 2 0 0 1 0 0 ICS1113.Prof.:Pamelalvarez M.
donde:
4 b = 12 18
43
PARTEII:ProgramacinLineal
Notacin: aij esel de lafil filai,columna j lelemento l d l l A.j denotalacolumnaj Ai. denotalafilai
Ax = b A1 x1 + A2 x2 + ... + An xn = b
ICS1113.Prof.:Pamelalvarez M.
44
PARTEII:ProgramacinLineal
Definicin: Unabase esunasubmatriz b b i de d A formada f d porm columnas l linealmenteindependientes.
Paraqusirve?
P ) Min 3x1 5 x2 0 y1 0 y2 0 y3 s.a. x1 + y1 = 4 2 x2 + y2 = 12 3x1 + 2 x2 + y3 = 18 x1 , x2 , y1 , y2 , y3 0
P ) Max 3 x1 + 5 x 2 s .a . x1 4 2 x 2 12 3 x1 + 2 x 2 18 x1 , x 2 0
ICS1113.Prof.:Pamelalvarez M.
45
PARTEII:ProgramacinLineal
Matriz:
1 0 1 0 0 A = 0 2 0 1 0 3 2 0 0 1
Bases:
1 B1 = 0 0 1 B5 = 0 3 0 B9 = 2 2 0 0 1 0; 0 1 0 1 2 0; 2 0 1 0 0 0; 0 1 1 B2 = 0 3 1 B6 = 0 3 0 B10 = 2 2 0 0 1 0; 0 1 0 0 2 1; 2 0 0 0 1 0 0 1 1 B3 = 0 3 1 B7 = 0 3 1 0 0 1; 0 0 0 0 2 0; 2 1 1 B4 = 0 3 0 B8 = 2 2 1 0 0 0; 0 1 1 0 0 1; 0 0
ICS1113.Prof.:Pamelalvarez M.
46
PARTEII:ProgramacinLineal
Cantidadmximadebases:
n n! = m m !( n m ) !
Ennuestroejemplo:
5 5! 120 = = 10 = 3 3!( 5 3) ! 6 2
ICS1113.Prof.:Pamelalvarez M.
47
PARTEII:ProgramacinLineal
Pero,paraqusirveunabase? Tenemosmsvariablesquerestricciones Conunabasesepuedendespejaralgunasvariablesentrminosde otras Podemosresolverelsistemadeecuacionesfijandoalgunas variables
ICS1113.Prof.:Pamelalvarez M.
48
PARTEII:ProgramacinLineal
Porejemplo: Tenemoselsiguientesistema:
x1 + 4 x2 x1 + 2 x2 x1 + x2
100 60 50
Hayqueescribirloenformatoestndar
ICS1113.Prof.:Pamelalvarez M.
49
PARTEII:ProgramacinLineal
Porejemplo: Tenemoselsiguientesistema:
x1 + 4 x2 + x1 + 2 x2 + x1 + x2 +
x3 x4 x5
= 100 = 60 = 50
Lascolumnas(ovariables)3,4y5formanunabasey:
x3 x4 x5
= 100 x1 4 x2 = 60 x1 2 x2 = 50 x1 x2
Solucindelsistema?
ICS1113.Prof.:Pamelalvarez M. 50
PARTEII:ProgramacinLineal
Lascolumnas1,3y4formanunabasey:
x1 + 4 x2 + x1 + 2 x2 + x1 + x2 + x3 x4 x5 = 100 = 60 = 50
x1 x3 x4
Cmohicimosesto?
50 x2 x5 = 50 3x2 + x5 = 10 x2 + x5
ICS1113.Prof.:Pamelalvarez M.
51
PARTEII:ProgramacinLineal
Deformamsgeneral Tomemoslas de l columnas l d A correspondientes: di
x1 + 4 x2 + x1 + 2 x2 + x1 + x2 + x3 x4 x5 = 100 = 60 = 50
1 1 0 B = [ A1 A3 A4 ] = 1 0 1 1 0 0 0 0 1 B 1 = 1 0 1 0 1 1
ICS1113.Prof.:Pamelalvarez M.
52
PARTEII:ProgramacinLineal
B A=?
1 1 0 0 1 B 1 A = 0 3 1 0 1 0 1 0 1 1
NotarquesiB esinvertible,
1
Ax = b
B 1 Ax = B 1b
50 B 1b = 50 10
ICS1113.Prof.:Pamelalvarez M.
53
PARTEII:ProgramacinLineal
Osea,loquehicimosfue:
x1 + 4 x2 + x1 + 2 x2 + x1 + x2 +
x3 + 0+ 0+
0+ x4 + 0+
0 0 x5
= 100 = 60 = 50
x1 + x2 + 0 + 3 x2 + 0 + x2 +
0+ x3 + 0+
0 + x5 0 x5 x4 x5
= 50 = 50 = 10
54
AMBOSSISTEMASSONEQUIVALENTES
ICS1113.Prof.:Pamelalvarez M.
PARTEII:ProgramacinLineal
Conelsistema:
x3 x4 x5
= 100 x1 4 x2 = 60 x1 2 x2 = 50 x1 x2
Conelsistema:
x1 x3 x4
50 x2 x5 = 50 3 x2 + x5 = 10 x2 + x5
PARTEII:ProgramacinLineal
Volvamosanuestroejemplooriginal: Qu base? solucin l i generacada d b ?
1 0 0 ; B2 = 0 1 0 ( 4, 0, 0,12, 6 ) ; 3 0 1 1 1 0 ; B4 = 0 0 0 ; 3 0 1 1 ; B6 = 0 3 0 ; B8 = 2 2 0 0 2 1 ( 4,3, 0, 6, 0 ) ; 2 0 1 0 0 1 ( 0,9, 4, 6, 0 ) ; 0 0
1 0 0 B1 = 0 1 0 ( 0, 0, 4,12,18 ) 0 0 1 1 1 0 B3 = 0 0 1 ( 6, 0, 2,12, 0 ) 3 0 0 1 B5 = 0 3 1 B7 = 0 3 0 1 2 0 ( 2, 6, 2, 0, 0 ) 2 0 0 0 2 0 ( 4, 6, 0, 0, 6 ) 2 1
0 1 0 B9 = 2 0 0 ( 0, 6, 4, 0, 6 ) 2 0 1
0 0 0 ; B10 = 2 1 0 2 0 1
ICS1113.Prof.:Pamelalvarez M. 56
PARTEII:ProgramacinLineal
Grficamente:
x2
B8
(0 9) (0,9)
B5
B7
(0,6) ( , ) (2,6) (4,6)
B9
(4,3)
B6
Conclusiones?
B1
(0 0) (0,0)
(4,0)
(6,0)
x1
B2
B3
ICS1113.Prof.:Pamelalvarez M. 57