When I did the unit testing for TSP_large_graph test, I got the following error.

Failed test case: Failed to find the optimal solution for a path starting in node 0. To replicate the graph, you may run generate_graph(nodes = 1000, complete = True, seed = 43).

Expected: 4774

Got: 292549

I am using Genetic algorithm to solve TPS, my problem is not about algorithm or speed, it is that my shortest distance is much larger than expected (4774).

I am suspecting this expected value. I think the unit-test is using the generate_graph function, where the edge weight limit is 1 to 600. If the salesman travels 1000 nodes and back to original node, there must at least be 1001 edges, each edge weight is between 1 to 600, letâ€™s take the mean value as 300, so the total distance would be around 1001*300 = 300300. How come can the expected value be 4774?

def generate_graph(nodes, edges=None, complete=False, weight_bounds=(1,600), seed=None):