The Convex Hull Problem
Definition
The convex hull of a set of points in the plane is the smallest convex polygon that contains all points of . Equivalently:
- It is the intersection of all convex sets containing .
- It is the shape a rubber band would take if stretched around all the points and then released.
Properties
- All hull vertices are points of (extreme points).
- Any interior point of is not on the hull.
- The hull has at least 3 vertices (assuming at least 3 non-collinear points).
- The hull has at most vertices (all points on the boundary, e.g. points on a circle).
- The furthest-apart pair of points in are both on the hull.
Input and Output
Input: A set of points where . At least 3 points are not collinear (so the hull has non-zero area).
Output: An ordered list of points forming the convex hull (usually in counter-clockwise order).
Two common output formats:
- List of hull vertices in CCW order.
- List of hull edges forming the boundary.
Lower Bound:
The convex hull problem requires time in the comparison model.
Proof by reduction from sorting: Given distinct numbers to sort, map them to points on a parabola: . All these points lie on the convex parabola , so they are all on the convex hull. Computing the convex hull of these points and then reading the -coordinates in hull order (either left to right or right to left depending on output order) yields the sorted sequence.
Since sorting takes comparisons, convex hull must also take .
Output Sensitivity
The number of hull vertices is denoted by (where ). Algorithms that run in time proportional to are called output-sensitive.
| Algorithm | Time | Output-sensitive? |
|---|---|---|
| Graham’s Scan | No | |
| Jarvis’s March | Yes | |
| Prune and Search | Yes (asymptotically optimal) |
If is small (e.g. or ), Jarvis march outperforms Graham scan. If , Graham scan is better.
Applications
- Collision detection in physics simulations and games (hull provides a conservative bounding region).
- Shape analysis in computer vision.
- GIS and mapping: computing the outer boundary of a set of geographic points.
- Pattern recognition: feature extraction from point sets.
- Voronoi diagrams: the convex hull is the outer boundary of the unbounded Voronoi cells.
Five Algorithms for Convex Hull
| Approach | Algorithm | Time |
|---|---|---|
| Rotational sweep | Graham’s Scan | |
| Rotational sweep | Jarvis’s March | |
| Incremental | Add points one by one | |
| Divide and Conquer | Merge two hulls | |
| Prune and Search | Chan’s algorithm style |
The Tripos syllabus focuses on Graham’s Scan and Jarvis’s March.
Summary
| Property | Detail |
|---|---|
| Definition | Smallest convex polygon containing all points |
| Hull vertices | , where |
| Lower bound | by reduction from sorting |
| Graham scan | , non-output-sensitive |
| Jarvis march | , output-sensitive |
| Key fact | Extreme points of any direction are on the hull |
| Cross product | Used for all turn-direction checks, no trig |