100 likes | 316 Views
Linear Programming. Overview Formulation of the problem and example I ncremental, deterministic algorithm Randomized algorithm Unbounded linear programs Linear programming in higher dimensions. Algorithm 2D-LP. Input: A 2-Dimensional Linear Program (H, c )
E N D
Linear Programming • Overview • Formulation of the problem and example • Incremental, deterministic algorithm • Randomized algorithm • Unbounded linear programs • Linear programming in higher dimensions Computational Geometry Prof. Dr. Th. Ottmann
Algorithm 2D-LP Input: A 2-Dimensional Linear Program (H, c ) Output: Either one optimal vertex or or a ray along which (H, c ) is unbounded. if UnboundedLP(H, c ) reports (H, c ) is infeasible thenreturn UnboundedLP(H, c ) else h1 := h; h2 := h´ ; v2 := l1 l2 h3,...,hn := remaining half-planes of H for i:= 3 to n do if vi-1 hi then vi:=vi-1 else Si-1:= Hi-1 * li vi:= 1-dim-LP(Si-1, c ) if vi not exists then return return vn Running time: O(n²) Computational Geometry Prof. Dr. Th. Ottmann
New problem • Find the point x on li that maximizes cx , subject to • the constraints x hj, for 1 j i –1 • Observation: li hj is a ray • Let Si-1 := { h1 li, ..., hi-1 li} • 1-dim-LP{Si-1, c } • p1 = s1 • for j := 2 to i-1 do • pj = pj-1 sj • if pi-1then • return the optimal vertex of pi-1else • return • Time: O(i) Computational Geometry Prof. Dr. Th. Ottmann
Bad 11 12 9 10 7 8 5 6 3 4 1 2 vi Good 1 2 3 4 5 6 7 8 9 10 11 12 Sequences Computational Geometry Prof. Dr. Th. Ottmann
h4 h1 h3 v3= v4 h2 h4 h1 h3 c h5 c h2 v4 v5 Optimal Vertex Computational Geometry Prof. Dr. Th. Ottmann
Input: A 2-Dimensional Linear Program (H, C ) Output: Either one optimal vertex or or a ray along which (H, C ) is unbounded. if UnboundedLP(H, C ) {h, h´} thenreturn UnboundedLP(H, C ) h1 := h; h2 := h´ ; v2 := l1 l2 h3,...,hn := remaining half-planes of H for i:= 3 to n do if vi-1 hi then vi := vi-1 else Si-1 := Hi-1 * li vi:= 1-dim-LP(Si-1, C ) if vi does not exist then return return vn Running time: O(n²) Algorithm 2D-LP Computational Geometry Prof. Dr. Th. Ottmann
Bad 11 12 9 10 7 8 5 6 3 4 1 2 vi Good 1 2 3 4 5 6 7 8 9 10 11 12 Sequences Computational Geometry Prof. Dr. Th. Ottmann
Algorithm 2D-LP Input: A 2-Dimensional Linear Program (H, C ) Output: Either one optimal vertex or or a ray along which (H, C ) is unbounded. if UnboundedLP(H, C ) {h, h´} then return UnboundedLP(H, C ) h1 := h; h2 := h´ ; v2 := l1 l2 h3,...,hn := remaining half-planes of H compute a random permutation h3, ..., hn for i:= 3 to n do if vi-1 hithen vi:=vi-1 else Si-1 := Hi-1 * li vi := 1-dim-LP(Si-1, C ) if vi does not exist then return return vn Running time: O(n²) Computational Geometry Prof. Dr. Th. Ottmann
Randomization Theorem:The2-dimensional linear programming problem with nconstraints can be solved in O(n) randomized expected time using worst-case linear storage. Computational Geometry Prof. Dr. Th. Ottmann
Xi = Random Variable xi E[xi] is the probability that vi-1 hi Computational Geometry Prof. Dr. Th. Ottmann