Evolutionary Algorithms - Falmouth-Games-Academy/comp250-wiki GitHub Wiki
The weak must find death,
On the path of completeness,
Only the strong walk
Evolutionary Algorithms (EA) are a heuristic-based approach to solving problems and is usually used with other methods. It is also randomized global optimization algorithms [2]. In such a case, EA is used to find an optimal place to start with for another algorithm to work off of. An EA has four steps in general: initialization, selection, generic operators, and termination [1]. In an EA, more suitable members of an algorithm "will surive and proliferate", whilst others "will die off and not contribute to the gene pool or further generations" [1]. Schemes [1][4] and a rough pseudocode [3] of evolutionary algorithm is shown below
Basically, to start this algorithm, we have to first create some population of solutions. It will contain a random number of solutions to a problem, often called members. It is important for the members to surround a wide range of solutions [1]. To explore a wide range of possibilities, one should aim to have a decent amount of genes present [1].
Next step after initialization should be evaluation of members according to a fitness function. " A fitness function is a function that takes in the characteristics of a member, and outputs a numerical representation of how viable of a solution it is" [1]. Basically, it calculates which child is most suitable to become parent [4], and deletes most unfitting ones. This part can be quite troublesome in terms of implementation, because it is very problem-specific. Moreover, it has to me a function that has to give more or less accurate data.
Unfortunately, fitness function has some limitations that could be problematic. The response to that is the family of algorithms called multiobjective evolutionary algorithms. However, this complicates the process due to identifying mupltiple solutions. It considers at least two objective functions and searches for a Pareto front of these objectives [2], which contains elements evenly optimal [1].
Genetic operators include two sub-steps: crossover and mutation. This process selects top members that were evaluated during previous one and had the best score. It is usually two members, but can vary from the algorithm itself. Now these members become parents that will produce children with the mixture of its parents' qualities [1]. Often enough, it can be difficult due to data type. However, it is still possible to mix combinations and output effective combinations.
Now, we have to introduce new genetic material into the generation [1]. It's a crucial step to obtain optimala results and not get "stuck in local extrema" [1]. This is mutation step and it changes a small portion of children so that they don't "perfectly mirror subsets of the parents' genes" [1]. Mutation usually occurs probabilistically, "in that the chance of a child receiving a mutation as well as the severity of the mutation are governed by a probability distribution" [1].
This is an end-goal process. It is executed in two cases: when the algorithm has reached its maximum runtime, or its condition was met. In this case, a final solution is executed.
To conclude everything, I'll show an example of an evolutionary algorithm. Basically, it's been iterating hundrends of times to eventually produce an optimal behaviour of a dinosaur-shaped object to make it walk. It's been optimizing its body structure and applying muscular forces. As seen in the gif, most left generation (first generation) wasn't able to walk, but it evolved over time through mutation and crossover to eventually able to walk. That is why it is called evolutionary algorithms. It can be seen in many different examples showing the progression of an AI.

To get some grip of genetic programming, one could use a freely downloadable introduction to it here.
[1] Devin Soni, "Introduction to Evolutionary Algorithms", Feb 18, 2018. Available: https://towardsdatascience.com/introduction-to-evolutionary-algorithms-a8594b484ac [Accessed: 12-Feb-2019]
[2] G. N. Yannakakis and J. Togelius, "Artificial Intelligence and Games". Springer, 2018.
[3] Felix Streichert, "Introduction to Evolutionary Algorithms", University of Tuebingen, year unknown. Available: http://www.ra.cs.uni-tuebingen.de/mitarb/streiche/publications/Introduction_to_Evolutionary_Algorithms.pdf [Accessed: 15-Feb-2019]
[4] Author unknown, "AI 101: Intro to Evolutionary Algorithms", Feb 28, 2018. Available: https://www.sentient.ai/blog/ai-101-intro-evolutionary-algorithms/ [Accessed: 12-Feb-2019]