Packing algorithm inspired by gravitational and electromagnetic effects

  • Felix Martinez-RiosEmail author
  • Alfonso Murillo-Suarez


This paper introduces a faster and more efficient algorithm for solving a two-dimension packing problem. This common optimization problem takes a set of geometrical objects and tries to find the best form of packing them in a space with specific characteristics, called container. The visualization of nanoscale electromagnetic fields was the inspiration for this new algorithm, using the electromagnetic field between the previously placed objects, this paper explains how to determine the best positions for to place the remaining ones. Two gravitational phenomena are also simulated to achieve better results: shaken and gravity. They help to compact the objects to reduce the occupied space. This paper shows the executions of the packing algorithm for four types of containers: rectangles, squares, triangles, and circles.


Optimization Packing problem Electromagnetic fields Nature-inspired algorithm Gravitational algorithms 



I am grateful to my wife Roco for her invaluable help for reviewing the styling and writing of this paper.


  1. 1.
    Addis, B., Locatelli, M., & Schoen, F. (2008). Disk packing in a square: A new global optimization approach. Informs Journal of Computing, 20(4), 516–524.MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Al-Mudahka, I., Hifi, M., & M’Hallah, R. (2011). Packing circles in the smallest circle: An adaptive hybrid algorithm. Journal of the Operational Research Society, 62, 1917–1930.CrossRefGoogle Scholar
  3. 3.
    Baltaciolu, E., Moore, J., & Hill, R, Jr. (2006). The distributor’s three-dimensional pallet-packing problem: A human intelligence-based heuristic approach. International Journal of Operational Research, 1(3), 249–266. Scholar
  4. 4.
    Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological), 57(1), 289–300.MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Brooke, J., Bitko, D., Rosenbaum, T. F., & Aeppli, G. (1999). Quantum annealing of a disordered magnet. Management Science, 284(5415), 779–781.Google Scholar
  6. 6.
    Castillo, I., Kampas, F. J., & Pintr, J. D. (2008). Solving circle packing problems by global optimization: Numerical results and industrial applications. European Journal of Operational Research, 191(3), 786–802.MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Dell’Amico, M., Dza, J. C. D., & Lori, M. (2012). The bin packing problem with precedence constraints. Operations Research, 60(6), 1491–1504.MathSciNetCrossRefGoogle Scholar
  8. 8.
    Dokeroglu, T., & Cosar, A. (2014). Optimization of one-dimensional bin packing problem with island parallel grouping genetic algorithms. Computers and Industrial Engineering, 75, 176–186.CrossRefGoogle Scholar
  9. 9.
    Eberhart, R., & Kennedy, J. (1995). A new optimizer using particle swarm theory. In Proceedings of the sixth international symposium on micro machine and human science, 1995. MHS ’95 (pp. 39–43).Google Scholar
  10. 10.
    George, J. A., George, J. M., & Lamar, B. W. (1995). Packing different-sized circles into a rectangular container. European Journal of Operational Research, 84(3), 693–712.CrossRefzbMATHGoogle Scholar
  11. 11.
    Hatamlou, A. (2013). Black hole: A new heuristic optimization approach for data clustering. Information Sciences, 222, 175–184.MathSciNetCrossRefGoogle Scholar
  12. 12.
    Haus, J. W. (2016). Introduction to nanophotonics. In J. W. Haus (Ed.), Fundamentals and applications of nanophotonics (pp. 1–11). Sawston: Woodhead Publishing.Google Scholar
  13. 13.
    Holland, J. H. (1992). Adaptation in natural and artificial systems: An introductory analysis with applications to biology, control and artificial intelligence. Cambridge, MA: MIT Press.CrossRefGoogle Scholar
  14. 14.
    Karaboga, D., & Basturk, B. (2007). A powerful and efficient algorithm for numerical function optimization: Artificial bee colony (ABC) algorithm. Journal of Global Optimization, 39(3), 459–471.MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Litvinchev, I., & Ozuna, E. (2014). Approximate packing circles in a rectangular container: Valid inequalities and nesting. Journal of Applied Research and Technology, 12(4), 716–723. Scholar
  16. 16.
    Martinez-Rios, F. (2017). A new hybridized algorithm based on population-based simulated annealing with an experimental study of phase transition in 3-SAT. Procedia Computer Science, 116, 427–434.CrossRefGoogle Scholar
  17. 17.
    Martinez-Rios, F., & Marmolejo-Saucedo, J. A. (2018). Packing instances.
  18. 18.
    Huang, W. Q., Li, Y., Akeb, H., & Li, C. M. (2005). Greedy algorithms for packing unequal circles into a rectangular container. Journal of the Operational Research Society, 56, 539–548. Scholar
  19. 19.
    Rashedi, E., Nezamabadi-pour, H., & Saryazdi, S. (2009). GSA: A gravitational search algorithm. Information Sciences, 179(13), 2232–2248.CrossRefzbMATHGoogle Scholar
  20. 20.
    Sarangan, A. (2016). Quantum mechanics and computation in nanophotonics. In J. W. Haus (Ed.), Fundamentals and applications of nanophotonics (pp. 45–87). Sawston: Woodhead Publishing.CrossRefGoogle Scholar
  21. 21.
    Seiden, S. (2002). On the online bin packing problem. Journal of ACM, 49(5), 640–671.MathSciNetCrossRefzbMATHGoogle Scholar
  22. 22.
    Socha, K., Knowles, J., & Sampels, M. (2002). A MAX–MIN ant system for the university course timetabling problem (pp. 1–13). Berlin: Springer.Google Scholar
  23. 23.
    Steuwe, C., Erdelyi, M., Szekeres, G., Csete, M., Baumberg, J. J., Mahajan, S., et al. (2015). Visualizing electromagnetic fields at the nanoscale by single molecule localization. Nano Letters, 15(5), 3217–3223.CrossRefGoogle Scholar
  24. 24.
    Szabó, P. G., Markót, M. C., & Csendes, T. (2005). Global optimization in geometry—Circle packing into the square (pp. 233–265). Boston, MA: Springer.zbMATHGoogle Scholar
  25. 25.
    Yan, G. W., & Hao, Z. J. (2013). A novel optimization algorithm based on atmosphere clouds model. International Journal of Computational Intelligence and Applications, 12(01), 1350002.CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Universidad PanamericanaMexico CityMexico

Personalised recommendations