An odd error for the graph-based assignment tsp_medium_graph

I’m getting this error:

For the graph starting at node 0, the target path distance to beat is 3855. Your algorithm returned a distance of 3798, greater than 76%

This seems to suggest that the implementation is doing better than the target, but this is flagged as an error.

1 Like

I suppose this is an algorithm that finds the minimum distance from a node to another node (can you point exactly which Lab is this) like Djikstras algorithm.

If that is so, your distance is bigger, so its doing worse than the minimum expectation of 3855!

I too got this error.

1 Like

https:// www.coursera. org / learn /introduction-to-generative-ai-for-software-development/programming/AtWBs/implementing-algorithms-in-graphs/lab

1 Like

Yes because you are supposed to find the shortest path! That means your solutions are not right!

Hello,

Thank you for bringing this issue to our attention. You were correct; there was an error in the calculation. We apologize for any inconvenience this may have caused. The corrected version of the autograder has been updated and is now available. Please try resubmitting your solution. If you encounter any further issues, please let me know.

1 Like

@gent.spah FYI above

2 Likes

Thank you! All works now.

1 Like

Seem to still get the same error?

Expected: Solution no greater than 76% of Nearest Neighbor.
Got: For the graph starting at node 0, the target path distance to beat is 3855. Your algorithm returned a distance of 3855, greater than 76%.

1 Like

Nevermind. Had to refresh the lab.

2 Likes

Havent done this course yet, I will have to go through it one of these days!

1 Like

I have been running the tsp_medium_graph function with a few updates and getting the below error:
Failed test case: Exceeded time execution limit for a tour starting in node 0. To replicate the graph, you may run generate_graph(nodes = 300, complete = True, seed = 42).
Expected: tsp_medium_graph method must run in less than 1.3 seconds
Got: Time execution exceeded 1.3 seconds
The latest approach uses a Modified Nearest Neighbor Heuristic with Greedy Improvements.
Any recommendation on how to deal with that?

1 Like

hello

i try more than 10 time I only receive 0 of 100 Grade ( I feel there is issue in submitting assignments

pls support me

1 Like

Please post a screen capture image that shows the detailed feedback from the grader.

1 Like

Now click on the > next to each part of the assignment, and read the grader’s detailed report.

Post a screen capture image of each set of details.

amples of failed tests will be provided.
Expected:
At least 85% of success shortest_path running below 0.7s and achieving the correct distance,
but got:
Success rate: 0%.

Failed test case: shortest_path returned an exception in test case. You may replicate the graph by running generate_graph(nodes = 10000, edges = 10, seed = 65).
Expected:
shortest_path must run without exceptions,
but got:
Exception thrown is: name ‘dist’ is not defined.

Failed test case: shortest_path returned an exception in test case. You may replicate the graph by running generate_graph(nodes = 10000, edges = 10, seed = 66).
Expected:
shortest_path must run without exceptions,
but got:
Exception thrown is: name ‘dist’ is not defined.

Failed test case: shortest_path returned an exception in test case. You may replicate the graph by running generate_graph(nodes = 10000, edges = 10, seed = 67).
Expected:
shortest_path must run without exceptions,
but got:
Exception thrown is: name ‘dist’ is not defined.

1 Like

“dist is not defined” probably means that inside some function, you are using a global variable “dist” which the grader does not provide.

That should be the easier issue to fix, so focus on that first.

i try but it same

Have you looked at your code to see if you’re using a variable named ‘dist’?