Skip to main content

Grammar-Based Evolution of Polyominoes

  • Conference paper
  • First Online:
Genetic Programming (EuroGP 2024)

Abstract

Languages that describe two-dimensional (2-D) structures have emerged as powerful tools in various fields, encompassing pattern recognition and image processing, as well as modeling physical and chemical phenomena. One kind of two-dimensional structures is given by labeled polyominoes, i.e., geometric shapes composed of connected unit squares represented in a 2-D grid. In this paper, we present (a) a novel approach, based on grammars, for describing sets of labeled polyominoes that meet some predefined requirements and (b) an algorithm to develop labeled polyominoes using the grammar. We show that the two components can be used for solving optimization problems in the space of labeled polyominoes, similarly to what happens for strings in grammatical evolution (and its later variants). We characterize our algorithm for developing polyominoes in terms of representation-related metrics (namely, validity, redundancy, and locality), also by comparing different representations. We experimentally validate our proposal using a simple evolutionary algorithm on a few case studies where the goal is to obtain a target polyomino: we show that it is possible to enforce hard constraints in the search space of polyominoes, using a grammar, while performing the evolutionary search.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

References

  1. Barequet, G., Golomb, S.W., Klarner, D.A.: Polyominoes. In: Handbook of Discrete and Computational Geometry, pp. 359–380, Chapman and Hall/CRC (2017)

    Google Scholar 

  2. Bartoli, A., Castelli, M., Medvet, E.: Weighted hierarchical grammatical evolution. IEEE Trans. Cybern. 50(2), 476–488 (2018)

    Article  Google Scholar 

  3. Conway, A.: Enumerating 2D percolation series by the finite-lattice method: theory. J. Phys. A: Math. Gen. 28(2), 335 (1995)

    Article  Google Scholar 

  4. Fernau, H., Schmid, M.L., Subramanian, K.G.: Two-dimensional pattern languages. In: Workshop on Non-classical Models for Automata and Applications (2017)

    Google Scholar 

  5. Fukuda, H., Kanomata, C., Mutoh, N., Nakamura, G., Schattschneider, D.: Polyominoes and polyiamonds as fundamental domains of isohedral tilings with rotational symmetry. Symmetry 3(4), 828–851 (2011). ISSN 2073-8994

    Article  MathSciNet  Google Scholar 

  6. Giammarresi, D., Restivo, A.: Two-dimensional languages. In: Rozenberg, G., Salomaa, A. (eds.) Handbook of Formal Languages, pp. 215–267. Springer, Heidelberg (1997). https://doi.org/10.1007/978-3-642-59126-6_4. ISBN 978-3-642-59126-6

  7. Golomb, S.W., Klarner, D.A.: Polyominoes. In: Goodman, J.E., O’Rourke, J. (eds.) Handbook of Discrete and Computational Geometry, 2nd edn., pp. 331–352. Chapman and Hall/CRC (2004)

    Google Scholar 

  8. Grimmett, G.: What is Percolation? In: Grimmett, G. (ed.) Percolation. Grundlehren der mathematischen Wissenschaften, vol. 321, pp. 1–31. Springer, Heidelberg (1999). https://doi.org/10.1007/978-3-662-03981-6_1. ISBN 978-3-662-03981-6

  9. Hansen, N., Arnold, D.V., Auger, A.: Evolution strategies. In: Kacprzyk, J., Pedrycz, W. (eds.) Springer Handbook of Computational Intelligence, pp. 871–898. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-43505-2_44

    Chapter  Google Scholar 

  10. Harper, R.: GE, explosive grammars and the lasting legacy of bad initialisation. In: IEEE Congress on Evolutionary Computation. IEEE (2010)

    Google Scholar 

  11. Johnson, L., Yannakakis, G.N., Togelius, J.: Cellular automata for real-time generation of infinite cave levels. In: Proceedings of the 2010 Workshop on Procedural Content Generation in Games, pp. 1–4 (2010)

    Google Scholar 

  12. Knight, T., Stiny, G.: Making grammars: from computing with shapes to computing with things. Des. Stud. 41, 8–28 (2015)

    Article  Google Scholar 

  13. Knuth, D.E.: Dancing links. arXiv preprint cs/0011047 (2000)

    Google Scholar 

  14. Křivka, Z., Martín-Vide, C., Meduna, A., Subramanian, K.G.: A variant of pure two-dimensional context-free grammars generating picture languages. In: Barneva, R.P., Brimkov, V.E., Šlapal, J. (eds.) IWCIA 2014. LNCS, vol. 8466, pp. 123–133. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-07148-0_12. ISBN 978-3-319-07148-0

  15. Lavirotte, S., Pottier, L.: Optical formula recognition. In: Proceedings of the Fourth International Conference on Document Analysis and Recognition, vol. 1, pp. 357–361. IEEE (1997)

    Google Scholar 

  16. Lourenço, N., Pereira, F.B., Costa, E.: Unveiling the properties of structured grammatical evolution. Genet. Program Evolvable Mach. 17, 251–289 (2016)

    Article  Google Scholar 

  17. Manzoni, L., Bartoli, A., Castelli, M., Gonçalves, I., Medvet, E.: Specializing context-free grammars with a (1+ 1)-EA. IEEE Trans. Evol. Comput. 24(5), 960–973 (2020)

    Article  Google Scholar 

  18. Matz, O.: Regular expressions and context-free grammars for picture languages. In: Reischuk, R., Morvan, M. (eds.) STACS 1997. LNCS, vol. 1200, pp. 283–294. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0023466. ISBN 978-3-540-68342-1

  19. Medvet, E.: A comparative analysis of dynamic locality and redundancy in grammatical evolution. In: McDermott, J., Castelli, M., Sekanina, L., Haasdijk, E., García-Sánchez, P. (eds.) EuroGP 2017. LNCS, vol. 10196, pp. 326–342. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-55696-3_21

    Chapter  Google Scholar 

  20. Medvet, E., Bartoli, A., De Lorenzo, A., Tarlao, F.: GOMGE: gene-pool optimal mixing on grammatical evolution. In: Auger, A., Fonseca, C.M., Lourenço, N., Machado, P., Paquete, L., Whitley, D. (eds.) PPSN 2018, Part I. LNCS, vol. 11101, pp. 223–235. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-99253-2_18

    Chapter  Google Scholar 

  21. Medvet, E., Nadizar, G.: GP for continuous control: teacher or learner? The case of simulated modular soft robots. In: Winkler, S., Trujillo, L., Ofria, C., Hu, T. (eds.) Genetic Programming Theory and Practice XX. Genetic and Evolutionary Computation, pp. 203–224. Springer, Singapore (2023). https://doi.org/10.1007/978-981-99-8413-8_11

    Chapter  Google Scholar 

  22. Medvet, E., Nadizar, G., Manzoni, L.: JGEA: a modular java framework for experimenting with evolutionary computation. In: Proceedings of the Genetic and Evolutionary Computation Conference Companion, pp. 2009–2018 (2022)

    Google Scholar 

  23. Medvet, E., Virgolin, M., Castelli, M., Bosman, P.A., Gonçalves, I., Tušar, T.: Unveiling evolutionary algorithm representation with du maps. Genet. Program Evolvable Mach. 19, 351–389 (2018)

    Article  Google Scholar 

  24. Nicolau, M., Agapitos, A.: Understanding grammatical evolution: grammar design. In: Ryan, C., O’Neill, M., Collins, J.J. (eds.) Handbook of Grammatical Evolution, pp. 23–53. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-78717-6_2

    Chapter  Google Scholar 

  25. Noya, E., Benedí, J.M., Sánchez, J.A., Anitei, D.: Discriminative learning of two-dimensional probabilistic context-free grammars for mathematical expression recognition and retrieval. In: Pinho, A.J., Georgieva, P., Teixeira, L.F., Sánchez, J.A. (eds.) IbPRIA 2022. LNCS, vol. 13256, pp. 333–347. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-04881-4_27

    Chapter  Google Scholar 

  26. Ong, H.S., Syafiq-Rahim, M., Kasim, N.H.A., Firdaus-Raih, M., Ramlan, E.I.: Self-assembly programming of DNA polyominoes. J. Biotechnol. 236, 141–151 (2016). ISSN 0168-1656

    Article  Google Scholar 

  27. Ota, P.A.: Mosaic grammars. Pattern Recogn. 7(1–2), 61–65 (1975)

    Article  MathSciNet  Google Scholar 

  28. Pigozzi, F., Medvet, E., Bartoli, A., Rochelli, M.: Factors impacting diversity and effectiveness of evolved modular robots. ACM Trans. Evol. Learn. 3(1), 1–33 (2023)

    Article  Google Scholar 

  29. Prusa, D., Hlavá, V.: 2D context-free grammars: Mathematical formulae recognition. In: Prague Stringology Conference (2006)

    Google Scholar 

  30. Rothlauf, F., Goldberg, D.E.: Redundant representations in evolutionary computation. Evol. Comput. 11(4), 381–415 (2003)

    Article  Google Scholar 

  31. Ryan, C., Collins, J.J., Neill, M.O.: Grammatical evolution: evolving programs for an arbitrary language. In: Banzhaf, W., Poli, R., Schoenauer, M., Fogarty, T.C. (eds.) EuroGP 1998. LNCS, vol. 1391, pp. 83–96. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055930

    Chapter  Google Scholar 

  32. Sakai, I.: Syntax in universal translation. In: Proceedings of the International Conference on Machine Translation and Applied Language Analysis (1961)

    Google Scholar 

  33. Salimans, T., Ho, J., Chen, X., Sidor, S., Sutskever, I.: Evolution strategies as a scalable alternative to reinforcement learning. arXiv preprint arXiv:1703.03864 (2017)

  34. Subramanian, K., Ali, R.M., Geethalakshmi, M., Nagar, A.K.: Pure 2D picture grammars and languages. Discret. Appl. Math. 157(16), 3401–3411 (2009)

    Article  MathSciNet  Google Scholar 

  35. Thierens, D., Bosman, P.A.: Optimal mixing evolutionary algorithms. In: Proceedings of the 13th Annual Conference on Genetic and Evolutionary Computation, pp. 617–624 (2011)

    Google Scholar 

  36. Whittington, S.G., Soteros, C.E.: Lattice animals: rigorous results and wild guesses (1990)

    Google Scholar 

  37. Winslow, A.: Staged self-assembly and polyomino context-free grammars. Nat. Comput. 14(2), 293–302 (2015)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

This research is the result of the collaboration with the Department of Engineering and Architecture of the University of Trieste, Italy; supported by the 2023 SPECIES scholarship. The first author is funded by FCT - Foundation for Science and Technology, under the grant 2022.10174.BD. This work was supported by the Portuguese Recovery and Resilience Plan (PRR) through project C645008882-00000055, Center for Responsible AI, by the FCT, I.P./MCTES through national funds (PIDDAC), by Project No. 7059 - Neuraspace - AI fights Space Debris, reference C644877546-00000020, supported by the RRP - Recovery and Resilience Plan and the European Next Generation EU Funds, following Notice No. 02/C05-i01/2022, Component 5 - Capitalization and Business Innovation - Mobilizing Agendas for Business Innovation, and within the scope of CISUC R &D Unit - UIDB/00326/2020.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Eric Medvet .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Mégane, J., Medvet, E., Lourenço, N., Machado, P. (2024). Grammar-Based Evolution of Polyominoes. In: Giacobini, M., Xue, B., Manzoni, L. (eds) Genetic Programming. EuroGP 2024. Lecture Notes in Computer Science, vol 14631. Springer, Cham. https://doi.org/10.1007/978-3-031-56957-9_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-56957-9_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-56956-2

  • Online ISBN: 978-3-031-56957-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics