Skip to main content
Log in

Recursion in tree-based genetic programming

  • Published:
Genetic Programming and Evolvable Machines Aims and scope Submit manuscript

Abstract

Recursion is a powerful concept that enables a solution to a problem to be expressed as a relatively simple decomposition of the original problem into sub-problems of the same type. We survey previous research about the evolution of recursive programs in tree-based Genetic Programming. We then present an analysis of the fitness landscape of recursive programs, and report results on evolving solutions to a range of problems. We conclude with guidelines concerning the choice of fitness function and variation operators, as well as the handling of the halting problem. The main findings are as follows. The distribution of fitness changes initially as we look at programs of increasing size but once some threshold has been exceeded, it shows very little variation with size. Furthermore, the proportion of halting programs decreases as size increases. Recursive programs exhibit the property of weak causality; small changes in program structure may cause big changes in semantics. Nevertheless, the evolution of recursive programs is not a needle-in-a-haystack problem; the neighbourhoods of optimal programs are populated by halting individuals of intermediate fitness. Finally, mutation-based variation operators performed the best in finding recursive solutions. Evolution was also shown to outperform random search.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

References

  1. A. Agapitos, S.M. Lucas, Evolving efficient recursive sorting algorithms. in Proceedings of the 2006 IEEE Congress on Evolutionary Computation (IEEE Press, Vancouver, 2006), pp. 9227–9234

  2. A. Agapitos, S.M. Lucas, Learning recursive functions with object oriented genetic programming, in Proceedings of the 9th European Conference on Genetic Programming, Lecture Notes in Computer Science, vol. 3905 (Springer, Budapest, 2006), pp. 166–177

  3. A. Agapitos, S.M. Lucas, Evolving a statistics class using object oriented evolutionary programming. in Proceedings of the 10th European Conference on Genetic Programming. Lecture Notes in Computer Science, vol. 4445, ed. by M. Ebner, M. O’Neill, A. Ekárt, L. Vanneschi, A.I. Esparcia-Alcázar (Springer, Valencia, 2007), pp. 291–300

  4. A. Agapitos, S.M. Lucas, Evolving modular recursive sorting algorithms. in Proceedings of the 10th European Conference on Genetic Programming. Lecture Notes in Computer Science, vol. 4445, ed. by M. Ebner, M. O’Neill, A. Ekárt, L. Vanneschi, A.I. Esparcia-Alcázar (Springer, Valencia, 2007), pp. 301–310

  5. A. Agapitos, J. McDermott, M. O’Neill, A. Kattan, A. Brabazon, Higher order functions for kernel regression, in 17th European Conference on Genetic Programming. LNCS, vol. 8599, ed. by M. Nicolau, K. Krawiec, M.I. Heywood, M. Castelli, P. Garcia-Sanchez, J.J. Merelo, V.M. Rivas Santos, K. Sim (Springer, Granada, 2014), pp. 1–12

  6. B. Alexander, B. Zacher, Boosting search for recursive functions using partial call-trees, in 13th International Conference on Parallel Problem Solving from Nature. Lecture Notes in Computer Science, vol. 8672, ed. by T. Bartz-Beielstein, J. Brank, J. Smith (Springer, Ljubljana, 2014), pp. 384–393

  7. P.J. Angeline, Adaptive and self-adaptive evolutionary computations, in Computational Intelligence: A Dynamic Systems Perspective, ed. by M. Palaniswami, Y. Attikiouzel (IEEE Press, 1995), pp. 152–163

  8. S. Brave, Evolving recursive programs for tree search, in Advances in Genetic Programming 2, ed. by P.J. Angeline, K.E. Kinnear, Jr (MIT Press, 1996)

  9. E.K. Burke, S. Gustafson, G. Kendall, Diversity in genetic programming: an analysis of measures and correlation with fitness. IEEE Trans. Evolut. Comput. 8(1), 47–62 (2004)

    Article  Google Scholar 

  10. T. Castle, C.G. Johnson, Evolving high-level imperative program trees with strongly formed genetic programming, in Proceedings of the 15th European Conference on Genetic Programming. LNCS, EuroGP 2012, vol. 7244, ed. by A. Moraglio, S. Silva, K. Krawiec, P. Machado, C. Cotta (Springer, Malaga, 2012), pp. 1–12

  11. T. Castle, C.G. Johnson, Evolving program trees with limited scope variable declarations, in Proceedings of the 2012 IEEE Congress on Evolutionary Computation, ed. by X. Li (IEEE Computational Intelligence Society, IEEE Press, Brisbane, 2012), pp. 2250–2257

  12. K. Chellapilla, Evolving computer programs without subtree crossover. IEEE Trans. Evolut. Comput. 1(3), 209–216 (1997)

    Article  Google Scholar 

  13. C. Clack, T. Yu, Performance enhanced genetic programming, in Proceedings of the Sixth Conference on Evolutionary Programming (1997)

  14. A. Ekart, S.Z. Nemeth, A metric for genetic programs and fitness sharing. in Genetic Programming, Proceedings of EuroGP’2000. LNCS, vol. 1802, ed. by R. Poli, W. Banzhaf, W.B. Langdon, J.F. Miller, P. Nordin, T.C. Fogarty (Springer, Edinburgh, 2000), pp. 259–270

  15. L. Huelsbergen, Learning recursive sequences via evolution of machine-language programs, in Genetic Programming 1997: Proceedings of the Second Annual Conference

  16. S. Kelly, P. Lichodzijewski, M.I. Heywood, On run time libraries and hierarchical symbiosis, in Proceedings of the 2012 IEEE Congress on Evolutionary Computation, ed. by X. Li (Brisbane, 2012), pp. 3278–3285

  17. E. Kirshenbaum, Iteration over vectors in genetic programming. Technical Report HPL-2001-327, HP Laboratories (2001)

  18. M.J. Kochenderfer, Evolving hierarchical and recursive teleo-reactive programs through genetic programming. in Genetic Programming, Proceedings of EuroGP’2003 (2003)

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

    MATH  Google Scholar 

  20. J. Koza, Genetic Programming II: Automatic Discovery of Reusable Programs (MIT Press, Cambridge, 1994)

    MATH  Google Scholar 

  21. J.R. Koza, D. Andre, F.H. Bennett III, M. Keane, Genetic Programming 3: Darwinian Invention and Problem Solving (Morgan Kaufman, Burlington, 1999)

    MATH  Google Scholar 

  22. W.B. Langdon, Size fair and homologous tree genetic programming crossovers. Genet. Program. Evolvable Mach. 1(1/2), 95–119 (2000)

    Article  MATH  Google Scholar 

  23. W.B. Langdon, Scaling of program functionality. Genet. Program. Evolvable Mach. 10(1), 5–36 (2009)

    Article  Google Scholar 

  24. W.B. Langdon, R. Poli, Foundations of Genetic Programming (Springer, Berlin, 2002)

    Book  MATH  Google Scholar 

  25. W.B. Langdon, R. Poli, The halting probability in von Neumann architectures, in Proceedings of the 9th European Conference on Genetic Programming. Lecture Notes in Computer Science, vol. 3905, ed. by P. Collet, M. Tomassini, M. Ebner, S. Gustafson, A. Ekárt (Springer, Budapest, 2006), pp. 225–237

  26. S.R. Maxwell, Experiments with a coroutine execution model for genetic programming, in IEEE Conference on Evolutionary Computation (IEEE, 1994), pp. 413–417

  27. J. McDermott, J. Byrne, J.M. Swafford, M. O’Neill, A. Brabazon, Higher-order functions in aesthetic EC encodings, in 2010 IEEE World Congress on Computational Intelligence (IEEE Computation Intelligence Society, IEEE Press, Barcelona, 2010), pp. 2816–2823

  28. A. Moraglio, F. Otero, C. Johnson, S. Thompson, A. Freitas, Evolving recursive programs using non-recursive scaffolding, in Proceedings of the 2012 IEEE Congress on Evolutionary Computation, ed. by X. Li (2012), pp. 2242–2249

  29. M. Nishiguchi, Y. Fujimoto, Evolutions of recursive programs with multi-niche genetic programming (mnGP), in Proceedings of the 1998 IEEE World Congress on Computational Intelligence (IEEE Press, Anchorage, 1998), pp. 247–252

  30. P. Nordin, W. Banzhaf, Evolving turing-complete programs for a register machine with self-modifying code, in Genetic Algorithms: Proceedings of the Sixth International Conference (ICGA95), ed. by L. Eshelman (Morgan Kaufmann, Pittsburgh, 1995), pp. 318–325

  31. R. Poli, W.B. Langdon, On the search properties of different crossover operators in genetic programming, in Genetic Programming 1998: Proceedings of the Third Annual Conference, ed. by J.R. Koza, W. Banzhaf, K. Chellapilla, K. Deb, M. Dorigo, D.B. Fogel, M.H. Garzon, D.E. Goldberg, H. Iba, R. Riolo (Morgan Kaufmann, University of Wisconsin, Madison, 1998), pp. 293–301

  32. R. Poli, W.B. Langdon, N.F. McPhee, A field guide to genetic programming. http://lulu.comhttp://www.gp-field-guide.org.uk (2008)

  33. J.P. Rosca, Entropy-driven adaptive representation, in Proceedings of the Workshop on Genetic Programming: From Theory to Real-World Applications, ed. by J.P. Rosca (Tahoe City, 1995), pp. 23–32

  34. J. Rosca, D.H. Ballard, Causality in genetic programming, in Genetic Algorithms: Proceedings of the Sixth International Conference (ICGA95), ed. by L. Eshelman (Morgan Kaufmann, Pittsburgh, 1995), pp. 256–263

  35. S. Shirakawa, T. Nagao, Graph structured program evolution: evolution of loop structures, in Genetic Programming Theory and Practice VII. Genetic and Evolutionary Computation, ed. by R.L. Riolo, U.M. O’Reilly, T. McConaghy (Springer, Ann Arbor, 2009), pp. 177–194. (chapter 11)

    Google Scholar 

  36. L. Spector, J. Klein, M. Keijzer, The push3 execution stack and the evolution of control, in GECCO ’05: Proceedings of the 2005 conference on Genetic and evolutionary computation (2005), pp. 1689–1696

  37. A. Teller, Genetic programming, indexed memory, the halting problem, and other curiosities, in Proceedings of the 7th Annual Florida Artificial Intelligence Research Symposium (IEEE Press, Pensacola, 1994), pp. 270–274

  38. A. Teller, M. Veloso, Efficient learning through evolution: neural programming and internal reinforcement, in Proceedings of the Seventeenth International Conference on Machine Learning (2000)

  39. A. Turner, J. Miller, Recurrent cartesian genetic programming, in 13th International Conference on Parallel Problem Solving from Nature. Lecture Notes in Computer Science, vol. 8672, ed. by T. Bartz-Beielstein, J. Branke, B. Filipic, J. Smith (Springer, Ljubljana, 2014), pp. 476–486

  40. P.A. Whigham, R.I. McKay, Genetic approaches to learning recursive relations, in Progress in Evolutionary Computation. Lecture Notes in Artificial Intelligence, vol. 956, ed. by X. Yao (Springer, 1995), pp. 17–27

  41. G. Wilson, M. Heywood, Learning recursive programs with cooperative coevolution of genetic code mapping and genotype, in GECCO ’07: Proceedings of the 9th Annual Conference on Genetic and Evolutionary Computation, vol. 1, ed. by D. Thierens, H.G. Beyer, J. Bongard, J. Branke, J.A. Clark, D. Cliff, C.B. Congdon, K. Deb, B. Doerr, T. Kovacs, S. Kumar, J.F. Miller, J. Moore, F. Neumann, M. Pelikan, R. Poli, K. Sastry, K.O. Stanley, T. Stutzle, R.A. Watson, I. Wegener (London, 2007), pp. 1053–1061

  42. M.L. Wong, Evolving recursive programs by using adaptive grammar based genetic programming. Genet. Program. Evolvable Mach. 6(4), 421–455 (2005)

    Article  Google Scholar 

  43. M.L. Wong, K.S. Leung, Evolving recursive functions for the even-n-parity problem using genetic programming, in Advances in Genetic Programming 2, ed. by P.J. Angeline, K.E. Kinnear, Jr (MIT Press, 1996)

  44. M.L. Wong, K.S. Leung, Learning recursive functions from noisy examples using generic genetic programming, in Genetic Programming 1996: Proceedings of the First Annual Conference, ed. by J.R. Koza, D.E. Goldberg, D.B. Fogel, R.L. Riolo (MIT Press, Stanford University, Stanford, 1996), pp. 238–246

  45. T. Yu, Hierachical processing for evolving recursive and modular programs using higher order functions and lambda abstractions. Genet. Program. Evolvable Mach. 2(4), 345–380 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  46. T. Yu, A higher-order function approach to evolve recursive programs, in Genetic Programming Theory and Practice III. Genetic Programming, vol. 9, ed. by T. Yu, R.L. Riolo, B. Worzel (Springer, Ann Arbor, 2005), pp. 93–108. (chapter 7)

    Chapter  Google Scholar 

  47. T. Yu, C. Clack, Recursion, lambda abstractions and genetic programming, in Genetic Programming 1998: Proceedings of the Third Annual Conference, ed. by J.R. Koza, W. Banzhaf, K. Chellapilla, K. Deb, M. Dorigo, D.B. Fogel, M.H. Garzon, D.E. Goldberg, H. Iba, R. Riolo (Morgan Kaufmann, University of Wisconsin, Madison), pp. 422–431

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alexandros Agapitos.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Agapitos, A., O’Neill, M., Kattan, A. et al. Recursion in tree-based genetic programming. Genet Program Evolvable Mach 18, 149–183 (2017). https://doi.org/10.1007/s10710-016-9277-5

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10710-016-9277-5

Keywords

Navigation