Circle Packing Challenge Activity
Main.CircleChallenge History
Show minor edits - Show changes to markup
(:html:)
<div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
(:htmlend:)
Thanks to Frank Kampas for providing source code and animations for this challenge problem. Frank holds a Ph.D. in physics from Stanford University and can be reached at frank@physicistatlarge.com.
Download Sample MATLAB Code
MATLAB source code writes an APM optimization file and sends it to the APMonitor server for solution. After the script executes, a figure appears that shows the best and worst configurations.
- Solve 4 Circle Packing Problem
- Solve 4 Circle Packing Problem Online
- Solve 10 Circle Packing Problem
(:html:) <iframe src="https://apmonitor.com/me575/uploads/Main/packcircles10.htm" width="500" height="1500" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe> (:htmlend:)
- Solve 10 Circle Packing Problem Online
Download Sample Python Code
Download Sample Python Code - Version 1
(:htmlend:)
Download Sample Python Code - Version 2
A second version solves multiple circle packing optimization problems with the same model using multi-dimensional arrays. Python source code re-writes the optimization file and sends it to the APM server for solution. After the script executes, a figure appears that shows the configuration that was produced.
Example Solution for 10 Circles

- Solve 10 Circle Packing Problem
(:html:) <iframe src="https://apmonitor.com/me575/uploads/Main/packcircles10.htm" width="500" height="1500" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe>
- 'containers' - in this case a circle that circuscribes all of the other circles
- 'containers' - in this case a circle that circumscribes all of the other circles
Python source code re-writes the optimization file and sends it to the APM server for solution. After the script executes, a figure appears that shows the configuration that was produced.
- Solve 4 Circle Packing Problem
<iframe src="https://apmonitor.com/me575/uploads/Main/packcircles.htm" width="450" height="600" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://apmonitor.com/me575/uploads/Main/packcircles.htm" width="500" height="600" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://apmonitor.com/me575/uploads/Main/packcircles.htm" width="550" height="700" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://apmonitor.com/me575/uploads/Main/packcircles.htm" width="450" height="600" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="400" height="600" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="550" height="900" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="500" height="800" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="400" height="600" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="550" height="1000" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
<iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="500" height="800" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
(:html:) <iframe src="https://apmonitor.com/me575/uploads/Main/packcircles.htm" width="550" height="700" frameborder="1" marginheight="0" marginwidth="0">Loading...</iframe> (:htmlend:)
Background
Packing problems are a class of optimization problems in mathematics which involve attempting to pack objects together (often inside a container), as densely as possible. Many of these problems can be related to real life packaging, storage and transportation issues. In a packing problem, you are given:
- 'containers' - in this case a circle that circuscribes all of the other circles
- 'goods' (usually a single type of shape), some or all of which must be packed into this container
Usually the packing must be without overlaps between goods and other goods or the container walls. The aim is to find the configuration with the maximal density. In some variants the overlapping (of goods with each other and/or with the boundary of the container) is allowed but should be minimized.
(:title Circle Packing Challenge Activity:) (:keywords project, nonlinear, optimization, engineering optimization, engineering design, interior point, active set, circle packing, packing optimization, python, matlab:) (:description A challenge problem to determine the minimum circumscribing radius for n circles with radius i^(-0.5) for i=1..n.:)
Challenge Problem in Global Optimization
Determine the minimum circumscribing radius for n circles with radius i^(-0.5) for i=1..n.
Download Sample Python Code
Record Your Best Answer
(:html:) <iframe src="https://docs.google.com/a/apmonitor.com/spreadsheet/embeddedform?formkey=dGp4bExwUU1wOVhOT3M1T2otY1g3LXc6MQ" width="550" height="1000" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe> (:htmlend:)
(:html:)
<div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
(:htmlend:)