IB Maths AI SL Topic 3 — Voronoi Diagrams Paper 1 & 2 Nearest neighbour ~7 min read

Interpreting Voronoi Diagrams

Once a Voronoi diagram is drawn, the typical exam tasks are: (1) decide which site is closest to a given point, (2) compute the actual distance to that site (often with a scale factor), and (3) use the nearest-site’s data to predict a value for the given point — the technique called nearest-neighbour interpolation. Every question reduces to the distance formula and “smallest wins”.

๐Ÿ“˜ What you need to know

The three core questions

Most AI SL Voronoi-interpretation problems boil down to three skills, applied in sequence. The flowchart below tells you which calculation to reach for.

Three core questions — one decision tree What’s the question asking about the point? “Which site is closest?” cell membership Compute distance to EACH site pick the SMALLEST “How far to its site?” shortest distance Distance formula then ร— scale (if any) “Predict a value here” interpolation Find nearest site, use ITS data as the prediction Common engine: distance formula d = โˆš((xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ) Every branch above ultimately calls this formula one or more times.
Three exam tasks, all powered by the same distance formula. Branch 1 calls it for each site (then picks the minimum). Branch 2 calls it once. Branch 3 calls it for each site, picks the minimum, then quotes the value associated with that site.
The interpretation toolkit closest site to a point: smallest d
dreal = ddiagram × (scale factor)
nearest-neighbour interpolation: predicted value = (nearest site’s value)

๐Ÿงญ Recipe — any interpretation problem

  1. Plot the point on the diagram (mentally or with a sketch). Note which cell it appears to be in.
  2. Confirm by distance: compute the distance from the point to each candidate site — the smallest is the cell it actually belongs to.
  3. For “shortest distance”: it’s the distance to the closest site (step 2’s smallest), then multiply by the scale factor if one is given.
  4. For “predict a value”: locate the cell (step 2), then read off the nearest site’s data — that’s the prediction.
  5. For “furthest point from any site”: the answer is at a VERTEX of the diagram (next note’s full method).
If a point falls exactly on an edge, it’s equidistant from the two sites either side. You can use either site’s data for prediction — or quote both as a tied answer.

Worked examples

WE 1

Which site is closest?

A Voronoi diagram has three weather stations at A(2, 8), B(7, 7) and C(5, 2). A new farm is built at P(4, 5). Which station should be used to predict rainfall at the farm?

Compute distance from P to each station d(P, A) = โˆš((4โˆ’2)ยฒ + (5โˆ’8)ยฒ) = โˆš(4+9) = โˆš13 โ‰ˆ 3.61 d(P, B) = โˆš((4โˆ’7)ยฒ + (5โˆ’7)ยฒ) = โˆš(9+4) = โˆš13 โ‰ˆ 3.61 d(P, C) = โˆš((4โˆ’5)ยฒ + (5โˆ’2)ยฒ) = โˆš(1+9) = โˆš10 โ‰ˆ 3.16 Pick the smallest โˆš10 < โˆš13 โ†’ station C is closest use station C’s data P is exactly equidistant from A and B (both โˆš13), but C beats both โ€” so cell membership is clear. The “tie” between A and B doesn’t matter because neither is the winner.
WE 2

Shortest distance with a scale factor

On a Voronoi diagram, the point P(4, 6) lies in the cell of site M at (8, 3). The scale of the diagram is such that 1 unit represents 4 km. Find the shortest distance from P to its nearest site, giving your answer in km.

P is in cell M โ†’ nearest site is M Distance formula d = โˆš((4โˆ’8)ยฒ + (6โˆ’3)ยฒ) = โˆš(16 + 9) = โˆš25 = 5 units Apply scale factor (1 unit = 4 km) real distance = 5 ร— 4 = 20 km shortest distance = 20 km (3, 4, 5) Pythagorean triple โ€” gives a clean 5 units on the diagram. Always multiply by the scale at the END, after the distance is found in diagram units.
WE 3

Point on a boundary — equidistant from two sites

A delivery hub is located at H(5, 3). Two supermarkets are at X(2, 7) and Y(8, 7). Show that H lies on the boundary between cells X and Y, and state the distance from H to its nearest site.

A point is on the Xโ€“Y edge โ‡” HX = HY Compute HX HX = โˆš((5โˆ’2)ยฒ + (3โˆ’7)ยฒ) = โˆš(9 + 16) = โˆš25 = 5 Compute HY HY = โˆš((5โˆ’8)ยฒ + (3โˆ’7)ยฒ) = โˆš(9 + 16) = โˆš25 = 5 Compare HX = HY = 5 โ†’ H is on edge between X and Y โœ“ nearest distance = 5 units (tied: X and Y) when a point is on an edge, BOTH adjacent sites are tied for “nearest”. The shortest distance is the same number; the prediction can use either site (or quote both).
WE 4

Find the vertex of three cells from sites

A Voronoi diagram has three sites A(0, 0), B(8, 0), C(4, 8). The diagram has a single internal vertex V. (a) Find the coordinates of V. (b) Find the distance from V to its nearest site.

(a) Find V โ€” intersect two perpendicular bisectors โŠฅAB: AB is horizontal, midpoint (4,0) โŠฅAB: x = 4 โŠฅAC: midpoint (2,4), grad AC = 8/4 = 2 perp gradient = โˆ’1/2 โŠฅAC: y โˆ’ 4 = โˆ’ยฝ(x โˆ’ 2) โ†’ y = โˆ’x/2 + 5 Intersect: x = 4 โ†’ y = โˆ’2 + 5 = 3 V = (4, 3) (b) V is equidistant from all three sites (it’s a vertex) VA = โˆš(16+9) = โˆš25 = 5 VB = โˆš(16+9) = 5 โœ“ VC = โˆš(0+25) = 5 โœ“ V = (4, 3), distance to nearest site = 5 a Voronoi vertex is equidistant from THREE sites โ€” so computing one of the three distances is enough. Verifying all three is a good check.
WE 5

Nearest-neighbour interpolation

Four fast-food branches and their average daily customer counts: A(2, 5) — 120 customers; B(9, 5) — 180 customers; C(5, 1) — 95 customers; D(5, 9) — 150 customers. A new branch is planned at P(6, 3). Use nearest-neighbour interpolation to estimate the daily customer count at P.

Find the closest branch to P d(P, A) = โˆš(16+4) = โˆš20 โ‰ˆ 4.47 d(P, B) = โˆš(9+4) = โˆš13 โ‰ˆ 3.61 d(P, C) = โˆš(1+4) = โˆš5 โ‰ˆ 2.24 d(P, D) = โˆš(1+36) = โˆš37 โ‰ˆ 6.08 Smallest is โˆš5 โ†’ C is closest Nearest-neighbour interpolation: predicted = C’s value prediction = 95 customers/day estimated daily customers โ‰ˆ 95 nearest-neighbour interpolation IGNORES the other sites’ values. Only the closest one matters. The assumption is that nearby locations behave similarly โ€” a strong assumption that may be wrong, but it’s the IB AI SL method.
WE 6

Multi-step — nearest warehouse, scale, and cost

A delivery company has three warehouses at P(2, 2), Q(8, 2) and R(5, 7). A new customer is at C(5, 5). 1 unit on the diagram represents 10 km, and delivery costs €0.50 per km. (a) Which warehouse should deliver? (b) Find the delivery cost.

(a) Find the closest warehouse to C d(C, P) = โˆš(9+9) = โˆš18 โ‰ˆ 4.24 d(C, Q) = โˆš(9+9) = โˆš18 โ‰ˆ 4.24 d(C, R) = โˆš(0+4) = 2 โ† smallest warehouse R is closest (b) Convert to real distance using scale real distance = 2 ร— 10 = 20 km Multiply by cost rate cost = 20 ร— โ‚ฌ0.50 = โ‚ฌ10 (a) R ยท (b) โ‚ฌ10 three-step combo: nearest-site identification โ†’ scale conversion โ†’ cost calculation. P and Q are equidistant from C, but R wins, so the tie doesn’t affect the answer.

๐Ÿ’ก Top tips

  • Always confirm cell membership by distance, not by eyeballing the diagram. Diagrams in exams can be misleading or not-to-scale.
  • Apply scale at the END: do all your distance calculations in diagram units, then multiply by the scale factor once.
  • Spot Pythagorean triples: (3, 4, 5), (5, 12, 13), (8, 15, 17). They appear often and give clean integer distances.
  • “Nearest neighbour” = nearest only: ignore all other sites once you’ve identified the closest one. The prediction comes from that single site.
  • Vertex distances are useful: a vertex is equidistant from three sites, so one distance calculation gives you all three.

โš  Common mistakes

  • Reading the wrong cell from the diagram: always verify with distances. Visual inspection alone can fool you on tight boundaries.
  • Forgetting the scale factor: if a question says “1 unit = 4 km” and asks for km, you MUST multiply by 4 at the end.
  • Averaging multiple sites for prediction: nearest-neighbour interpolation uses ONLY the closest site. Don’t take an average.
  • Confusing edge distance with nearest-site distance: a point’s distance to its nearest site is to the SITE itself (the dot), not to the edge of the cell.
  • Square-root mistakes: d² = 25 means d = 5, not 25. Don’t forget the final square root.
Up next: The Toxic Waste Dump Problem. Same diagram, opposite question: find the point that is as FAR as possible from any site. The answer is always one of the vertices, and the technique is the largest empty circle. With this you’ll have everything AI SL asks about Voronoi diagrams.

Need help with AI SL Voronoi Diagrams?

Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.

Book Free Session →