A 2D Bounded Lnear Program (H,c) h 3 v h 8 h 5 c h 4 h h 6 h 7 h 2 2D Lnear Programmng C s a polygonal regon, the ntersecton of n halfplanes. (H, c) s nfeasble, as C s empty. Feasble regon C s unbounded n drecton c and f c takes arbtrarly large values along a ray ρ. Soluton s not unque as C has an extreme edge e wth outward normal n drecton c v. An extreme vertex of C f drecton c s the unque soluton of (H, c)
Bounded Lnear Programmng Would lke to handle one type of case: bounded program wth unque soluton In order to make soluton unque we ask for the lexcographcally smallest optmal soluton Does a unque soluton always exst? In order to guarantee problem s bounded we add two constrants x < M m = x M f c x > 0 otherwse m 2 y < M = y M f c y > 0 otherwse Boundng Constrants M must be large enough so as not to nterfere wth real constrants Correct Incorrect Correct In practce, M s handled symbolcally (Sedel 99) 2
An Incremental Algorthm Startng from C 0 = m m 2, add the remanng halfplanes, one at a tme, keepng track of the optmal soluton Notaton : H v = { m, m s the boundng lne of h s 2 C = m m l, h, K, h } 2 the (unque) optmal h h L h 2 soluton of ( H, c) h l Snce C 0 C C n = C, f C = then C j =, for j > and we can report (H,c) s nfeasble How does the soluton change? Theorem. Let v denote the optmal soluton of (H, c). Then. If v h then v = v. If v h then ether C s empty (nfeasble) or v l l 6 C 5 C 6 3
Proof. Snce C C, then v C, so v cannot be better than v. Therefore, v = v. (By contradcton.) Assume C s not empty and v l. Snce v h and v h, then the segment v v must ntersect l, at a pont q. By convexty, ths segment s contaned n C, and q C. Snce f c s lnear, t ncreases monotoncally from v to v. Therefore, f c (q) > f c (v ), a contradcton l Case () If v h we need to solve the followng: Fnd the pont p on l that maxmzes f c (p), subject to p h, for all h H After re-parameterzngl as a functon of a sngle parameter (e.g., t, x- or y-coordnate) we are left wth a D lnear program! Can ths D lnear program be unbounded? 4
D Lnear Programmng Maxmze f(x)=cx subject to a x b,, a n x b n Each constrant defnes a ray on the real lne, bounded by a value z =b / a, on the left or rght In lnear tme fnd x left = the largest boundary for rays bounded on the left x rght = the largest boundary for rays bounded on the rght [x left, x rght ] defnes the feasble regon C If x left > x rght the lnear program s nfeasble Otherwse, f C s bounded, then the optmal vertex s the better one of x left and x rght Theorem. A D lnear program on n constrants can be solved n O(n) tme Case () Fnd the pont p on l that maxmzes f c (p), subject to p h, for all h H Parameterze l, say on x-coordnate, (or y- f l s vertcal) and let σ(h j, l ) denote the parameterzed ntersecton of l and l j Each constrant h of H, when restrcted to l has the form t σ(h, l ) or t σ(h, l ) Ths s a D lnear program and can be solved n O() tme 5
2d Bounded Lnear Programmng Algorthm 2DBoundedLP(H, c, m, m 2 ). Let v 0 be the corner of C 0 2. Let h,...,h n be the planes of H 3. for to n do 4. f v h 5. then v v 6. else v DLP(H, l, c) 7. f v does not exst then (H,c) s nfeasble 8. return v n Performance of 2DBoundedLP In the worst case, 2DBoundedLP wll have to solve a D lnear program wth every teraton Runnng tme s = O(n 2 ) Is ths bound tght? 6
What went wrong? Is the problem nherent to the nput planes? What happens f the planes are added n the order h, h 2, h n, h n, h n 2,, h 3 Is t the case that for any (H,c) there s a good order? If so, how do we fnd t? Randomzed performance Theorem. The randomzed ncremental 2D lnear programmng algorthm runs n O(n) expected tme Proof sketch There are n teratons An teraton takes constant tme f the optmal vertex ddn t change; otherwse we need to run a lnear tme algorthm Let X = total tme spent solvng D lnear programs, and X = I(v h ) n n = = = n E( X ) E cx c E( X ) c Pr( v = = = h ) 7
What s Pr(v h )? Run the algorthm backwards! Assume algorthm has just fnshed and computed v n Perform one step back. C n s obtaned by removng halfplane h n from C n. When does the optmal soluton change? Only f h n s one of two halfplanes defnng v n! Probablty of change s at most 2 / n Performance of Randomzed LP In general, the probablty that we need to compute a new optmal soluton when addng h s the same as the probablty that the optmal vertex changes when we remove h E(X ) 2 / Snce X = cσ X n n n 2 E( X ) = c E( X ) = c Pr( v h ) c = = = = O( n) 8
Unbounded Programs How do we recognze an unbounded lnear program (H,c)? Unbounded there s a ray ρ = {p+λd} along whch f c ncreases. c d > 0, and 2. For all h H, n h d 0, where n h s the nward normal of h Theorem. A lnear program (H,c) s unbounded ff there s a vector d that satsfed () c d > 0, (2) nh d 0, for all h H, (3) the program (H,c) s feasble, where H ={h H: n h d = 0} Proof sketch. p 0 H exsts, as H s non-empty and f takes arbtrarly large values along p 0 +λd. For planes h H\ H there s λ h, such that p 0 +λd h, for λ λ h. Take λ = max λ h and p= p 0 +λ d. Then p+λd h, all h H Detectng an Unbounded Program Smlar to halfplane ntersectons, but D only! Wlog assume c = (0,) A drecton d satsfyng d c>0 can be normalzed to d=(d x, ) (touchng the lne y=) The constrants d n h 0 become d x n x n y resultng n a D halfspace ntersecton problem Ĥ If Ĥ s feasble, we fnd H H, the planes for whch the soluton s tght (bounded by lnes parallel to d), and verfy that H s feasble. If so, (H,c) s unbounded; otherwse H s nfeasble and so s (H,c) If Ĥ s nfeasble, then (H,c) s bounded and two mutually ncompatble halfspaces from Ĥ consttute a certfcate for the boundedness of (H,c) and can be used n leu of m and m 2 9
Hgher Dmensons Approach generalzes easly to d 3 dmensons Keep track of a unque soluton Frst determne f program s unbounded. If not, get d certfcates h,,h d of boundedness, to be used as base case Now nsert h d+,,h n n random order keepng track of the unque (and lexcographcally smallest) soluton As before, f v h, then v g, the hyperplane boundng h. In ths case we need to fnd the optmal vertex of g C Ths s LP n dmenson d, as f c nduces a lnear functon n g Theorem. For eachfxed dmenson d, a d-dmensonal lnear pogram wth n constrants can be solved n O(n) expected tme 0
Smallest Enclosng Dsc Fnd the smallest dsc enclosng a set P = {p,,p n } of ponts n the plane Does an ncremental randomzed algorthm work? Let P = {p,,p } and D = the smallest enclosng dsc of P Algorthm MnDsc(P). Compute a random permutaton of P 2. Let D 2 be the crcle wth dameter p p 2 3. for 3 to n do compute D
Some Useful Propertes Let D be a mnmum enclosng dsc of a set of ponts P. Then D s unque D contans ether 3 ponts or 2 antpodal ponts on ts boundary If D s the mnmum enclosng dsc of P and P P, then radus(d ) radus(d) Lemma. Let 2< < n. Then. If p D, then D = D 2. If p D, then p les on the boundary of D z p + x x + D D + x(λ) Proof of Case 2 (by contradcton). Suppose p + D + D D +. Let z D D + Consder the dscs D(λ) wth centers x(λ) = ( λ)x + λx + and z D(λ). Ther sze changes contnuously as λ. At some pont D(λ * ) must contan p + 2
An Incremental Randomzed Algorthm How do you solve MnDscWthPont? 3
Lemma. Let P be a set of ponts n the plane and R a possbly empty set of ponts dsjont from P. Then:. The smallest enclosng dsc md(p, R) that encloses P and has all ponts of R on ts boundary s unque 2. If p md(p \ {p}, R) then md(p, R) = md(p \ {p}, R) 3. If p md(p \ {p}, R) then md(p, R) = md(p \ {p}, R {p}) Proof. Smlar to prevous lemma Theorem. The smallest enclosng dsc for a set of n ponts n the plane can be computed n O(n) expected tme and O(n) space. Proof. The runnng tme for MnDscWth2Ponts s O(n). By backwards analyss, MnDscWthPont runs n O(n) expected tme For fxed {p,,p }, the probablty that D D s 2/ The expected runnng tme s n 2 O( n) + O( ) = O( n) = 2 Same argument mples that the expected runnng tme of MnDsc s O(n) 4