Home▸Articles▸AI & Machine Learning

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

A fascinating exploration of geometric partitioning and decentralized multi-agent systems.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What is Voronoi Partitioning?

Voronoi partitioning divides space into regions based on proximity to certain points. Each region consists of all the points closer to its associated point than to any other. This concept finds applications in various fields, from computer graphics and geographic information systems to cellular biology.

In a 2D plane, Voronoi cells are polygons that represent these regions, with each cell's boundary being equidistant from two or more points (the sites).

Lloyd's Algorithm: Centroidal Voronoi Tessellation

Lloyd's algorithm is a method for generating a centroidal Voronoi tessellation, where the centroids of the cells coincide with their respective generator points. This process iteratively moves each site to the centroid of its cell, leading to more uniform and balanced partitions.

The algorithm is widely used in computer graphics for generating natural-looking textures and in computational geometry for efficient spatial partitioning.

live demo · related simulation● LIVE

Decentralized Multi-Agent Systems

In decentralized multi-agent systems, each agent operates based on local information without a central controller. This approach mimics real-world scenarios where agents must coordinate without centralized oversight.

The simulation demonstrates how Lloyd's algorithm can be used to achieve uniform coverage of space by mobile agents, which is crucial in applications like robotics and sensor networks.

Real-World Applications

Voronoi diagrams are used in urban planning to optimize the distribution of services and facilities. For example, they can help determine the best locations for hospitals or fire stations based on population density.

In wireless communication, Voronoi cells represent the coverage areas of base stations, ensuring efficient signal distribution across a network.

Frequently asked questions

What is Lloyd's algorithm used for in practical applications?

Lloyd's algorithm is used to generate centroidal Voronoi tessellations which are essential in various fields such as computer graphics, image processing, and wireless network design.

How does Voronoi partitioning differ from other geometric partitions?

Voronoi partitioning focuses on proximity to points rather than equal division of space. Each cell is defined by the set of points closer to its associated point than any other, making it unique in spatial analysis and optimization problems.

Can Lloyd's algorithm be applied to 3D spaces?

Yes, Lloyd's algorithm can indeed be extended to 3D spaces. It is used for generating centroidal Voronoi tessellations in three dimensions, which are useful in applications like volumetric data processing and 3D modeling.

What happens if the agent count is increased in the simulation?

Increasing the agent count generally leads to a more complex but potentially more balanced Voronoi partitioning. More agents can lead to finer-grained partitions, which may improve coverage and efficiency in multi-agent systems.

Try it live

Everything above runs in your browser — open Territory Capture 2D: Voronoi Partitioning & Lloyd's Algorithm and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

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

What did you find?

Add reproduction steps (optional)