Packing circles in a rectangular domain with a touch-and-stop model of growth (contact inhibition)
2016-09-18T09:16:14Z (GMT) by
This MATLAB algorithm allows you to pack n circles in a rectangular domain (see sample images).
The void ratio (i.e., amount of empty space in the rectangle) is user-defined and met precisely.
The domain has an arbitrary size that you can choose. Other parameters are also available for you to tweak.
The position of all circles is randomised: this means that it is virtually impossible to obtain two packed domains that look the same.
As an example, it is possible to pack >60,000 circles to a void ratio of 15% in 230 s (i7 4790k, DDR3 RAM 2400 Mhz).
The algorithm works by seeding a starting population of tiny circles, which are grown until they touch another circle or a boundary of the domain. Once all circles have grown, a new generation of tiny circles are created and grown.
This is repeated until the required void ratio is met.
Results are displayed in a figure and saved in .mat format.
The code is thoroughly commented to allow easy understanding of the process.
Please remember that if you use this algorithm, you should cite it (e.g., articles, theses) and, in any case, leave the attribution text (MIT license).
There is a link above that will show the citation information for this algorithm (DOI, authors, title).