halfplane intersection and linear programming
TRANSCRIPT
![Page 1: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/1.jpg)
Halfplane Intersectionand
Linear Programming
Dan Halperin, Tel Aviv University
Figures and pseudocode taken from:
CGAA: Chapter 4 in Computational Geometry Algorithms and Applications, de Berg et al
![Page 2: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/2.jpg)
Overview
β’ The casting problem
β’ Half-plane intersection
β’ Linear programming (LP) in low dimensions
β’ Minimum enclosing disc
β’ The casting problem, take II (later on in the semester)
![Page 3: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/3.jpg)
Credits
β’ CGAA: Chapter 4 in Computational Geometry Algorithms and Applications, Linear Programming, by de Berg et al
β’ L5vK: Lecture 5 in Computational Geometry, Casting a polyhedron, by Marc van Kreveld
![Page 4: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/4.jpg)
Slides, Part I
β’ Lecture 5 in Computational Geometry, Casting a polyhedron, by Marc van Kreveld (Slides4a):β’ The casting problem
β’ Half-plane intersection
β’ Linear programming (LP) in low dimensions
β’ Supplements, here:β’ The space of directions
β’ Probabilistic analysis of LP2D
β’ Unbounded LP2D
β’ LP3D
![Page 5: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/5.jpg)
The space of directions
![Page 6: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/6.jpg)
[blog.weatherflow.com]
![Page 7: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/7.jpg)
Representing directions in the plane
β’ Using the unit circle π1
β’ The point π represents the vector from the origin to π
![Page 8: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/8.jpg)
Representing upward directions
β’ Using the line π¦ = 1
β’ The point πβ² represents the vector from the origin to πβ²
![Page 9: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/9.jpg)
Representing directions in (3-)space
β’ Using the unit sphere π2
β’ Upward directions: the plane π§ = 1
![Page 10: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/10.jpg)
LP2D randomized, boundedAnalysis
![Page 11: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/11.jpg)
![Page 12: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/12.jpg)
Running time analysis
β’ Random permutation: π(π)
β’ Line 5, the `easyβ case, π£π β 1 β π»π : π(π) (π£ subscript π minus 1)
β’ It remains to estimate the running time of all the `hardβ cases
β’ Let ππ be the indicator random variable, which is 1 if Step π is a hard case and 0 otherwise
β’ The running time of all the hard cases: Οπ=1π π π ππ
β’ Randomized analysisβthe expected value of the running time πΈ(Οπ=1
π π π ππ)
![Page 13: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/13.jpg)
β’ In what follows, we assume that the first two half-planes β1, β2 are fixed, so our randomized analysis focuses on steps π = 3,β¦ , π
![Page 14: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/14.jpg)
Running time analysis, contβd
β’ Randomized analysisβthe expected value of the running time πΈ(Οπ=3
π π π ππ)
β’ Using linearity of expectation, πΈ(Οπ=3π π π ππ) = Οπ=3
π π π πΈ(ππ)
β’ πΈ ππ = ?
β’ The expected value of an indicator random variable is the probability that ππ = 1
β’ Letβs start with ππ
![Page 15: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/15.jpg)
The last step
β’ What is the probability that ππ = 1?
β’ Pr[ππ = 1]β€2
πβ2
β’ Why at most?β’ more than two lines meet at π£πβ’ π£π is defined by β1 or β2
[CGAA]
![Page 16: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/16.jpg)
The πth step
β’ What is the probability that ππ = 1?
β’ Letβs first assume that the set of half-planes β3 β¦ βπ is fixed
β’ Then the previous argument holds and the probability is β€2
πβ2
β’ But every subset of π β 2 half-planes has the same probability to be those β3 β¦ βπ
β’ Hence, Pr[ππ = 1]β€2
πβ2
![Page 17: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/17.jpg)
Summary
β’ πΈ(Οπ=3π π π ππ) = Οπ=3
π π π πΈ(ππ) β€ Οπ=3π π π
2
πβ2= π(π)
β’ Together with the other costs, the algorithm runs in expected π(π) time
![Page 18: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/18.jpg)
LP2D unbounded
![Page 19: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/19.jpg)
Possible outcomes of LP2D
β’ We now consider also the case where the program may be unbounded
β’ Possible output:β’ The optimal (maximal) solution, as before
β’ The program is infeasible, as before
β’ The program is unbounded: a ray along which the solution gets arbitrarily large values
![Page 20: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/20.jpg)
Overall scheme for general LP2D
β’ We will start by testing for the unbounded case, with possible outcomes:β’ The program is infeasible, stop
β’ The program is unbounded, with the desired ray, stop
β’ The program is bounded, together with two witness half-planes β1, β2 for the boundedness, continue to the previous, bounded, procedure
β’ Notice that our guarantee that the program is bounded does not preclude the case that it is infeasible, which will be found by the previous (bounded) procedure
![Page 21: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/21.jpg)
Notation
β’ LP2D(π», Τ¦π)
β’ π» = {β1, β¦ , βπ}
β’ Τ¦π is the objective vector
β’ The LP is unbounded if there is a ray π fully contained in the feasible region and such that the objective function grows arbitrarily as we proceed along π away from its terminus π
β’ We denote the rayβs direction by Τ¦π
β’ π = {π + π Τ¦π: π > 0}
![Page 22: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/22.jpg)
Notation, contβd
β’ For a half-plane β β π» , Τ¦π (β) is the normal to the line defining the half-plane and pointing into the feasible region of β
![Page 23: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/23.jpg)
Necessary conditions for unboundedness
π = {π + π Τ¦π: π > 0}
β’ Τ¦π β Τ¦π > 0
β’ for each half-plane β β π» , Τ¦π (β) β Τ¦π β₯ 0
Let π»β² = {β β π»: Τ¦π (β) β Τ¦π = 0}, the we also require the following boundary condition:
β’ the linear program π»β², Τ¦π is feasible
![Page 24: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/24.jpg)
Conditions for unboundedness
Claim: (π», Τ¦π) is unbounded iff there is a direction Τ¦π with Τ¦π β Τ¦π > 0 such that for each β β π» , Τ¦π (β) β Τ¦π β₯ 0 , and the linear program π»β², Τ¦π is feasible
β’ We showed that the conditions are necessary. We will show that they are sufficient by constructing the witness ray π
![Page 25: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/25.jpg)
Constructing the ray π
β’ Assume Τ¦π = (0,1)
β’ Then the ray must be directed upward, and we can represent the possible directions Τ¦π by the line π¦ = 1, Τ¦π =(dx,1)
β’ Every constraint of the form Τ¦π (β) β Τ¦π β₯ 0 becomes a half-line, ray, on the line π¦ = 1
β’ The valid directions:
The intersection of all
these rays
![Page 26: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/26.jpg)
The valid directions
β’ Recall
[L5vK]
![Page 27: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/27.jpg)
β’ Assume first that the intersection is not empty
β’ We take the direction at the left endpoint of the interval (if it is bounded only on the right, we take the right endpoint)
β’ Denote it by Τ¦π
β’ We first need to check that Τ¦π is valid (relevant only if the interval is a single point)
β’ The validity check is in the original plane, where we aim to construct the ray π
β’ The test: is the linear program π»β², Τ¦π is feasible
![Page 28: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/28.jpg)
Is the linear program π»β², Τ¦π is feasible?
β’ Recall: π»β² = {β β π»: Τ¦π (β) β Τ¦π = 0}
β’ Outcome 1: If infeasible, report that the original LP infeasible and stop
![Page 29: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/29.jpg)
If π»β², Τ¦π is feasible
β’ Outcome 2: Stick to the left wall of the feasible region and construct the ray there
![Page 30: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/30.jpg)
If no valid direction Τ¦π exists
β’ Namely ππ > ππ, then the half-planes inducing ππ and ππ are witnesses to the boundedness of the LP
β’ Outcome 3: Go to the bounded procedure and start with these two half-planes as β1 and β2
![Page 31: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/31.jpg)
LP3D
![Page 32: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/32.jpg)
The input
β’ LP3D(π», Τ¦π)
β’ π» = β1, β¦ , βπ , half-spacesβ’ βπ is bounded by the plane ππ
β’ Τ¦π is the objective vector
β’ Assume we have already run LP3DUnbounded, and obtained three witnesses to the boundedness of LP3D(π», Τ¦π)
β’ Letβs rename these three half-space β1, β2, β3β’ They define an optimum π£3
![Page 33: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/33.jpg)
The incremental step
β’ We now add β4β’ If π£3 β β4 then π£4: = π£3β’ Else, π£4 lies on π4
β’ How do we find π£4?
[gdbooks/3dcollisions]
![Page 34: Halfplane Intersection and Linear Programming](https://reader033.vdocuments.site/reader033/viewer/2022051114/62774d4d44e0e7263c2bef7a/html5/thumbnails/34.jpg)
THE END