This page is located in archive.

Genetic programming

The goal of this lab exercise is to get some experience with using genetic programming on various test problems. You are going to use the genetic programming tool implemented in HeuristicLab. You will use it to solve the following problems:

  • artificial ant problem, the Santa Fe trail
  • symbolic regression
  • classification


HeuristicLab is a framework for heuristic and evolutionary algorithms developed by members of the Heuristic and Evolutionary Algorithms Laboratory since 2002. There are many machine learning and (meta)heuristic algorithms, not only the evolutionary ones, plus many problems already implemented in the HeuristicLab. Moreover, HeuristicLab comes with a user friendly graphical interface that serves to set the algorithm's parameters and provides the user with various visualizations.


If using Windows, just download the binaries from download and then run HeuristicLab 3.3.exe.

Please note that HeuristicLab also runs on Linux with Mono but with a limited support available. Check out the HeuristicLab and Mono Howto for more information.

Running test problems

Execute the HeuristicLab 3.3.exe and then:

  • run HL Optimizer
  • choose one of the following test problems in the window Samples on the tab Start Page
    • Genetic Programming - Artificial Ant
    • Genetic Programming - Symbolic regression
    • Genetic Programming - Symbolic Classification


Changing GP parameters

GP parameters can be set on tabs Problem and Algorithm.

Function set:

  • Artificial Ant - ProblemEncoding SymbolicExpressionTreeSymbolicExpressionTree.Grammar: Simple Grammar
  • Symbolic regression, Symbolic Classification → ProblemSymbolicExpressionTreeGrammar: TypeCoherentExpressionGrammar


  • ProblemEvaluatorDetailsValue

Use your own csv input file for Symbolic Regression:

  • Note: Correct Separator and Decimal Separator must be chosen


All results, the running as well as the final ones, are under the tab Results.

Besides other statistics there is always the Best Solution or the Best training solution, that you can explore in detail.

What you should try

  • different function sets
  • different training data, e.g. SR_data
  • different parameter values
    • population size,
    • maximum depth of the generated expressions,
    • crossover and mutation rates,
    • selection

And of course, feel free to play with other algorithms and other problems as well!

courses/a0m33eoa/labs/week_08.txt · Last modified: 2021/11/15 14:05 by xposik