Computational Geometry Linear programming Exercise session #8: - - PDF document

computational geometry linear programming
SMART_READER_LITE
LIVE PREVIEW

Computational Geometry Linear programming Exercise session #8: - - PDF document

Computational Geometry Linear programming Exercise session #8: Incremental construction & Problem : maximize c T x s.t. Ax b Arrangements c = ( c 1 ,, c d ) T Linear Programming x = ( x 1 ,, x d ) T


slide-1
SLIDE 1

1

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

1

Computational Geometry

Exercise session #8: Incremental construction & Arrangements

  • Linear Programming
  • Incremental algorithm
  • Randomized algorithm
  • Smallest enclosing disc problem
  • Arrangements & Duality
  • The minimum area triangle problem
  • Homework 5 handed

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

2

Linear programming

  • Problem: maximize cTx s.t. Ax ≤ b

c = (c1,…,cd)T x = (x1,…,xd)T Objective function: f(x) = cTx Anxd – coefficient matrix with entries aij constraint equations: Ax ≤ b Half-space defined by ith constraint hi: Aix ≤ bi Feasible region – convex region defined by constraints.

  • Linear programming in low dimensions is efficiently

solved with geometric methods.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

3

Incremental algorithm

  • Feasible region of solution can be computed in

O(nlogn) time with half-plane intersection algorithm.

  • Observation: no need to have all region to find
  • ptimal solution.
  • Can we break the Ω(nlogn) bound?
  • Idea: solve the problem incrementally,

computing the solution to the first i constraints in the ith step.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

4

Bounded solutions

  • Four cases for linear program solution:

Infeasible. Unbounded solution. Bounded solution, not unique. Bounded unique solution.

  • To ensure incremental approach works, we

need a unique solution at each step:

Add artificial constraints that bound solution. Choose lexicographically smallest solution when not unique.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

5

Incremental solution properties

  • Let Ci be the feasible region at the ith step, then

C0⊇C1⊇…⊇Cn

  • Observation: solution is monotonically non-

increasing.

  • Let vi be the solution at the ith step, then:

If vi-1∈hi, then vi = vi-1. If vi-1∉hi , then either Ci = ∅ or vi∈li where li is the line bounding hi.

  • Proof:

first case, by inclusion of feasibility regions. Second case, by contradiction: solution increases along segment [vivi-1]. Intersection point of [vi-1vi] with hi contradicts the optimality of vi.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

6

Reduction to one-dimension

  • When vi-1∉hi , find optimal solution on li.
  • Search according to x-coordinate of p∈li (y-coord if li

is vertical):

Take max when li∩hi is bounded to left, otherwise min.

σ(h,li)

h li x ≤ σ(h,li)

li∩hi bounded to right

slide-2
SLIDE 2

2

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

7

Algorithm complexity

  • Each iteration takes:

O(1) time when vi-1∈hi. O(i) time when vi-1∉hi.

  • Worst case: O(n2) time, linear space.

h2 h1 h3 h4 h5 hn … c

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

8

Randomized algorithm

  • Create a random permutation of the half-planes and

insert them in that order.

  • Xi - random variable which is 1 if vi-1∉hi and 0
  • therwise.
  • Total time is:
  • Expected total time:
  • Backwards analysis - remove hi and see when vi

changes: only when hi is one of the half-planes defining vi E[Xi] ≤ 2/i total expected cost O(n).

= n i i

X i O

1

) (

∑ ∑

= =

= ⎥ ⎦ ⎤ ⎢ ⎣ ⎡

n i i n i i

X E i O X i O E

1 1

] [ ) ( ) (

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

9

Smallest enclosing disc

  • Problem: Compute smallest radius disc that

contains all n input point.

  • Motivation: placement of a robotic arm base to

pick up and drop boxes – minimize maximum distance between base and floor locations.

  • Naïve solution: Try all triplets of points: O(n4).
  • Efficient deterministic solution: using the

furthest point Voronoi diagram: O(nlogn).

  • Randomized incremental construction: based
  • n properties similar to Linear Programming.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

10

Incremental construction

  • Notation:

Pi = {p1,p2,…,pi} Di – the smallest enclosing circle of Pi.

  • Lemma: For 2 < i < n, we have:

If pi∈Di-1 then Di = Di-1. If pi∉Di-1 then pi lies on the boundary of Di.

  • Proof: part of a stronger lemma to be proven

later.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

11

Randomized algorithm I

Algorithm MiniDisc(P) Input: A set P of n points in the plane Output: The smallest enclosing disc of P

1. Compute random permutation {p1,…,pn} of P 2. Let D2 be the smallest enclosing disc for {p1,p2} 3. For i = 3 to n

  • a. If pi∈Di-1 then Di = Di-1
  • b. Else Di = MiniDisc1Point({p1,…,pi-1},pi)
  • 4. Return Dn

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

12

Randomized algorithm II

Algorithm MiniDisc1Point(P,q) Input: A set P and point q such that there exists an enclosing disc for P with q on its boundary Output: Smallest enclosing disc of P with q on boundary 1. Compute random permutation {p1,…,pn} of P 2. Let D1 be the smallest disc with q and p1 on boundary 3. For j = 2 to n

  • a. If pi∈Dj-1 then Dj = Dj-1
  • b. Else Dj = MiniDisc2Points({p1,…,pj-1},pj, q)

4. Return Dn

slide-3
SLIDE 3

3

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

13

Randomized algorithm III

Algorithm MiniDisc2Points(P,q1,q2) Input: A set P and points q1,q2 such that there exists an enclosing disc for P with q1 and q2 on its boundary Output: Smallest enclosing disc of P with q1,q2 on boundary 1. Let D0 be the smallest disc with q1 and q2 on boundary 2. For k = 2 to n

  • a. If pk∈Dk-1 then Dk = Dk-1
  • b. Else Dk = Disc(q1,q2,qk)

3. Return Dn

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

14

Proof of correctness

  • Lemma: Let P be a set of points in the plane,

let R be a possibly empty set of points disjoint from P, and let p∈P. Then the following holds:

If there is a disc that encloses P and has all the points of R on its boundary, then the smallest such disc is unique, denoted by md(P,R). If p∈md(P\{p},R) then md(P,R) = md(P\{p},R) If p∉md(P\{p},R) then md(P,R) = md(P\{p},R∪P)

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

15

Proof of lemma (cases i, ii)

x0 D0 x1 D1 x(λ) D(λ) z

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

16

x1 D1

Proof of lemma (case iii)

x0 D0 z p

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

17

Complexity analysis

  • Theorem: the smallest enclosing disc of n points can

be computed in O(n) expected time and using worst case linear space.

  • Proof:

MiniDisc2Points runs in O(i) time (always). MiniDisc1Point runs in O(i) without counting the calls to MiniDisc2Points. Probability of calling – backward analysis: disc changes when pi is one of the points on boundary – two possibilities (q doesn’t count), so probability is 2/i. Same argument for MiniDisc overall expected time O(n).

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

18

Randomized Incremental Summary

  • Very simple algorithms – easy to implement

and executing fast.

  • Method applicable in many situations – when

solution doesn’t change most of the times if the order is random.

  • Extension to higher dimensions possible:

Make recursive calls to problem solver in one ‘dimension’ lower. increased constant in O(n) bound.

slide-4
SLIDE 4

4

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

19

Arrangements and duality

  • Arrangements – one of the fundamental

geometric structures with strong connection to:

Convex hulls Voronoi Diagrams Combinatorial properties of geometric structures.

  • Duality transform sheds new light on many

problems, providing efficient solutions.

  • Numerous applications in many fields

Example: assembly sequence planning.

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

20

Minimum area triangle

  • Problem: given a set S of n points in the plane,

find the triangle whose vertices are from S, and whose area is minimal.

  • Naïve solution: try all triplets of points: O(n3).
  • Best know solution is by using duality and

arrangements!

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

21

Duality transform

  • Duality transform: point p = (a,b) transforms to line y

= ax – b and vice versa.

  • Preserves point-line incidence.
  • Preserves point-line above/below relation.
  • Preserves point-line vertical distance.

(a,b) y = cx-d y = ax-b (c,d) ac-d-b ac-b-d

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

22

Minimum area triangle - fixed pair

Smallest vertical distance corresponds to smallest

  • rthogonal distance!

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

23

Fixed pair in dual plane

Yaron Ostrovsky-Berman, Computational Geometry, Spring 2005

24

Search in dual space

  • For each cell, find smallest vertical distance of

all vertices (linear time in size of cell), keep minimum for each vertex.

  • Vertex + line with minimal vertical distance

correspond to three points making up smallest area triangle.

  • Traversal of arrangement takes O(n2) time,

which is the algorithm complexity.