Skip to main content

Understanding Grammatical Evolution: Grammar Design

  • Chapter
  • First Online:
Handbook of Grammatical Evolution

Abstract

A frequently overlooked consideration when using Grammatical Evolution (GE) is grammar design. This is because there is an infinite number of grammars that can specify the same syntax. There are, however, certain aspects of grammar design that greatly affect the speed of convergence and quality of solutions generated with GE. In this chapter, general guidelines for grammar design are presented. These are domain-independent, and can be used when applying GE to any problem. An extensive analysis of their effect and results across a large set of experiments are reported.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Technically, genotypes used with GE are length-bounded, in the sense that they cannot be smaller than zero, or larger than what the memory of the machine running the experiments can hold. This maximum size is, however, a technical limitation, rather than a conceptual bound.

  2. 2.

    The required number of 2500∕3 copies of each of the productions using the operators +, −, ∗ were rounded to 833, resulting in a negligible bias.

  3. 3.

    As the focus of this study is on grammar design, no regression performance improving techniques such as linear scaling [12] or cross-validation were used.

References

  1. J. Byrne, M. O’Neill, J. McDermott, A. Brabazon, An analysis of the behaviour of mutation in grammatical evolution, in European Conference on Genetic Programming, EuroGP 2010, ed. by A.I. Esparcia-Alcázar et al. Lecture Notes in Computer Science, vol. 6021 (Springer, Berlin, 2010), pp. 14–25

    Google Scholar 

  2. P. Cortez, A. Morais, A data mining approach to predict forest fires using meteorological data, in Portuguese Conference on Artificial Intelligence, EPIA 2007, ed. by J. Neves et al. (APPIA, Lisboa, 2007), pp. 512–523

    Google Scholar 

  3. P. Cortez, A. Cerdeira, F. Almeida, T. Matos, J. Reis, Modeling wine preferences by data mining from physicochemical properties. Decis. Support. Syst. 47(4), 547–553 (2009)

    Article  Google Scholar 

  4. D. Fagan, M. O’Neill, E. Galván-López, A. Brabazon, S. McGarraghy, An analysis of genotype-phenotype maps in grammatical evolution, in European Conference on Genetic Programming, EuroGP 2010, ed. by A.I. Esparcia-Alcázar et al. Lecture Notes in Computer Science, vol. 6021 (Springer, Berlin, 2010), pp. 62–73

    Google Scholar 

  5. D. Fagan, M. Nicolau, E. Hemberg, M. O’Neill, A. Brabazon, S. McGarraghy, Investigation of the performance of different mapping orders for GE on the max problem, in European Conference on Genetic Programming, EuroGP 2011, Torino, Italy, April 27–29, 2011, Proceedings, ed. by S. Silva et al. Lecture Notes in Computer Science, vol. 6621 (Springer, Berlin, 2011), pp. 286–297

    Google Scholar 

  6. S. Forstenlechner, M. Nicolau, D. Fagan, M. O’Neill, Grammar design for derivation tree based genetic programming systems, in European Conference on Genetic Programming, EuroGP 2016, ed. by M. Heywood et al. Lecture Notes in Computer Science, vol. 9594 (Springer, Cham, 2016), pp. 199–214

    Google Scholar 

  7. S. Forstenlechner, D. Fagan, M. Nicolau, M. O’Neill, A grammar design pattern for arbitrary program synthesis problems in genetic programming, in European Conference on Genetic Programming, EuroGP 2017, ed. by J. McDermott et al. Lecture Notes in Computer Science, vol. 10196 (Springer, Berlin, 2017), pp. 262–277

    Google Scholar 

  8. C. Gathercole, P. Ross, An adverse interaction between crossover and restricted tree depth in genetic programming, in Genetic Programming 1996: First Annual Conference, ed. by J.R. Koza et al. (MIT Press, Cambridge, 1996), pp. 291–296

    Google Scholar 

  9. R. Harper, GE, explosive grammars and the lasting legacy of bad initialisation, in IEEE Congress on Evolutionary Computation, CEC 2010, 2010, pp. 2602–2609

    Google Scholar 

  10. E. Hemberg, An exploration of grammars in grammatical evolution. Ph.D. Thesis, University College Dublin, University College Dublin, Ireland, 2010

    Google Scholar 

  11. E. Hemberg, N. McPhee, M. O’Neill, A. Brabazon, Pre-, in- and postfix grammars for symbolic regression in grammatical evolution, in IEEE Workshop and Summer School on Evolutionary Computing, 2008, 2008, pp. 18–22

    Google Scholar 

  12. M. Keijzer, Improving symbolic regression with interval arithmetic and linear scaling, in European Conference on Genetic Programming, EuroGP 2003, ed. by C. Ryan et al. Lecture Notes in Computer Science, vol. 2610 (Springer, Berlin, 2003), pp. 70–82

    Google Scholar 

  13. M. Keijzer, M. O’Neill, C. Ryan, M. Cattolico, Grammatical evolution rules: the mod and the bucket rule, in European Conference on Genetic Programming, EuroGP 2002, ed. by J.A. Foster et al. Lecture Notes in Computer Science, vol. 2278 (Springer, Berlin, 2002), pp. 123–130

    Google Scholar 

  14. M.F. Korns, Accuracy in symbolic regression, in Genetic Programming Theory and Practice IX, ed. by R. Riolo et al. Genetic and Evolutionary Computation (Springer, New York, 2011), pp. 129–151

    Chapter  Google Scholar 

  15. J.R. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection (MIT Press, Cambridge, 1992)

    MATH  Google Scholar 

  16. M. Lichman, UCI machine learning repository (2013), http://archive.ics.uci.edu/ml

  17. N. Lourenço, J. Ferrer, F.B. Pereira, E. Costa, A comparative study of different grammar-based genetic programming approaches, in European Conference on Genetic Programming, EuroGP 2017, ed. by J. McDermott et al. Lecture Notes in Computer Science, vol. 10196 (Springer, Cham, 2017), pp. 311–325

    Google Scholar 

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

    Article  Google Scholar 

  19. S. Luke, Two fast tree-creation algorithms for genetic programming. IEEE Trans. Evol. Comput. 4(3), 274–283 (2000)

    Article  Google Scholar 

  20. S. Luke, L. Panait, A comparison of bloat control methods for genetic programming. Evol. Comput. 14(3), 309–344 (2006)

    Article  Google Scholar 

  21. E. Medvet, A comparative analysis of dynamic locality and redundancy in grammatical evolution, in European Conference on Genetic Programming, EuroGP 2017, ed. by J. McDermott et al. Lecture Notes in Computer Science, vol. 10196 (Springer, Cham, 2017), pp. 326–342

    Google Scholar 

  22. M. Nicolau, Automatic grammar complexity reduction in grammatical evolution, in Genetic and Evolutionary Computation Conference, GECCO 2004, ed. by R. Poli et al. (2004)

    Google Scholar 

  23. M. Nicolau, Understanding grammatical evolution: initialisation. Genet. Program. Evolvable Mach. 18(4), 1–41 (2017)

    Article  Google Scholar 

  24. M. Nicolau, I. Dempsey, Introducing grammar based extensions for grammatical evolution, in IEEE Congress on Evolutionary Computation, CEC 2006 (2006), pp. 2663–2670

    Google Scholar 

  25. M. Nicolau, M. Fenton, Managing repetition in grammar-based genetic programming, in Genetic and Evolutionary Computation Conference - GECCO 2016, Denver, CO, USA, July 20–24, 2016, Proceedings, ed. by T. Friedrich (ACM, New York, 2016), pp. 765–772

    Google Scholar 

  26. M. Nicolau, M. O’Neill, A. Brabazon, Termination in grammatical evolution: grammar design, wrapping, and tails, in IEEE Congress on Evolutionary Computation, CEC 2012 (2012), pp. 1–8

    Google Scholar 

  27. M. Nicolau, A. Agapitos, M. O’Neill, A. Brabazon, Guidelines for defining benchmark problems in genetic programming, in IEEE Congress on Evolutionary Computation, CEC 2015 (2015)

    Google Scholar 

  28. M. O’Neill, A. Brabazon, mGGA: the meta-grammar genetic algorithm, in European Conference on Genetic Programming, EuroGP 2005, ed. by M. Keijzer et al. Lecture Notes in Computer Science, vol. 3447 (Springer, Berlin, 2005), pp. 311–320

    Google Scholar 

  29. M. O’Neill, C. Ryan, Evolving multi-line compilable c programs, in European Workshop on Genetic Programming, EuroGP 99, ed. by R. Poli et al. Lecture Notes in Computer Science, vol. 1598 (Springer, Berlin, 1999), pp. 83–92

    Google Scholar 

  30. M. O’Neill, C. Ryan, Grammatical Evolution - Evolutionary Automatic Programming in an Arbitrary Language. Genetic Programming, vol. 4 (Kluwer Academic, Dordrecht, 2003)

    Google Scholar 

  31. M. O’Neill, C. Ryan, M. Nicolau, Grammar defined introns: an investigation into grammars, introns, and bias in grammatical evolution, in Genetic and Evolutionary Computation Conference, GECCO 2001, ed. by L. Spector et al. (Morgan Kaufmann, Burlington, 2001), pp. 97–103

    Google Scholar 

  32. M. O’Neill, C. Ryan, M. Keijzer, M. Cattolico, Crossover in grammatical evolution. Genet. Program. Evolvable Mach. 4(1), 67–93 (2003)

    Article  Google Scholar 

  33. M. O’Neill, J.M. Swafford, J. McDermott, J. Byrne, A. Brabazon, E. Shotton, C. McNally, M. Hemberg, Shape grammars and grammatical evolution for evolutionary design, ed. by G. Raidl et al. Genetic and Evolutionary Computation Conference, GECCO 2009 (ACM, New York, 2009), pp. 1035–1042

    Google Scholar 

  34. L. Pagie, P. Hogeweg, Evolutionary consequences of coevolving targets. Evol. Comput. 5(4), 401–418 (1997)

    Article  Google Scholar 

  35. D. Robilliard, S. Mahler, D. Verhaghe, C. Fonlupt, Santa fe trail hazards, in International Conference on Evolution Artificielle, EA 2005, ed. by E.-G. Talbi et al. Lecture Notes in Computer Science, vol. 3871 (Springer, Berlin, 2005), pp. 1–12

    Google Scholar 

  36. F. Rothlauf, M. Oetzel, On the locality of grammatical evolution, in European Conference on Genetic Programming, EuroGP 2006, ed. by P. Collet et al. Lecture Notes in Computer Science, vol. 3905 (Springer, Berlin, 2006), pp. 320–330

    Google Scholar 

  37. C. Ryan, A. Azad, Sensible initialisation in grammatical evolution, in Genetic and Evolutionary Computation Conference, GECCO 2003, ed. by E. Cantú-Paz et al. (AAAI, Menlo Park, 2003)

    Google Scholar 

  38. C. Ryan, J. Collins, M. O’Neill, Grammatical evolution: evolving programs for an arbitrary language, in European Workshop on Genetic Programming, EuroGP 1998, ed. by W. Banzhaf et al. Lecture Notes in Computer Science, vol. 1391 (Springer, Berlin, 1998), pp. 83–95

    Google Scholar 

  39. C. Ryan, M. Keijzer, M. Nicolau, On the avoidance of fruitless wraps in grammatical evolution, in Genetic and Evolutionary Computation Conference, GECCO 2003, ed. by E. Cantú-Paz et al. Lecture Notes in Computer Science, vol. 2724 (Springer, Berlin, 2003), pp. 1752–1763

    Google Scholar 

  40. J. Tavares, F. B. Pereira, Automatic design of ant algorithms with grammatical evolution, in European Conference on Genetic Programming, EuroGP 2012, ed. by A. Moraglio et al. Lecture Notes in Computer Science, vol. 7244 (Springer, Berlin, 2012), pp. 206–217

    Google Scholar 

  41. E.J. Vladislavleva, G.F. Smits, D. den Hertog, Order of nonlinearity as a complexity measure for models generated by symbolic regression via pareto genetic programming. IEEE Trans. Evol. Comput. 13(2), 333–349 (2009)

    Article  Google Scholar 

  42. P.A. Whigham, G. Dick, J. Maclaurin, C.A. Owen, Examining the “best of both worlds” of grammatical evolution, in Genetic and Evolutionary Computation Conference, GECCO 2015, ed. by S. Silva (ACM, New York, 2015) pp. 1111–1118

    Chapter  Google Scholar 

  43. D.R. White, J. McDermott, M. Castelli, L. Manzoni, B.W. Goldman, G. Kronberger, W. Jaśkowski, U.-M. O’Reilly, S. Luke, Better GP benchmarks: community survey results and proposals. Genet. Program. Evolvable Mach. 14(1), 3–29 (2013)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Miguel Nicolau .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Nicolau, M., Agapitos, A. (2018). Understanding Grammatical Evolution: Grammar Design. In: Ryan, C., O'Neill, M., Collins, J. (eds) Handbook of Grammatical Evolution. Springer, Cham. https://doi.org/10.1007/978-3-319-78717-6_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-78717-6_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-78716-9

  • Online ISBN: 978-3-319-78717-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics