Upload
hanhi
View
213
Download
0
Embed Size (px)
Citation preview
DiscreteOp+miza+on
MA2827Fondementsdel’op-misa-ondiscrète
h7ps://project.inria.fr/2015ma2827/MaterialfromP.VanHentenryck’scourse
Whatisalinearprogram?
• Whataboutmaximiza+on?– solve
• Whatifavariablecantakenega+vevalues?– replacexi by
• Equalityconstraints?– usetwoinequali+es
• Variablestakingintegervalues?– mixedintegerprogramming
Geometricalview
• Convexsets– AsetSinRnisconvexifitcontainsalltheconvexcombina+onsofthepointsinS
• Theintersec+onofconvexsetsisconvex– Proof?
Geometricalview
• Ahalfspaceisaconvexset
• Polyhedron:intersec+onofsetofhalfspaces(alsoconvex).Iffinite,polytope
Geometricalview
x1
x2
�4.0x1 + 2.5x2 �0.25�3.0x1 � 6.0x2 �43.501.5x1 � 4.5x2 3.001.7x1 � 1.7x2 16.674.8x1 + 1.2x2 82.332.0x1 + 3.5x2 65.75
�3.0x1 + 5.0x2 29.50
Hyperplanes
21
Tuesday, 11 June 13
GeometricalviewGeometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalview
x1
x2
Geometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalview
x1
x2
Geometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalview
x1
x2
Geometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalview
x1
x2
Geometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalview
x1
x2
Geometry of Linear Programs‣Every point in a polytope is a convex
combination of its vertices
29
Tuesday, 11 June 13
Geometricalviewmin c1x1 + . . .+ cnxn
subject to
a11x1 + . . .+ a1nxn b1
. . .
am1x1 + . . .+ amnxn bm
xi � 0 (1 i n)
Why I Love These Vertices
30
‣Theorem: At least one of the points where the objective value is minimal is a vertex.
Tuesday, 11 June 13
Geometricalview
x1
x2
c1x1 + . . .+ cnxn = bmin
Why I Love These Vertices
31
c1x1 + . . .+ cnxn = b
⇤
Tuesday, 11 June 13
Geometricalview
• Howtosolvealinearprogram?– Enumerateallthever+ces
– Selecttheonewiththesmallestobjec+vevalue
Algebraicview
• Thesimplexalgorithm– Amoreintelligentwayofexploringthever+ces
• InventedbyG.Dantzig
• Exponen+alworst-case,butworkswellinprac+ce
Simplexalgorithm
• Outline1. Anop+malsolu+onisatavertex2. Avertexisabasicfeasiblesolu+on(BFS)3. YoucanmovefromoneBFStoaneighboringBFS4. YoucandetectwhetheraBFSisop+mal5. FromanyBFS,youcanmovetoaBFSwithbe7er
acost
Basicfeasiblesolu+on(BFS)min c1x1 + . . .+ cnxn
subject to
a11x1 + . . .+ a1nxn b1
. . .
am1x1 + . . .+ amnxn bm
xi � 0 (1 i n)
Linear Programs
7
Tuesday, 11 June 13
Basicfeasiblesolu+on(BFS)
a11x1 + . . .+ a1nxn = b1
. . .
am1x1 + . . .+ amnxn = bm
xi � 0 (1 i n)
Algebraic View: BFS
Goal: How to find solutions to linear systems
8
Tuesday, 11 June 13
Basicfeasiblesolu+on(BFS)
x1 = b1 +nX
i=m+1
a1i xi
. . .
xm = bm +nX
i=m+1
ami xi
Algebraic View: BFS
Basic Solution
9
Tuesday, 11 June 13
Basicfeasiblesolu+on(BFS)
a11x1 + . . .+ a1nxn = b1
. . .
am1x1 + . . .+ amnxn = bm
xi � 0 (1 i n)
Algebraic View: BFS
Goal: How to find solutions to linear systems
10
Tuesday, 11 June 13
Basicfeasiblesolu+on(BFS)
x1 = b1 +nX
i=m+1
a1i xi
. . .
xm = bm +nX
i=m+1
ami xi
Feasible if 8i 2 1..m : bi � 0
Algebraic View: BFS
Basic Feasible Solution
12
Tuesday, 11 June 13
Basicfeasiblesolu+on(BFS)
• Selectmvariables– Willbethebasicvariables
• Re-writethemusingonlynon-basicvariables– Gaussianelimina+on
• Ifalltheb’sarenon-nega+ve– WehaveaBFS
Basicfeasiblesolu+on(BFS)
• Re-writetheconstraintsasequali+es– Withslackvariables
• Selectmvariables– Willbethebasicvariables
• Re-writethemusingonlynon-basicvariables– Gaussianelimina+on
• Ifalltheb’sarenon-nega+ve– WehaveaBFS
Naïvealgorithm
• Generateallbasicfeasiblesolu+ons– i.e.,selectmbasicvariables,performGaussianelim.– testwhetheritisfeasible
• SelecttheBFSwiththebestcost
• But, n!m!(n−m)!
Canweexplorethisspacemoreefficiently?
Simplexalgorithm
• Outline1. Anop+malsolu+onisatavertex2. Avertexisabasicfeasiblesolu+on(BFS)3. YoucanmovefromoneBFStoaneighboringBFS4. YoucandetectwhetheraBFSisop+mal5. FromanyBFS,youcanmovetoaBFSwithbe7er
acost
Simplexalgorithm
• Localsearchalgorithm
• MovefromBFStoBFS
• Guaranteedtofindaglobalop+mum– Duetoconvexity
Keyidea:Howdowedothismoveopera+on?
Simplexalgorithm
• MovetoanotherBFS(localsearch)– Selectanon-basicvariablewithnega+vecoeff.(enteringvariable)
– Replaceabasicvariablewiththisselec+on(leavingvariable)
– PerformGaussianelimina+on
Simplexalgorithmx3 = 1 � 3x1 � 2x2
x4 = 2 � 2x1 + x6
x5 = 3 � x1 + x6
From BFS to BFS
9
Tuesday, 11 June 13
Simplexalgorithmx3 = 1 � 3x1 � 2x2
x4 = 2 � 2x1 + x6
x5 = 3 � x1 + x6
From BFS to BFS
10
Tuesday, 11 June 13
Simplexalgorithm
MovetoanotherBFS:• Selecttheenteringvariablexe– Non-basicvariablewithnega+vecoeff.
• Selecttheleavingvariablexltomaintainfeasibility• ApplyGaussianelimina+on– i.e.,eliminatexe fromthetherighthandside
• Pivot(e,l)
Simplexalgorithm
• Outline1. Anop+malsolu+onisatavertex2. Avertexisabasicfeasiblesolu+on(BFS)3. YoucanmovefromoneBFStoaneighboringBFS4. YoucandetectwhetheraBFSisop+mal5. FromanyBFS,youcanmovetoaBFSwithbe7er
acost
Simplexalgorithmmin 6 � 3x1 � 3x2
subject to
x3 = 1 � 3x1 � 2x2
x4 = 2 � 2x1 + x2
x5 = 3 + x1 � 3x2
From BFS to BFS
19
Tuesday, 11 June 13
Simplexalgorithmmin 6 � 3x1 � 3x2
subject to
x3 = 1 � 3x1 � 2x2
x4 = 2 � 2x1 + x2
x5 = 3 + x1 � 3x2
From BFS to BFS
19
Tuesday, 11 June 13
Simplexalgorithmmin 6 � 3x1 � 3x2
subject to
x3 = 1 � 3x1 � 2x2
x4 = 2 � 2x1 + x2
x5 = 3 + x1 � 3x2
From BFS to BFS
19
Tuesday, 11 June 13
Simplexalgorithm
• Outline1. Anop+malsolu+onisatavertex2. Avertexisabasicfeasiblesolu+on(BFS)3. YoucanmovefromoneBFStoaneighboringBFS4. YoucandetectwhetheraBFSisop+mal5. FromanyBFS,youcanmovetoaBFSwithbe7er
acost
Simplexalgorithm
• Localmoveimprovestheobjec+vevalue• InaBFS,assumethat– b1>0,b2>0,…,bm>0– thereexistsanenteringvariableewithce<0
• Then,themovepivot(e,l)isimproving
Simplexalgorithm
• If– b1,b2,…,bmarestrictlyposi+ve– objec+vefunc+onisboundedbelow
• Algorithmterminateswithanop+malsolu+on
Simplexalgorithm
• Basicsolu+on
• WhatifIincreasethevalueofx1– Solu+onremainsfeasible,but– Valueofobjec+vefunc+ondecreases
Simplexalgorithm
• Outline1. Anop+malsolu+onisatavertex2. Avertexisabasicfeasiblesolu+on(BFS)3. YoucanmovefromoneBFStoaneighboringBFS4. YoucandetectwhetheraBFSisop+mal5. FromanyBFS,youcanmovetoaBFSwithbe7er
acost
Needtofindanewwaytoguaranteetermina+on
Simplexalgorithm
• Termina+on– Blandrule:selectalwaysthefirstenteringvariablelexicographically
– Lexicographicpivo+ngrule:break+eswhenselec+ngtheleavingvariable
– Pertuba+onmethods
Simplexalgorithm
1. FindaBFS
• Feasibleiftheobjec+vevalueis0– i.e.,allyi’sare0,andthereisaBFSwithoutyi(almostalways)