The genetic algorithm solution we created for VRP resides in the Python program 04-solve-vrp.py, located at the following link:
Since we were able to build on top of TSP and used a similar representation for the solution—an array of indices—we could use the same genetic approach as we used in the previous section. We could also take advantage of elitism by reusing the elitist version that we created for the genetic flow. This makes our genetic algorithm solution very similar to the one used for TSP.
The following steps detail the main parts of our solution:
- The program starts by creating an instance ...