I have implemented the assignment as required, and when I execute it locally in my own IDE, all works correctly, and I get the correct results including the expected distance values of 799, 893, 978, 776 and 1394.
However, when I execute the “unittests.test_tsp_small_graph(GraphTSPSmallGraph)” I get the following:
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(graph = GraphTSPSmallGraph, nodes = 10, complete = True, seed = 42).
Expected: 799
Got: 1255
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(graph = GraphTSPSmallGraph, nodes = 10, complete = True, seed = 43).
Expected: 893
Got: 1255
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(graph = GraphTSPSmallGraph, nodes = 10, complete = True, seed = 44).
Expected: 978
Got: 1255
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(graph = GraphTSPSmallGraph, nodes = 10, complete = True, seed = 45).
Expected: 776
Got: 1255
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(graph = GraphTSPSmallGraph, nodes = 10, complete = True, seed = 46).
Expected: 1394
Got: 1255
I have restarted the kernel multiple times to no effect.
I have also noticed that when I try to just run the code, without for instance the example usage in Section 3.2, I get an error saying graph is not defined, which to me seems to be a bad smell.
Is there a problem in the notebook or am I doing something wrong?
Something else I also n