Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,

Similar presentations


Presentation on theme: "Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,"— Presentation transcript:

1 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental, deterministic algorithm Randomized algorithm Unbounded linear programs Linear programming in higher dimensions

2 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 2 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 then return UnboundedLP(H, c ) elseh 1 := h; h 2 := h´ ; v 2 := l 1  l 2 h 3,...,h n := remaining half-planes of H for i:= 3 to n do if v i-1  h i then v i :=v i-1 else S i-1 := H i-1  * l i v i := 1-dim-LP(S i-1, c ) if v i not exists then return  return v n Running time: O(n²)

3 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 3 New problem Find the point x on l i that maximizes cx, subject to the constraints x  h j, for 1  j  i –1 Observation: l i  h j is a ray Let S i-1 := { h 1  l i,..., h i-1  l i } 1.1-dim-LP{S i-1, c } 2.p 1 = s 1 3.for j := 2 to i-1 do 4. p j = p j-1  s j 5.if p i-1   then 6. return the optimal vertex of p i-1 else 7. return  Time: O(i)

4 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 4 Sequences 1 2 34 56 78 9 1010 1 1212 vivi GoodGood 1 2 34 5 6 78 91010 1 1212 BadBad

5 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 5 Optimal Vertex h1h1 h2h2 h3h3 h4h4 v 3 = v 4 c h1 h1 h2 h2 h3 h3 h4 h4 h5 h5 c v4 v4 v5v5

6 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 6 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 ) h 1 := h; h 2 := h´ ; v 2 := l 1  l 2 h 3,...,h n := remaining half-planes of H for i:= 3 to n do if v i-1  h i then v i := v i-1 else S i-1 := H i-1  * l i v i := 1-dim-LP(S i-1, C ) if v i does not exist then return  return v n Running time: O(n²)

7 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 7 Sequences 1 2 34 56 78 9 1010 1 1212 vivi GoodGood 1 2 34 5 6 78 91010 1 1212 BadBad

8 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 8 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 ) h 1 := h; h 2 := h´ ; v 2 := l 1  l 2 h 3,...,h n := remaining half-planes of H compute a random permutation h 3,..., h n for i:= 3 to n do if v i-1  h i then v i :=v i-1 else S i-1 := H i-1  * l i v i := 1-dim-LP(S i-1, C ) if v i does not exist then return  return v n Running time: O(n²)

9 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 9 Randomization Theorem: The 2-dimensional linear programming problem with n constraints can be solved in O(n) randomized expected time using worst-case linear storage.

10 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 10 Random Variable x i X i = E[x i ] is the probability that v i-1  h i

11 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 11 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 ) h 1 := h; h 2 := h´ ; v 2 := l 1  l 2 h 3,...,h n := remaining half-planes of H for i:= 3 to n do if v i-1  h i then v i := v i-1 else S i-1 := H i-1  * l i v i := 1-dim-LP(S i-1, C ) if v i does not exist then return  return v n Running time: O(n²)

12 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 12 Unbounded Linear Programs hihi ii :=The outward normal of h i  i := The smaller angle that  makes with c I min, an index with  i min = min  j, 1  j  n   c

13 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 13 H min := { h j  H | = min } H par := { h j  H | = - min } H par { H min { H par { H min { h i* c

14 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 14 Lemma Let H = {h 1,h 2,...,h n } be a set of half-planes. Assuming that  (H min  H par ) is not empty. 1.If l i*  h j* is unbounded in the direction c for every half- plane h j in the set H\ (H min  H par ), then (H, c ) is unbounded along a ray contained in l i*. 2.If l i*  h j* is bounded in the direction c for some h j* in H\ (H min  H par ), then the linear program ({h i*, h j* }, c ) is bounded.

15 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 15 Algorithm UNBOUNDEDLP Input:A 2-Dimensional Linear Program (H, C ) Output: Either one optimal vertex or  or a ray along which (H, C ) is unbounded. 1.For each half plane h i  H compute  j 2.Let hi be half plane with  j = min  j, 1  j  n 3.H min := { h j  H | = min } 4.H par := { h j  H | = - min } 5. = H\ (H min  H par ), compute intersection in H min  H par 6.If the intersection is empty then report (H, C ) is feasible else Let h i  H min be the half-plane whose line bound the intersection if there is half plane h j*  suchthat l i*  h j* bounded in C then report ({h i*, h j* }, C ) is bounded else report is bounded along l i*  (  )

16 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 16 Higher Dimensions Let h 1,...,h d H be the d certificate half-spaces that UNBOUNDEDLP returns. C i := h 1  h 2 ...  h i Lemma: Let d < i  n, and let C i be defined as above. 1. If v i-1  h i, then v i = v i-1 2. If v i-1  h i, then either C i =  or v i  g i, where g i is the hyperplane that bounds h i.

17 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 17 Algorithm RANDOMIZEDLP Input : A 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 unbounded then Report the information and, ray along which (H, c ) is unbounded. else Let h 1,...,h d  H he the certificate halfplanes returned by UNBOUNDEDLP, and let v d be their vertex of intersection Compute a random permutation h d+1,...,h n for i = d+1 to n do if v i-1  h i then v i = v i-1 else v i = the point p on gi that maximizes f (p) if p does not exist then report infeasible and quit. Return v n

18 Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 18 Theorem The d-dimensional linear programming problem with n constraints can be solved in O(d!n) expected time using linear storage.


Download ppt "Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,"

Similar presentations


Ads by Google