https://github.com/rcdmk/genetic-maze
Simplified genetic algorithm to find solutions for a maze, based on Darwin's natural selection theory.
https://github.com/rcdmk/genetic-maze
genetic-algorithm maze-solver p5js
Last synced: about 2 months ago
JSON representation
Simplified genetic algorithm to find solutions for a maze, based on Darwin's natural selection theory.
- Host: GitHub
- URL: https://github.com/rcdmk/genetic-maze
- Owner: rcdmk
- Created: 2020-05-16T14:46:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-16T23:41:11.000Z (about 6 years ago)
- Last Synced: 2025-03-11T08:36:04.151Z (about 1 year ago)
- Topics: genetic-algorithm, maze-solver, p5js
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Genetic Algorithm for Solving Mazes
This is a simplified implementation of a genetic algorithm to find solutions for a maze, based on Darwin's natural selection theory.
## Algorithm
A random population is generated and processed, then its fitness is computed as how close they get to the goal. The fittest survive, producing a new generation that inherits part of their genes.
A mutation factor is also introduced to add some variation to the generation and it is essential for evolution to properly adjust it. If no mutation or a too low mutation factor is set, the population evolves only in a certain way, based on its ancestors, and can get stuck in certain paths, not being able to reach the goal. If a too high mutation factor is set the variation will be so high that the convergence of the population will be severely reduced, leading to very few individuals to reaching the goal.