Simple heuristic for packing discs of varying radii in a circle

Version on this page:
Stackage Nightly 2017-08-20:
LTS Haskell 9.1:
Stackage Nightly 2017-08-20:
Latest on Hackage:
BSD3 licensed and maintained by Joachim Breitner

Module documentation for

Given a number of circles with their radii, this packags tries to arrange them tightly, without overlap and forming a large circle.

Finding the optimal solution is NP hard, so only heuristics are feasible. This particular implementation is neither very good nor very fast, compared to the state of the art in research. Nevertheless it is simple to use and gives visually acceptable results.

You can explore the algorithm live at

Contributions of better algorithms are welcome.

Depends on:
Used by 1 package:
comments powered byDisqus