Partition the plane by “which site is nearest”. The Voronoi cell of a site is
Each cell is a convex polygon (possibly unbounded) — the intersection of the half-planes defined by the perpendicular bisectors to every other site.
Structure
For sites in general position:
| Quantity | Value |
|---|---|
| Cells | |
| Edges | |
| Vertices | |
| Total complexity |
Voronoi vertices are circumcentres of triples of sites, and each is equidistant from three sites with no fourth inside that circle.
Construction
| Method | Time | Note |
|---|---|---|
| Half-plane intersection per cell | simple, fine for | |
| Fortune’s sweep | the classic; a parabolic beach line | |
| Dual of Delaunay | build Delaunay, then take the dual | |
| Lift to 3D + convex hull | elegant; via the paraboloid | |
| Divide and conquer |
Build Delaunay instead
The Voronoi diagram and the Delaunay triangulation are duals: a Voronoi edge separates two sites exactly when those sites are joined by a Delaunay edge. Delaunay is easier to construct (Bowyer-Watson is ~40 lines) and easier to store, so build it and dualise if you need the Voronoi structure explicitly.
The duality in detail
| Voronoi | Delaunay |
|---|---|
| cell (a site) | vertex |
| edge (between 2 cells) | edge |
| vertex (meeting of 3 cells) | triangle |
| unbounded cell | a hull vertex |
| Voronoi vertex position | the triangle’s circumcentre |
What it answers
| Query | Via Voronoi/Delaunay |
|---|---|
| Nearest site to a query point | point location in the Voronoi diagram, |
| Closest pair | the shortest Delaunay edge |
| Euclidean MST | a subgraph of Delaunay — run Kruskal on edges |
| Nearest neighbour graph | a subgraph of Delaunay |
| Largest empty circle | centred at a Voronoi vertex (or on the hull boundary) |
| Farthest-point Voronoi | gives the minimum enclosing circle |
| All nearest neighbours | one pass over Delaunay edges |
| Motion planning with maximum clearance | travel along Voronoi edges |
The Euclidean MST reduction is the most valuable: it takes an complete-graph problem down to .
Variants
- Weighted (power) Voronoi — cells defined by ; still polygonal, dual to the regular triangulation.
- Multiplicatively weighted — cells bounded by Apollonius circles, no longer polygonal.
- Farthest-point Voronoi — “which site is farthest”; only hull vertices have non-empty cells.
- Order- Voronoi — regions with the same set of nearest sites.
- Voronoi under / — cells are still polygonal but with axis-parallel and diagonal edges.
- Voronoi of segments — cells bounded by parabolic arcs; substantially harder.
In competitive programming
Explicit Voronoi construction is rare — it is long, precision-sensitive, and usually avoidable. The three things worth knowing:
- Nearest-site queries → a KD-tree is simpler and fast enough.
- Euclidean MST → build Delaunay, then Kruskal.
- Largest empty circle → its centre is a Voronoi vertex, a hull edge midpoint, or determined by the bounding region; enumerate the candidates.
For small , the per-cell half-plane intersection is entirely acceptable and far easier to get right.
See also: Delaunay Triangulation · Fortune’s Algorithm · Half-Plane Intersection