Using Genetic Algorithms to find a path


(click on the image to java web start the application)


How does it work?

Each path or potential solution is coded as list of vectors. Each vector has a length and a direction. I have used binary encoding for each vector.
The direction (N, NW, W, SW, S, SE, E, NE) uses 3 bits, and the length 6 bits.
A path has 25 vectors, and the constraints are to reach the target, while avoiding obstacles - if any - as well as minimizing the total length.
The cross-over rate is 60%, the mutation rate is 30%. Elitism is used.

You can right/left click to move the start position as well as the end position. Enjoy.