Voronoi Diagrams
Which fire station is closest to your house? Which weather station’s rainfall reading best describes your farm? A Voronoi diagram answers questions like these at a glance: it splits a map into regions, one around each important point, so that every location belongs to the point nearest to it. Voronoi diagrams are used in urban planning, ecology, meteorology and the study of how diseases spread, and they’re built entirely from perpendicular bisectors.
Key ideas
Section titled “Key ideas”The vocabulary
Section titled “The vocabulary”- Sites are the given points (towns, schools, weather stations).
- Each site has a cell: the region of all points closer to that site than to any other site.
- An edge is a boundary between two neighbouring cells. Every point on the edge between sites and is the same distance from as from .
- A vertex is a point where three (or more) edges meet. It is the same distance from three sites.
Edges are pieces of perpendicular bisectors
Section titled “Edges are pieces of perpendicular bisectors”All the points equally far from and form the perpendicular bisector of . So the edge between two neighbouring cells is part of that bisector. To find its equation:
- Find the midpoint of the two sites.
- Find the gradient of the segment joining them, and take the negative reciprocal.
- Write the equation of the line through the midpoint with that gradient.
An edge usually stops at a vertex, where a third site becomes just as close. A vertex is where two edges cross, so you find it by solving the two edge equations simultaneously. It’s equidistant from its three sites (it’s the circumcentre of their triangle), which gives a good check.
In IB exams, the coordinates of the sites are given, and you won’t have to construct perpendicular bisectors with a compass. Questions may ask for the equation of an edge, the site closest to a given point, or the area of a cell.
Adding a site
Section titled “Adding a site”To add a new site to an existing diagram:
- Find the cell the new site lands in. Draw the perpendicular bisector between the new site and that cell’s site, inside that cell, until it meets an edge.
- At that edge you cross into a neighbouring cell. Draw the bisector between the new site and that cell’s site, and keep going.
- Continue around until you’re back where you started (or reach the boundary of the region).
- Erase the old edges that are now inside the new cell.
The new cell takes area from its neighbours; cells that aren’t next to it don’t change.
Nearest-neighbour interpolation
Section titled “Nearest-neighbour interpolation”If each site has a measured value (rainfall, temperature, pollution level), you can estimate the value anywhere else by using the value of the nearest site. In other words, every point in a cell is given the same value as its site. This is called nearest-neighbour interpolation. It’s quick and simple, though it jumps suddenly at each edge.
The toxic waste dump problem
Section titled “The toxic waste dump problem”Suppose something unpleasant (a toxic waste dump, a noisy airport) must be built inside a region, as far as possible from the nearest site. Inside a cell, you can always get further from the site by moving away from it, so the best point is never in the middle of a cell. Along an edge, the distance to the two sites is smallest at their midpoint and grows as you move away, so the farthest point on an edge is at one of its ends. That’s why the best location is at a vertex of the Voronoi diagram. To solve it:
- List the vertices inside the region.
- For each vertex, find its distance to one of its three sites (all three are equal).
- Choose the vertex with the largest distance.
In general the boundary of the region (for example, its corners) can also need checking, but in IB exams the solution is always at a vertex where three edges meet.
Worked examples
Section titled “Worked examples”All the examples use the diagram above. The sites are towns, , , and , in a region from to , with units in kilometres.
Example 1: Nearest site and interpolation
Section titled “Example 1: Nearest site and interpolation”The yearly rainfall measured at the four towns is : mm, : mm, : mm, : mm. Use nearest-neighbour interpolation to estimate the yearly rainfall at a farm at .
Solution. The diagram shows in the cell of . To confirm, compare the squared distances from :
| Site | ||||
|---|---|---|---|---|
| Squared distance to |
is nearest, so the estimated rainfall at the farm is mm.
Example 2: The equation of an edge and a vertex
Section titled “Example 2: The equation of an edge and a vertex”- (a) Find the equation of the edge between the cells of and .
- (b) The edge between and lies on the line . Find the vertex where these two edges meet, and check that it is equidistant from , and .
Solution. (a) The midpoint of is . The gradient of is , so the perpendicular gradient is :
(b) Substitute : . The vertex is .
Check the distances from :
All three are equal. ✓
Example 3: Where to put the dump
Section titled “Example 3: Where to put the dump”A toxic waste dump is to be built in the region, as far as possible from the nearest town. Find its location and its distance from the nearest town.
Solution. The vertices are and .
- is km from each of , and (Example 2).
- is on the edges between , and : its distance to is km (and the same to and ).
The larger distance is at . Among the vertices, the best site for the dump is , which is km from the nearest towns (, and ). (In this particular region, a few boundary points happen to be equally far from their nearest town: the corner and the points where edges meet the border at and are also km away. Exam questions are set up so that the answer is a single vertex.)
Example 4: Adding a site
Section titled “Example 4: Adding a site”A new town is founded at . It lands in the cell of , and its new cell will border the cells of all four towns, so its edges lie on the perpendicular bisectors of , , and .
- (a) Find the equations of these four bisectors.
- (b) Find the vertices of the new cell of , and its area.
Solution. (a) Use midpoint and perpendicular gradient each time:
| Pair | Midpoint | Gradient of segment | Bisector |
|---|---|---|---|
| , | |||
| , | |||
| , | |||
| , |
(b) Neighbouring bisectors meet at the new vertices:
Each new vertex lies on an old edge. For example, is on . The old edges inside the new cell (including both old vertices) are erased.
For the area, split the cell along the horizontal diagonal from to , which has length . The top triangle reaches up to , a height of ; the bottom triangle reaches down to , a height of :
Common mistakes
Section titled “Common mistakes”Joining the sites instead of bisecting them. Edges are perpendicular to the segment between two sites, through its midpoint. The segment itself is not part of the diagram.
Using the gradient of the segment for the edge. The edge’s gradient is the negative reciprocal. In Example 2, has gradient , so the edge has gradient , not or .
Drawing bisectors between sites that aren’t neighbours. Only cells that share a boundary have an edge between them. In the diagram above, and have no common edge, so their bisector isn’t used.
Forgetting to erase old edges when adding a site. After adding in Example 4, the old vertices and are inside ‘s cell and are no longer vertices. Any answer that still uses them (for example, for a new dump location) is out of date.
Choosing the smallest distance in the toxic waste problem. You want the vertex farthest from its nearest sites. Compute the distance from each vertex to one of its three sites, then pick the largest.
Deciding the nearest site by eye. Points near an edge are easy to misjudge. Compare (squared) distances, as in Example 1, or substitute into the edge equation to see which side the point is on.
Practice
Section titled “Practice”1. (Warm-up) Use the four-site diagram (sites , , , ).
- (a) Which sites share an edge with ?
- (b) Which site is nearest to ? Show working.
Solution
(a) , and . (The cell of touches all three.)
(b) is close to the edge between and , so compare squared distances: to : ; to : . and are much further ( each). The nearest site is .
Another way: on the edge , at we have . is above the edge, on ‘s side.
2. (Warm-up) Find the equation of the perpendicular bisector of the sites and .
Solution
Midpoint: . Gradient of : , so the perpendicular gradient is .
3. (Core) Three sites are , and .
- (a) Find the equations of the perpendicular bisectors of , and .
- (b) Find the vertex of the Voronoi diagram, and show it is equidistant from all three sites.
Solution
(a) is horizontal with midpoint , so its bisector is . is vertical with midpoint , so its bisector is . has midpoint and gradient , so the perpendicular gradient is :
(b) and meet at , which also satisfies the third equation: . ✓
Distances: to : ; to : ; to : .
4. (Core) The four towns in the worked examples have weather stations recording these temperatures one afternoon: : , : , : , : . Use nearest-neighbour interpolation to estimate the temperature at (a) and (b) .
Solution
(a) Squared distances from : : , : , : , : . Nearest is , so the estimate is .
(b) Squared distances from : : , : , : , : . Nearest is , so the estimate is .
5. (Core) In the four-site diagram (before is added), find the area of (a) the cell of and (b) the cell of .
Solution
(a) The cell of is bounded by , and the region’s edges and : a square, with area .
(b) The cell of has vertices , , and . It’s a trapezium with parallel vertical sides of length (on ) and (on ), a distance apart:
6. (Core) Four wells are at , , and in a region from to (units in km). In the Voronoi diagram, the cell of borders the cells of and , and the cell of borders the cells of and .
- (a) Find the equation of the edge between and .
- (b) Find the equation of the edge between and .
- (c) The edge between and is and the edge between and is . Find the vertex where the cells of , and meet.
Solution
(a) Midpoint of : . Gradient of : , so the perpendicular gradient is :
(b) Midpoint of : . Gradient of : , so the perpendicular gradient is :
(c) and meet at . Check it’s on the edge from (a): . ✓ The vertex is .
7. (Core) In the diagram from question 6, the only other vertex is , where the cells of , and meet. A waste incinerator is to be built at a vertex of the Voronoi diagram, as far as possible from the nearest well. Find its location and its distance from the nearest well.
Solution
- : distance to is km (the same to and ).
- : distance to is km (the same to and ).
The incinerator should be at , km from the nearest wells.
8. (Challenge) A new well is added to the diagram from question 6.
- (a) Find the equations of the perpendicular bisectors of , and .
- (b) Show that and are vertices of the new cell of , by showing that each is equidistant from three sites.
- (c) Which vertex of the old diagram is removed? Justify your answer.
Solution
(a)
| Pair | Midpoint | Gradient | Bisector |
|---|---|---|---|
| , | |||
| , | |||
| , |
(b) lies on the first two bisectors: and . Its distances to , and are , and , all equal to .
lies on the last two bisectors: and . Its distances to , and are , and , all equal to .
(c) The old vertex is removed. It was km from , and , but it is only km from . So it is now inside the cell of , not on a boundary.
9. (Challenge) Three villages are at , and (units in km). A clinic is to be built at the point equally far from all three villages. Find its coordinates and its distance from each village.
Solution
The point is the Voronoi vertex of the three sites, where the perpendicular bisectors meet.
Bisector of : .
Bisector of : midpoint , gradient of is , so the perpendicular gradient is :
At : . The clinic is at .
Distances: to : ; to : ; to : . Each is km.