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.

Slides:



Advertisements
Similar presentations
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Lecture #3; Based on slides by Yinyu Ye
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.
Dragan Jovicic Harvinder Singh
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
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.
Convex Hulls in 3-space Jason C. Yang.
Linear Programming Fundamentals Convexity Definition: Line segment joining any 2 pts lies inside shape convex NOT convex.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Convexity of Point Set Sandip Das Indian Statistical Institute.
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,
Prune-and-search Strategy
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.
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part III 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,
Linear Programming Computational Geometry, WS 2006/07 Lecture 5, Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Approximation Algorithms: Bristol Summer School 2008 Seffi Naor Computer Science Dept. Technion Haifa, Israel TexPoint fonts used in EMF. Read the TexPoint.
Chapter 3 An Introduction to Linear Programming
HAWKES LEARNING SYSTEMS math courseware specialists Copyright © 2011 Hawkes Learning Systems. All rights reserved. Hawkes Learning Systems: College Algebra.
Chapter 5 Linear Inequalities and Linear Programming Section R Review.
UNC Chapel Hill M. C. Lin Point Location Chapter 6 of the Textbook –Review –Algorithm Analysis –Dealing with Degeneracies.
Graphs of Linear Inequalities When the equal sign in a linear equation is replaced with an inequality sign, a linear inequality is formed. Solutions of.
Linear Programming David Kauchak cs161 Summer 2009.
Decision Procedures An Algorithmic Point of View
Lecture 2 We have given O(n 3 ), O(n 2 ), O(nlogn) algorithms for the max sub-range problem. This time, a linear time algorithm! The idea is as follows:
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS ST. EDWARD’S UNIVERSITY.
UNC Chapel Hill M. C. Lin Orthogonal Range Searching Reading: Chapter 5 of the Textbook Driving Applications –Querying a Database Related Application –Crystal.
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.
Order Statistics The ith order statistic in a set of n elements is the ith smallest element The minimum is thus the 1st order statistic The maximum is.
© The McGraw-Hill Companies, Inc., Chapter 6 Prune-and-Search Strategy.
1 1 Slide © 2005 Thomson/South-Western Chapter 2 Introduction to Linear Programming n Linear Programming Problem n Problem Formulation n A Maximization.
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.
CSC 211 Data Structures Lecture 13
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.
The Greedy Method. The Greedy Method Technique The greedy method is a general algorithm design paradigm, built on the following elements: configurations:
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
2.8 Two-Variable Inequalities In some situations you need to compare quantities. You can use inequalities for situations that involve these relationships:
1. Searching The basic characteristics of any searching algorithm is that searching should be efficient, it should have less number of computations involved.
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.
Approximation Algorithms based on linear programming.
Computational Geometry
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
1 1 Slide Graphical solution A Graphical Solution Procedure (LPs with 2 decision variables can be solved/viewed this way.) 1. Plot each constraint as an.
Linear program Separation Oracle. Rounding We consider a single-machine scheduling problem, and see another way of rounding fractional solutions to integer.
An Introduction to Linear Programming
Linear Programming for Solving the DSS Problems
Linear Programming Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints. specify the.
6.5 Stochastic Prog. and Benders’ decomposition
Linear Programming.
Linear Programming CISC4080, Computer Algorithms CIS, Fordham Univ.
CHAPTER 4. LINEAR PROGRAMMING
I. The Problem of Molding
CISC5835, Algorithms for Big Data
CMPS 3130/6130 Computational Geometry Spring 2017
CS5321 Numerical Optimization
Linear Programming Problem
6.5 Stochastic Prog. and Benders’ decomposition
Graphical solution A Graphical Solution Procedure (LPs with 2 decision variables can be solved/viewed this way.) 1. Plot each constraint as an equation.
Presentation transcript:

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 expected running time to O(n). There is no good way to determining an ordering of H, so simply pick a random ordering. Worst case for RLP: O(n 2 ), but maybe better!

UNC Chapel Hill M. C. Lin 2DRandomizedLP(H,c) Input: A line program (H, c) where H is set of n half-planes, c  R 2 Output: if (H, c) is unbounded, a ray p completely contained in the feasible region is reported. If (H, c) is infeasible, then this fact is reported. Else, a feasible point p that maximizes f c (p) is reported. 1. if UnboundedLP( H, c ) reports that ( H, c ) is unbounded/infeasible 2. then Report that info and, in the unbounded case, a ray along which ( H, c ) is unbounded 3. else Let h 1, h 2  H be the 2 certificat half-planes returned by UnboundedLP; let v 2 be the intersection point of l 1 & l 2 4. Compute a random permutation h 3, …, h n of remaining half-planes by calling RandomPermutation( H[3…n] )

UNC Chapel Hill M. C. Lin 2DRandomizedLP(H,c) 5. for i  3 to n 6. do if v i-1  h i 7. then v i  v i-1 8. else v i  the point p on l i that maximizes f c (p), subject to the constraints, h 1, …, h i-1 9. if p does not exist 10. then Report that LP is infeasible & quit. 11. return v n

UNC Chapel Hill M. C. Lin RandomPermutation(A) Input: An array A [1…n] Output: The array A [1…n] with the same elements, but rearranged into a random permutation. 1. for k  n downto 2 2. do rndindex  RANDOM( k ) 3. Exchange A [ k ] and A [ rndindex ] RANDOM( ) takes k as input & generate a random integer btw 1 and k in constant time

UNC Chapel Hill M. C. Lin R-LP Algorithm Analysis There are ( n-2 )! possible permutation of half-planes in 2D R-LP, each with equal likelihood. The average expected running time over all ( n -2)! possibilities is E[  3  i  n O(i)·X i ] =  3  i  n O(i)·E[X i ] =  3  i  n O(i)·[2/(i-2)] = O(n)  The 2D-LP problem with n constraints can be solved in O(n) randomized expected time using worst-case linear storage.

UNC Chapel Hill M. C. Lin Unbounded Linear Programming Let H = { h 3, …, h n } and let n i be the outward normal of h i. l i denotes the line bounding h i. Let  i denote the smallest angle that makes with c, with 0    j  180 . Half-planes h i with a minimal value of  i are crucial in deciding whether LP is bounded or not. Let be a half- plane s.t.  i = min 1  j  n  j and define H min  { h j  H | n j = n i } H par  { h j  H | n j = -n i } If  (H min  H par ) is empty, then the LP is infeasible. If  (H min  H par ) isn’t , l i * bounds one side with h i *  H min : –If l i *  h j is unbounded in c for every h j in H \(H min  H par ), LP is unbnd –If l i *  h j * is bounded in c for some h j * in H \(H min  H par ), LP is bnded

UNC Chapel Hill M. C. Lin UnboundedLP(H,c) Input: A line program (H, c) where H is set of n half-planes, c  R 2 Output: if (H, c) is unbounded, o/p a ray p completely contained in the feasible region. If (H, c) is bounded, o/p either consists of 2 half-planes h i * and h j * from H s.t. ({ h i *, h j *}, c ) is bounded, or it reports that LP is infeasible. 1. For each half-plane h i  H, compute the angle  i 2. Let h i be a half-plane with  i = min 1  j  n  j 3. H min  { h j  H | n j = n i } 4. H par  { h j  H | n j = -n i } 5. H *  H \ (H min  H par ) 6. Compute the intersection of half-planes in H min  H par

UNC Chapel Hill M. C. Lin UnboundedLP(H,c) 7. if the intersection is empty 8. then Report that (H,c) is infeasible 9. else Let h i *  H min be the half-plane whose bounding line bounds the intersection. 10. if there is a half-plane h j *  H* s.t. l i *  h j * is bounded in direction c 11. then Report that ({ h i *, h j *}, c ) is bounded 12. else Report that (H,c) is unbounded along the ray l i *  (  H*)  Algorithm UnboundedLP decides in O(n) time whether a 2D-LP with n constraints is unbounded.

UNC Chapel Hill M. C. Lin When UnboundedLP is Not Needed When we only want to know if there is a feasible point We have a priori bound A on the absolute value of the solution. In such a case, we can add 2d constraints of the form x i  A, and -A  x i, for 1  i  d.

UNC Chapel Hill M. C. Lin LP in Higher Dimensions The 3D-LP w/ n constraints can be solved in O(n) expected time using linear storage. The d -dimensional LP problem with n constraints can be solved in O(d!n) expected time using linear storage.  RLP is only useful for lower dimensional problems. Other LP techniques, such as the simplex algorithm, are preferred for higher dimensions. Similar optimization techniques in higher dimensions are used to solve molecular confirmation problems, by minimizing total energy of the state, subject to constraints on joint-angle, bonds/forces, etc.

UNC Chapel Hill M. C. Lin Collision Detection The problem in 3D can be posed as: Maximize1 Subject toa 11 x + a 12 y + a 13 z  b 1 : a m1 x + a m2 y + a m3 z  b m c 11 x + c 12 y + c 13 z  d 1 : c n1 x + c n2 y + c n3 z  d n where (a i1, a i2, a i3, b i ) and (c k1, c k2, c k3, d k ) represent the outward normals of the faces of convex polyhedra A & B. If the LP is feasible, then A&B’ve collided.

UNC Chapel Hill M. C. Lin Smallest Enclosing Discs A robot arm whose base is fixed and has to pick up items at various points and locate them at other points. Problem: what would be a good position for the base of the arm?  A good position is at the center of the smallest disc that encloses all the points.

UNC Chapel Hill M. C. Lin Transform to a Randomized Algorithm Generate a random permutation p 1, …, p n of P Let P i = { p 1, …, p i }. We add points one by one, while maintaining D i, the smallest enclosing disc of P i. Let 2 < i < n, P i and D i be defined as above, we have: –if p i  D i-1, then D i = D i-1 –if p i  D i-1, else p i lies on the boundary of D i

UNC Chapel Hill M. C. Lin MiniDisc(P) Input: A set P of n points in the plane Output: The smallest enclosing disc for P 1. Compute a random permutation p 1, …, p n of P 2. Let D 2 be the smallest enclosing disc for { p 1, p 2 } 3. for i  3 to n 4. do if p i  D i-1 5. then D i  D i-1 6. else D i  MiniDiscWithPoint({ p 1, …, p i-1 }, p i ) 7. return D n

UNC Chapel Hill M. C. Lin MiniDiscWithPoint(P,q) Input: A set P of n points in the plane, and a point q s.t. there exists an enclosing disc for P with q on its boundary Output: The smallest enclosing disc for P with q on its bndary 1. Compute a random permutation p 1, …, p n of P 2. Let D 1 be smallest enclosing disc w/ q & p 1 on its boundary 3. for j  2 to n 4. do if p j  D j-1 5. then D j  D j-1 6. else D j  MiniDiscWith2Point({ p 1, …, p j-1 }, p j, q ) 7. return D n

UNC Chapel Hill M. C. Lin MiniDiscWith2DPoint(P,q 1,q 2 ) Input: A set P of n points in the plane, and two points q 1 & q 2 s.t. there exists an enclosing disc for P with q 1 & q 2 on boundary Output: The smallest enclosing disc for P with q 1 & q 2 on bndary 1. Let D 0 be smallest enclosing disc w/ q 1 & q 2 on boundary 2. for k  1 to n 3. do if p k  D k-1 4. then D k  D k-1 5. else D k  the disc w/ q 1, q 2 and p k on its boundary 6. return D n

UNC Chapel Hill M. C. Lin Algorithm Analysis The running time of MiniDiscWithPoint is O(n) without call to MiniDiscWith2Points. The probability of making such a call is 2/i. The total expect run time of MiniDiscWithPoint is O(n) +  2  i  n O(i)·(2/i) = O(n) Applying the same argument once more. We have: the smallest enclosing disc for a set of n points in the plane can be computed in O(n) expected time using worst-case O(n) storage