I am trying to use the DEAP package to solve the TSP where the matrix represents the distances between the vertices, taking into account that some of the vertices are not connected. How can I make DEAP work well? I have tried with a penalty variable and it has failed.
Example ofthe matrix The light blue color indicates that they are not connected (they are empty), pink means they are connected (they have a value), and the diagonal has zeros.
The result of the algorithm should return only the distances without considering the paths that are not connected.