day4 1/21/98
Qoute of the day: ``Someone has to pay.''
1. 2D incremental Convex hull
1.1 Inductive assumption:
The Polygon is convex and has a set of remaining points partitioned by each
edge.
Let P = {P1,...,Pn} Ì R2
1.2 Algorithm
- Extract 3 points from P and form a triangle, T. Pick C Î T
- Draw a line segment for C to every point in P.
- Partition P by which edge of T the line segment from C crosses.
- While there exists point, P, above an edge, E, BuildTent(P,e,Polygon)
BuildTent(P,e,Polygon)
- Remove all edges from the polygon visible by P.
- Construct a larger polygon from the nonvisible edges in the Polygon + edges
connecting to P.
- associate points external to the polygon with the new edgeset of the polygon
1.3 Timing analysis
All the work occurs in the BuildTent routine.
In step 1, finding the visible edges will not be too costly because all the
edges of all the polygons will form a planar graph. From euler's formula, if
|v| = n and |E| = m then m £ 3n
The total cost of step 3 is the number of times that you must check whether
a line segment between Pi and C .
To analyze step 3, run the algorithm backwards.
- At T(n), Poly = convexhull( P1,...,Pn )
- T(n-1) = T(n) - the comparisons necessary to insert Pn into the polygon.
- The cost to extract a node p on the hull = # of intersections on left and right
edges of P
- At a particular point in time. |P| = K
- åp Î PExtractCost(P) = 2*#intersections £ 2n
- E(ExtractCost) £ 2n/k
- E(#intersections) £ åk = n12n/k = 2n*åk = 1n1/k = O(n*log2(n)
2. Linear Programming
After rotation, the problem is finding the point (x,y) which minimizes the y
value.
Constraints can all be written in one of the forms:
- H+ = {i:y ³ aix+bi} = constraints on the minimum value of y
- H- = {i:y £ aix+bi} = constraints on the maximum value of y
- H0 = {i:aix £ bi} = vertical constraints
File translated from TEX by TTH, version 1.30.