IB Applications and Interpretation SL · 2D geometry · Section 5 of 5

Voronoi diagrams

3 worked examples · By Álvaro López

Key idea

A Voronoi diagram divides the plane into regions: each region groups together the points that are closer to one site (a shop, a mast, a hospital) than to any other. It is built with perpendicular bisectors, which you already know how to calculate, and it helps answer questions such as “which centre is closest to me?” or “where is the point furthest from all of them?”. It is a very typical topic in Applications and Interpretation and appears in the IB exam with a real context and a diagram.

What is a Voronoi diagram?

Imagine several pharmacies spread across a city. Each resident goes to the one nearest to them. If you colour the map according to the pharmacy each point would go to, you obtain a Voronoi diagram.

With two sites the division is very simple. The points that are the same distance from and from form the perpendicular bisector of segment : the line perpendicular to through its midpoint. That line splits the plane into two halves: the points nearer to and the points nearer to .

[FIGURA mai-t4-a5-dos-sitios: coordinate axes with grid, x window from 0 to 10 and y from 0 to 7. Sites A(2, 1) and B(8, 5), marked with a dot and their letter. Thin line segment AB joining the two sites. Its midpoint M(5, 3) marked with a small dot and the label M. The perpendicular bisector of AB, equation y = -1.5x + 10.5, drawn as a thick line from the point (7/3, 7) on the top edge (approximately (2.33; 7)) to the point (7, 0) on the bottom edge; it passes through M. Right-angle mark at M between segment AB and the perpendicular bisector. The area to the left of the perpendicular bisector (the one containing A) coloured in a soft tone and the area to the right (containing B) in another soft tone. Labels “cell of A” and “cell of B”.]

The points on the perpendicular bisector are exactly halfway: they belong to both territories at once, which is why the perpendicular bisector is the boundary between the two cells.

Three sites: the vertex appears

With three sites , and there are three perpendicular bisectors: those of , and . All three meet at a single point, equidistant from the three sites. Each perpendicular bisector is only used from that point onwards, on the side where it genuinely separates two sites, and the plane is divided into three cells.

[FIGURA mai-t4-a5-tres-sitios: x window from 0 to 10, y from 0 to 9, with a soft grid. Sites P(2, 2), Q(8, 2) and R(5, 7) marked with a dot and their letter. Vertex V(5; 3.6) marked with a highlighted dot and the label “vertex V(5; 3.6)”. Three thick edges leaving V: (1) downwards vertically, x = 5, from V to (5, 0) on the bottom edge; (2) the perpendicular bisector of PR, y = -0.6x + 6.6, from V to (0; 6.6) on the left edge; (3) the perpendicular bisector of QR, y = 0.6x + 0.6, from V to (10; 6.6) on the right edge. The three cells coloured in different soft tones: that of P (left), that of Q (right) and that of R (top). Dashed circle centred at V with radius 3.4 passing through P, Q and R. Labels with arrows pointing to a “site” (P), a “cell” (that of Q), an “edge” (the stretch of x = 5) and the “vertex” (V).]

The reason is simple: if lies on the perpendicular bisector of , then ; if it also lies on that of , then , and therefore . That is, also lies on the perpendicular bisector of .

The perpendicular bisector of two sites

All the work on a diagram is calculating perpendicular bisectors. It is the same procedure as in the section on perpendicular lines.

A quick check: any point on the perpendicular bisector must be the same distance from as from . For the perpendicular bisector in the first figure, with and , the midpoint is , the gradient of is and that of the perpendicular bisector is , so , that is, .

Drawing the diagram with more than three sites

With many sites, drawing all the perpendicular bisectors at once creates a tangle of lines. It is best to work in order.

The rule for deciding whether a piece of perpendicular bisector is a real boundary is the usual one: a point on the perpendicular bisector of and belongs to the diagram only if no other site is closer to it than and are. In an exam, the sketch and the vertices you are asked for are usually enough.

Which site is nearest to a point

Once the diagram is drawn, deciding which site is closest to a point is as simple as seeing which cell falls in. This idea is called nearest neighbour: each point is assigned the site of its own cell. It is used, for example, to assign each house the mast that gives it signal or the health centre it belongs to.

If you do not have the complete diagram, it is enough to calculate distances using . A point on an edge is the same distance from two sites, and a vertex from three: in that case the question should say what to do.

Where to put a service that must be far from everyone

Some problems work the other way round: you look for the place furthest from all the sites, for example to locate a waste dump or a waste plant away from the villages.

Adding a new site

If a shop opens or a mast is installed, the diagram changes, but not entirely.

  • The new site gets its own cell, made up of the points that are now closer to it than to any other site.
  • That cell is taken from its neighbours: the cells of sites that are not neighbours of the new one do not change.
  • New edges appear: stretches of the perpendicular bisectors between the new site and each of its nearest neighbours. Stretches of old edges and vertices that lie inside the new cell disappear.

To redraw the diagram, calculate the perpendicular bisectors between the new site and its nearest neighbours, find the new vertices (intersections of perpendicular bisectors that are again equidistant from three sites), and erase whatever now lies inside the new site's cell.

Worked examples

Example 1 Basic

Three health centres

In the map of a region (units of 1 km) there are three health centres: , and .

a) Find the equation of the perpendicular bisector of and in the form . Give the pair .

b) Find the coordinates of the vertex of the Voronoi diagram, that is, the point equidistant from the three centres.

c) Calculate the distance from the vertex to each centre.

d) A resident lives at the point . Which centre should they go to if each resident goes to the nearest one? Answer with the letter of the centre.

Solution

a) The midpoint of is . The gradient of is , so the gradient of the perpendicular bisector is . The line is , that is, .

b) The perpendicular bisector of and is vertical, because is horizontal: it passes through the midpoint , so it is . Intersecting it with gives . The vertex is . As a check, the perpendicular bisector of (midpoint , gradient ) is , and at it gives : it passes through .

c) . Likewise and . The distance is km.

d) Compare the distances: , and . The nearest is . This is confirmed by the diagram: lies above the line (because ), on the side of .

[FIGURA mai-t4-a5-ejemplo1: x window from 0 to 8, y from 0 to 8, with a grid. Sites A(1, 2), B(7, 2) and C(3, 6) marked with a dot and letter. Vertex V(4, 3) marked with a highlighted dot and the label V(4, 3). Three thick edges leaving V: vertical x = 4 downwards to (4, 0); the perpendicular bisector of AC, y = -0.5x + 5, upwards and to the left to (0, 5); the perpendicular bisector of BC, y = x - 1, upwards and to the right to (8, 7). The three cells coloured in soft tones: cell of A on the left, cell of B on the right and below, cell of C on top. Point P(5, 5) marked with a cross and the label P, inside the cell of C.]

Example 2 Medium

A waste dump far from three villages

Three villages are located, on a map with units of 1 km, at , and . A waste dump is to be placed at a vertex of the Voronoi diagram of the three villages, so that it is as far as possible from the nearest village.

a) Find the equation of the perpendicular bisector of and in the form . Give the pair .

b) Find the coordinates of the vertex of the diagram.

c) Calculate how far the dump is from each village.

Solution

a) The midpoint of is . The gradient of is , so the gradient of the perpendicular bisector is . The line is , which gives (that is, ).

b) and are at the same height, so their perpendicular bisector is vertical and passes through the midpoint : it is . Substituting into the perpendicular bisector of : The vertex is . It is the only vertex: with three sites there is only one.

c) Distance to : km. To : km, and to it is the same by symmetry. The dump is 31.25 km from each of the three villages.

[FIGURA mai-t4-a5-ejemplo2: x window from 0 to 80 and y from 0 to 60 (rectangular area), with a grid every 10 units. Villages A(10, 10), B(70, 10) and C(40, 50) with dot and letter. Vertex V(40; 18.75) marked with a square or highlighted symbol and the label “Dump V(40; 18.75)”. Three thick edges leaving V: x = 40 downwards to (40, 0); the perpendicular bisector of AC, y = -0.75x + 48.75, upwards and to the left to (0; 48.75); the perpendicular bisector of BC, y = 0.75x - 11.25, upwards and to the right to (80; 48.75). Three cells coloured in soft tones: cell of A (left), cell of B (right) and cell of C (top). Thin dashed segments from V to A, to B and to C, with the label 31.25 km on one of them.]

Example 3 Hard

A fourth fire station

On a map with units of 1 km there are three fire stations: , and . A fourth station is built at .

a) Find the vertex of the Voronoi diagram of the three stations , and .

b) After building , is still a vertex of the new diagram? Answer "yes" or "no" and justify your answer.

c) Find the vertices of the diagram of the four stations (there are three).

d) A fire breaks out at . Which station is nearest? Answer with the letter.

Solution

a) is horizontal, so its perpendicular bisector is . For : midpoint , and the gradient of is , so the gradient of the perpendicular bisector is , hence . At : The vertex is , at a distance of from the sites: (and the same for and ).

b) No. The distance from to is , much smaller than . So is closer to than to , and , and a vertex must be equidistant from three sites with no other site closer. Therefore disappears and lies inside the cell of .

c) The vertices are points equidistant from three sites with no other site closer. We look for the perpendicular bisectors involving :

  • : midpoint , and the gradient of is , so the perpendicular bisector is .
  • : midpoint , and the gradient of is , so the perpendicular bisector is .
  • : and have the same -coordinate, so the perpendicular bisector is horizontal through the midpoint : .
  • : midpoint , gradient , perpendicular bisector . By symmetry, is .

The intersections are: with gives (equidistant from , and : ); with gives , that is (equidistant from , and ); with gives (equidistant from , and ). In all three cases no other site is closer. The vertices are , and .

d) , , and . The smallest is : the nearest station is . This matches the diagram: lies below the edge and on the same side as of the edges and , so it is inside the cell of .

[FIGURA mai-t4-a5-ej3-antes: x window from 0 to 10, y from 0 to 9, with a grid. Sites A(2, 1), B(8, 1) and C(5, 7) with dot and letter. Vertex V(5; 3.25) highlighted and labelled. Three thick edges leaving V: x = 5 downwards to (5, 0); the perpendicular bisector of AC, y = -0.5x + 5.75, to (0; 5.75); the perpendicular bisector of BC, y = 0.5x + 0.75, to (10; 5.75). Three cells coloured in soft tones: A on the left, B on the right, C at the top.]

[FIGURA mai-t4-a5-ej3-despues: same window (x from 0 to 10, y from 0 to 9). Sites A(2, 1), B(8, 1), C(5, 7) and the new site D(5, 4), the last one in a different colour and labelled “new D”. Thick edges: x = 5 from (5, 0) to the vertex (5, 1); y = -x + 6 from (5, 1) to the vertex (0.5; 5.5); y = x - 4 from (5, 1) to the vertex (9.5; 5.5); the horizontal y = 5.5 from (0.5; 5.5) to (9.5; 5.5); the perpendicular bisector of AC, y = -0.5x + 5.75, from (0.5; 5.5) to (0; 5.75) on the left edge; the perpendicular bisector of BC, y = 0.5x + 0.75, from (9.5; 5.5) to (10; 5.75) on the right edge. Vertices marked with a dot and their coordinates: (5, 1), (0.5; 5.5) and (9.5; 5.5). The four cells coloured in soft tones: A on the left, B on the right, D in the centre (the large triangle surrounding D, bounded by the edges y = -x + 6, y = x - 4 and y = 5.5) and C at the top. The former vertex (5; 3.25) shown as a greyed-out, crossed-out point inside the cell of D, labelled “disappears”. Point P(3, 5) marked with a cross in the cell of D.]

In the exam: in a problem about adding a site, marks are awarded for each perpendicular bisector that is correctly set up (midpoint, perpendicular gradient), for the intersection of the lines, and for checking that the vertex is equidistant from three sites with no other site closer. Always check the distances, and do not trust a point just because it is the intersection of two lines.

Common mistakes

Summary

  • A Voronoi diagram divides the plane into cells: the cell of each site gathers the points that are closer to it than to any other site.
  • The boundary between two neighbouring cells is part of the perpendicular bisector of their sites: midpoint and perpendicular gradient, .
  • A vertex is the point where several edges meet; it is equidistant from three sites. To find it, intersect two perpendicular bisectors and check with the third.
  • To see which site is nearest to a point, look at which cell it falls in, or compare distances (nearest neighbour).
  • The point furthest from all the sites is found among the vertices (and, if the region is bounded, also among the corners of the region).
  • When a site is added, its cell is taken from its neighbours; the neighbouring edges are redrawn and vertices inside the new cell disappear.
  • In the exam, write the midpoint, gradient and equation of each perpendicular bisector, and check distances even when using the GDC.
Maths classes in Aldaia and online

Want to work on it together?

Free first consultation: we look at your level and your exam, and build a plan. Álvaro replies on WhatsApp.

Message us on WhatsApp