AI / GENETIC ALGORITHMS

New Lands

An experiment involving snakes, neural networks, perceptrons and genetic algorithms. The project explores how a population can improve over time through selection, crossover and mutation.

THE PROCESS

How it learns.

A genetic algorithm is a search method inspired by natural selection. It is useful for complex problems where the possible solutions are too numerous to test one by one.

01

Initialization

Begin with a randomly generated population of possible solutions, with each individual represented as a chromosome.

02

Selection

Measure the fitness of each individual. Better solutions are more likely to be selected to reproduce.

03

Crossover

Combine parts of two selected parents to produce new offspring and carry useful traits into the next generation.

04

Mutation

Apply small random changes to introduce diversity and reduce the chance of settling too early on a weak solution.

05

Replacement

Replace some or all of the old population with the new offspring to create the next generation.

06

Iteration

Repeat the cycle until a solution reaches the target fitness or the algorithm completes its maximum number of generations.

THE RESULT

The strongest solution survives.

The best-performing solution found across all generations is returned as the final result.