CMPS 3130/6130 Computational Geometry Spring 2017

Slides:



Advertisements
Similar presentations
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Advertisements

C&O 355 Lecture 23 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Linear Programming Problem
Approximation Algorithms Chapter 14: Rounding Applied to Set Cover.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
1/13/15CMPS 3130/6130: Computational Geometry1 CMPS 3130/6130: Computational Geometry Spring 2015 Convex Hulls Carola Wenk.
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
How should we define corner points? Under any reasonable definition, point x should be considered a corner point x What is a corner point?
8/29/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk.
Algorithms Lecture 10 Lecturer: Moni Naor. Linear Programming in Small Dimension Canonical form of linear programming Maximize: c 1 ¢ x 1 + c 2 ¢ x 2.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part IV Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,
Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,
Half-Space Intersections
Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,
Linear Programming Computational Geometry, WS 2007/08 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Linear Programming Computational Geometry, WS 2007/08 Lecture 7, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
6s-1Linear Programming CHAPTER 6s Linear Programming.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Lecture 4: Linear Programming Computational Geometry Prof. Dr. Th. Ottmann 1 Linear Programming Overview Formulation of the problem and example Incremental,
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Linear Programming Chapter 13 Supplement.
Computational Geometry Piyush Kumar (Lecture 5: Linear Programming) Welcome to CIS5930.
Linear Programming Piyush Kumar. Graphing 2-Dimensional LPs Example 1: x y Feasible Region x  0y  0 x + 2 y  2 y  4 x  3 Subject.
1 1 Slide Linear Programming (LP) Problem n A mathematical programming problem is one that seeks to maximize an objective function subject to constraints.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Line Arrangement Chapter 6. Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
Linear Programming: A Geometric Approach3 Graphing Systems of Linear Inequalities in Two Variables Linear Programming Problems Graphical Solution of Linear.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
1 Prune-and-Search Method 2012/10/30. A simple example: Binary search sorted sequence : (search 9) step 1  step 2  step 3  Binary search.
1 Max 8X 1 + 5X 2 (Weekly profit) subject to 2X 1 + 1X 2  1000 (Plastic) 3X 1 + 4X 2  2400 (Production Time) X 1 + X 2  700 (Total production) X 1.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. 6S Linear Programming.
Soham Uday Mehta. Linear Programming in 3 variables.
CMPS 3130/6130 Computational Geometry Spring 2015
Warm-upWarm-up Sketch the region bounded by the system of inequalities: 1) 2) Sketch the region bounded by the system of inequalities: 1) 2)
Linear Programming: Formulations, Geometry and Simplex Method Yi Zhang January 21 th, 2010.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
© 2009 Prentice-Hall, Inc. 7 – 1 Decision Science Chapter 3 Linear Programming: Maximization and Minimization.
UNC Chapel Hill M. C. Lin Randomized Linear Programming For any set of H of half-planes, there is a good order to treat them. Thus, we can improve the.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Linear Programming: A Geometric Approach3 Graphing Systems of Linear Inequalities in Two Variables Linear Programming Problems Graphical Solution of Linear.
Computational Geometry
CMPS 3130/6130 Computational Geometry Spring 2017
Chapter 2 An Introduction to Linear Programming
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
CMPS 3130/6130 Computational Geometry Spring 2017
Linear Programming in Two Dimensions
Linear Programming CISC4080, Computer Algorithms CIS, Fordham Univ.
CHAPTER 4. LINEAR PROGRAMMING
I. The Problem of Molding
CISC5835, Algorithms for Big Data
Max Z = x1 + x2 2 x1 + 3 x2  6 (1) x2  1.5 (2) x1 - x2  2 (3)
CMPS 3130/6130: Computational Geometry Spring 2017
Computational Geometry
CMPS 3120: Computational Geometry Spring 2013
Linear Programming Problem
Graphical solution A Graphical Solution Procedure (LPs with 2 decision variables can be solved/viewed this way.) 1. Plot each constraint as an equation.
The Selection Problem.
Presentation transcript:

CMPS 3130/6130 Computational Geometry Spring 2017 Linear Programming & Halfplane Intersection Carola Wenk 3/21/17 CMPS 3130/6130 Computational Geometry

CMPS 3130/6130 Computational Geometry Optimization Problem A company produces tables and chairs. The profit for a chair is $2, and for a table $4. Machine group A needs 4 hours to produce a chair, and 6 hours for a table. Machine group B needs 2 hours to produce a chair, and 6 hours for a table. Per day there are at most 120 working hours for group A, and 72 working ours for group B. How many chairs and tables should the company produce per day in order to maximize the profit? Variables: cA: # chairs produced on machine group A cB: # chairs produced on machine group B tA: # tables produced on machine group A tB: # tables produced on machine group B Constraints: 4 cA + 6 tA ≤ 120 2 cB + 6 tB ≤ 72 Objective function (profit): Maximize 2(cA + cB) + 4(tA + tB) 3/21/17 CMPS 3130/6130 Computational Geometry

Linear Program (LP) Linear Program in d variables with n constraints. 𝑎 11 ⋯ 𝑎 1𝑑 ⋮ ⋱ ⋮ 𝑎 𝑛1 ⋯ 𝑎 𝑛𝑑 ∙ 𝑥 1 ⋮ 𝑥 𝑑 ≤ 𝑏 1 ⋮ 𝑏 𝑛 𝑓 𝑐 ( 𝑥 )= 𝑥 1 ⋮ 𝑥 𝑑 ∙ 𝑐 1 ⋮ 𝑐 𝑑 𝑥 ∙ 𝑐 𝐴∙ 𝑥 ≤ 𝑏 Variables: x1,…, xd Constraints: h1: a11 x1 +…+ a1d xd ≤ b1 h2: a21 x1 +…+ a2d xd ≤ b2 hn: an1 x1 +…+ and xd ≤ bn Objective function: Maximize 𝑓 𝑐 𝑥 ≔ c1 x1 + c2 x2 + …+ cd xd … … Linear Program in d variables with n constraints. 3/21/17 CMPS 3130/6130 Computational Geometry

Linear Program (LP) 𝐴∙ 𝑥 ≤ 𝑏 Variables: x1,…, xd Constraints: h1: a11 x1 +…+ a1d xd ≤ b1 h2: a21 x1 +…+ a2d xd ≤ b2 hn: an1 x1 +…+ and xd ≤ bn Objective function: Maximize 𝑓 𝑐 𝑥 ≔ c1 x1 + c2 x2 + …+ cd xd 𝑎 11 ⋯ 𝑎 1𝑑 ⋮ ⋱ ⋮ 𝑎 𝑛1 ⋯ 𝑎 𝑛𝑑 ∙ 𝑥 1 ⋮ 𝑥 𝑑 ≤ 𝑏 1 ⋮ 𝑏 𝑛 … … Each constraint hi is a half-space in Rd. Set of points in Rd satisfying all constraints: 𝑖=1 𝑛 ℎ 𝑖 feasible region of the LP Maximizing 𝑓 𝑐 𝑥 = 𝑥 ∙ 𝑐  Finding a point 𝑥 that is extreme in direction 𝑐 3/21/17 CMPS 3130/6130 Computational Geometry

Subproblem: Half-Plane Intersection Given: A set H={h1,…, hn} of halfplanes hi : ai x + bi y ≤ ci , i=1..n, with ai , bi , ci constants. Find: 𝑖=1 𝑛 ℎ 𝑖 set of points 𝑥 𝑦 ∈ 𝑹 2 satisfying all n constraints at the same time Convex polygonal region bounded by at most n edges 3/21/17 CMPS 3130/6130 Computational Geometry

Divide & Conquer Algorithm Algorithm Intersect_Halfplanes(H): Input: A set H of n half-planes in R2 Output: The convex polygonal region C:= ℎ∈𝐻 ℎ 𝑖 if |H|=1 then C:= ℎ∈𝐻 else Split H into sets H1 and H2 of size 𝑛/2 and 𝑛/2 C1 := Intersect_Halfplanes(H1) C2 := Intersect_Halfplanes(H2) C := Intersect_Convex_Regions(C1, C2) Can implement Intersect_Convex_Regions using a sweep in O(n) time: Just update constant-complexity interval intersecting the sweep line Runtime recurrence is T(n)=2T(n/2)+n, and hence the runtime is O(n log n) 3/21/17 CMPS 3130/6130 Computational Geometry

Incremental Linear Programming Two-dimensional linear programming (LP) problem: H={h1,…, hn}, 𝑐 Assume the LP is bounded (otherwise add constraints) Assume that there is a unique solution (if any) Incremental approach: Add one half-plane after the other 𝐻 𝑖 = ℎ 1 ,…, ℎ 𝑖 𝐶 𝑖 = ℎ 1 ∩…∩ ℎ 𝑖 ; 𝑣 𝑖 = unique optimal vertex for feasible region 𝐶 𝑖 , for 𝑖≥2 Then: 𝐶 1 ⊇ 𝐶 2 ⊇…⊇ 𝐶 𝑛 =𝐶  If 𝐶 𝑖 =∅ for some 𝑖, then 𝐶 𝑗 =∅ for all j≥𝑖 Lemma: Let 2≤𝑖≤𝑛 If 𝑣 𝑖−1 ∈ ℎ 𝑖 then 𝑣 𝑖 = 𝑣 𝑖−1 If 𝑣 𝑖−1 ∉ ℎ 𝑖 then 𝐶 𝑖 =∅ or 𝑣 𝑖 ∈ 𝑙 𝑖 ≔ line bounding ℎ 𝑖 Take lexicographically smallest solution 𝐶 := 𝐶 𝑛 = ℎ∈𝐻 ℎ 3/21/17 CMPS 3130/6130 Computational Geometry

Handle case (ii): 𝑣 𝑖−1 ∉ ℎ 𝑖 Let 𝑓 𝑐 :𝑹→𝑹 𝑥↦ 𝑓 𝑐 (𝑥, 𝑙 𝑖 𝑥 ) restriction of 𝑓 𝑐 to 𝑙 𝑖 Need to solve 1-dimensional LP: Maximize 𝑓 𝑐 subject to 𝑥≥𝜎 ℎ, 𝑙 𝑖 , ℎ∈ 𝐻 𝑖−1 and 𝑙 𝑖 ∩ℎ is bounded to the left 𝑥≤𝜎 ℎ, 𝑙 𝑖 , ℎ∈ 𝐻 𝑖−1 and 𝑙 𝑖 ∩ℎ is bounded to the right Feasible region is [ 𝑥 𝑙𝑒𝑓𝑡 , 𝑥 𝑟𝑖𝑔ℎ𝑡 ] with 𝑥 𝑙𝑒𝑓𝑡 ≔ max ℎ∈ 𝐻 𝑖−1 𝜎 ℎ, 𝑙 𝑖 𝑙 𝑖 ∩ℎ is bounded to the left} 𝑥 𝑟𝑖𝑔ℎ𝑡 ≔ max ℎ∈ 𝐻 𝑖−1 𝜎 ℎ, 𝑙 𝑖 𝑙 𝑖 ∩ℎ is bounded to the right} If 𝑥 𝑙𝑒𝑓𝑡 > 𝑥 𝑟𝑖𝑔ℎ𝑡 the LP is infeasible. Otherwise, either 𝑥 𝑙𝑒𝑓𝑡 or 𝑥 𝑟𝑖𝑔ℎ𝑡 is the optimum We can compute a new optimal vertex 𝑣 𝑖 , or decide that the LP is infeasible, in O(i) time. 3/21/17 CMPS 3130/6130 Computational Geometry

Algorithm Runtime: O( 𝑖=1 𝑛 𝑖 ) = O(n2) Storage: O(n) Algorithm 2D_Bounded_LP(H, 𝑐 ): Input: A two-dimensional LP (H, 𝑐 ) Output: Report if (H, 𝑐 ) is infeasible. Otherwise report the lexicographically smallest point that maximizes 𝑓 𝑐 Let ℎ 1 , …, ℎ 𝑛 be the half-planes of H Let 𝑣 2 be the corner of 𝐶 2 . // 𝑣 2 exists since we assume the LP is bounded for i:=3 to n if 𝑣 𝑖−1 ∈ ℎ 𝑖 then 𝑣 𝑖 ≔𝑣 𝑖−1 else 𝑣 𝑖 ≔ point on 𝑙 𝑖 that maximizes 𝑓 𝑐 subject to the constraints in 𝐻 𝑖−1 if such a point does not exist then Report that the LP is infeasible, and return. return 𝑣 𝑛 O(1) O(i) Runtime: O( 𝑖=1 𝑛 𝑖 ) = O(n2) Storage: O(n) In this example, each step takes O(i) time 𝑐 3/21/17 CMPS 3130/6130 Computational Geometry

Randomized Incremental Linear Programming Insertion order of the halfplanes determines the runtime  Varies between O(n) and O(n2) Algorithm 2D_Randomized_Bounded_LP(H, 𝑐 ) inserts the halfplanes in random order Theorem: 2D_Randomized_Bounded_LP runs in O(n) randomized expected time and O(n) worst-case space. Proof: Random variable 𝑋 𝑖 = 1, 𝑣 𝑖−1 ∉ ℎ 𝑖 0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 Total time spent in the else-part of the algorithm to solve 1-dimensional LPs, over all half-planes ℎ 1 , …, ℎ 𝑛 : 𝑖=1 𝑛 𝑂 𝑖 ∙ 𝑋 𝑖 Bound expected value (use linearity of expectation): 𝐸( 𝑖=1 𝑛 𝑂(𝑖)∙ 𝑋 𝑖 )= 𝑖=1 𝑛 𝑂(𝑖)∙𝐸( 𝑋 𝑖 ) and 𝐸 𝑋 𝑖 =𝑃 𝑋 𝑖 =1 =𝑃( 𝑣 𝑖−1 ∉ ℎ 𝑖 ) 3/21/17 CMPS 3130/6130 Computational Geometry

Randomized Incremental Linear Programming Apply backwards analysis to bound 𝐸 𝑋 𝑖 =𝑃 𝑋 𝑖 =1 =𝑃( 𝑣 𝑖−1 ∉ ℎ 𝑖 ): Fix 𝐻 𝑖 ={ ℎ 1 ,…, ℎ 𝑖 }; this determines 𝐶 𝑖 Analyze what happened in the last step when ℎ 𝑖 was added 𝑃(Had to compute new optimal vertex when adding ℎ 𝑖 ) = 𝑃(Optimal vertex changes when we remove a halfplane from 𝐶 𝑖 ) ≤ 2 𝑖 Hence 𝐸 𝑋 𝑖 ≤ 2 𝑖 Therefore the total expected runtime is 𝑖=1 𝑛 𝑂 𝑖 ∙ 2 𝑖 =𝑂(𝑛) 2 𝑖 2 out of 𝑖 halfplanes defining 𝑣 𝑖 3/21/17 CMPS 3130/6130 Computational Geometry