Home▸AI & Machine Learning▸Territory Capture 2D: Voronoi Partitioning & Lloyd's Algorithm

Territory Capture 2D: Voronoi Partitioning & Lloyd's Algorithm

2D top-down territory-capture lab: mobile agents partition the plane into a live Voronoi diagram, and a Lloyd's-algorithm centroid-pull slider shows decentralized multi-agent coverage control converge or stay chaotic in real time.

AI & Machine Learning2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
Territory Capture 2D: Voronoi Partitioning & Lloyd's Algorithm ↗ Open standalone

This 2D companion replaces the original's decorative 3D "AI training" scene with the real mechanic its title implies: a live Voronoi diagram where each of a handful of mobile agents "captures" every grid cell closer to it than to any rival, and a Lloyd's-algorithm centroid-pull slider drives the classic multi-robot coverage-control law — each agent chasing the centroid of the territory it currently owns — so you can watch decentralized area division either relax into a stable, balanced partition or stay in permanent flux once wander noise is added.

⚙ Under the hood

2D top-down territory-capture lab: mobile agents partition the plane into a live Voronoi diagram, and a Lloyd's-algorithm centroid-pull slider shows decentralized multi-agent coverage control converge or stay chaotic in real time.

voronoi diagramlloyd's algorithmcoverage controlmulti-agent systemsnearest neighborcentroidal tessellation

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)