I'm training a neural network to solve a maze.
My process is the following:
- Randomly generate a small maze
- Spawn hundreds of cars at the start, that will go through the same one maze
- Assign the same base neural network to each car, this would be the best from previous generation
- Do the mutations: for each neural network of those cars, slightly and randomly modify all the weights
- Run the simulation and wait 60 seconds
- Run the algorithm to determine the best generation
Right now, to determine the best generation, I'm using the car that has the shortest path to the end.
But my neural network isn't learning, that is, no car ever reaches the end for all randomly generated maze.
I believe that I would need to include some measurement of the dead-end and/or backtracking, but don't know exactly what to do.
What would be the best / correct criteria for determining the best generation?