Voronoi Diagrams: Nearest-Neighbor Partitioning Visualized

simulator intermediate ~10 min
Loading simulation...
20 Voronoi cells with dual Delaunay triangulation

With 20 seed points, the Voronoi diagram partitions the plane into 20 convex regions. The dual Delaunay triangulation connects points whose Voronoi cells share an edge, producing approximately 36 triangles.

Formula

Euler's formula: V - E + F = 2
Average Voronoi neighbors ≈ 6 (for large random point sets)
Delaunay triangles ≈ 2N - 2 - h (N = points, h = hull size)

Partitioning Space by Proximity

A Voronoi diagram answers a simple question: given a set of seed points, which region of space is closest to each seed? The result is a beautiful partition of the plane into convex polygonal cells. Every point inside a cell is nearer to its seed than to any other. This fundamental construction appears throughout nature — from the patterns on a giraffe's skin to the territories of fish on a coral reef.

The Dual: Delaunay Triangulation

The Delaunay triangulation is the geometric dual of the Voronoi diagram. Connect two seeds whenever their Voronoi cells share an edge, and you get a triangulation with a remarkable property: no point lies inside the circumscribed circle of any triangle. This 'empty circle' property makes Delaunay triangulations optimal for mesh generation and interpolation.

From Nature to Algorithms

Fortune's sweep-line algorithm computes Voronoi diagrams in O(N log N) time. But nature computes them in parallel — crystal growth from multiple nucleation sites, the cracking pattern of dried mud, and the foam structure of soap bubbles all produce Voronoi-like patterns spontaneously through local physical processes.

Playing with Points

This simulation lets you add seed points and watch both the Voronoi diagram and Delaunay triangulation update in real time. Enable jitter to see how the diagram morphs as points move. Notice how the average number of cell neighbors converges to 6 — a consequence of Euler's formula for planar graphs that connects vertices, edges, and faces.

FAQ

What is a Voronoi diagram?

A Voronoi diagram partitions a plane into regions based on the distance to a set of seed points. Each region contains all points closer to its seed than to any other seed. They appear naturally in crystal growth, cell biology, and territorial animal behavior.

How are Voronoi diagrams and Delaunay triangulations related?

They are duals of each other. Two seeds are connected by a Delaunay edge if and only if their Voronoi cells share a boundary. The Delaunay triangulation maximizes the minimum angle of all triangles, avoiding sliver triangles.

What are practical applications of Voronoi diagrams?

They are used in nearest-neighbor search, mesh generation for finite elements, geographic analysis (nearest hospital/station), wireless network coverage planning, and procedural texture generation in computer graphics.

Why do Voronoi cells average about 6 neighbors?

Euler's formula for planar graphs (V - E + F = 2) combined with the fact that each edge borders exactly two faces means the average number of edges per face approaches 6 as the number of points grows.

Sources

Embed

<iframe src="https://homo-deus.com/lab/geometry/voronoi-diagram/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub