Instructor: Scot Drysdale | June 25, 1996 |
Naive 1 triangle testing q(n4) (see Lemma 3.2.1 page 74)
Naive 2 try all pairs see if it forms an edge q(n3) (see 3.2.2 page 74)
Jarvis - "Rope fence" algorithm - find the left most point (in case of tie use the lowest) and tie a rope to it. Walk around and the rope is snagged on the hull points. Find the time in terms of n, the number of points and h, the number of points on the convex hull. (see page 76 Gift wrap, Jarvis used this algorithm in two dimensional space while Chand and Kapupr worked in arbitrary dimensions)
Incremental - start off with any 3 points, take a 4th point, the idea is to find tangents to the first 2 points, throw out what is in the center. Take the next point, if inside -throw it away, if not inside connect it to the two points it is tangent to. You have the tangent if all points are to the right of that line. (formal description on page 99).
This algorithm is simpler if you sort points by x coordinate first. (exercise 3.7.1[3]).
form a triangle out of the first 3 points
for each of the rest of the points
connect to the previous point
find the left and right tangents, eliminate everything between (points and edges).
radians = 180
A lemma
is a small theorem. The author arbitrarily determines whether to use the word lemma
or theorem. A lemma is often introduced to be used to prove a larger theorem.
Performance of algorithms is usually given by stating the "worst-case" as a function
of the size of the input. (Alternatively we can talk about the "best case" or "average
case" run time.) The notation used is O(f(n)) for the upper bound and W(f(n)) for the lower bound. When the upper and lower bounds are the same f(n) the
notation used is Q(f(n)).