Voronoi Coverage

Change the number of robots or try a fresh start to see how they divide a field into territories.

8 agents · coverage cost —

drag a site to re-tessellate

this run seed 1 · cost —

What changed between runs?

Lloyd's algorithm always lowers the coverage cost, but it only reaches a local optimum — the nearest balanced configuration to wherever the sites began. A centroidal Voronoi tessellation is not unique: each random start falls into a different basin, so you get a different valid tiling and a different final cost. Try "New random start" a few times and watch the cost readout settle to slightly different values.

What you are looking at

Dots
The robots that serve as sites for the cells.
Shaded regions
The areas closest to each robot.
Cell boundaries
The dividing lines between neighbouring territories.

Try this

  1. Change the agent count to watch the robots divide the field into a new set of cells.
  2. Press New random start and compare the final tiling and coverage cost.

Key idea

Lloyd’s algorithm assigns each point to its nearest robot, then moves each robot toward its cell’s centroid.