Tsp_large_graph function and tsp_medium_graph function unable to pass grader

All my test cases have passed, but despite multiple attempts, I keep receiving the same message during grading.

I have also verified my code for optimization.

The snapshot I am sharing is from my second attempt to optimize the code for the 3rd (tsp_large_graph function) and 4th exercises (tsp_medium_graph function) of “Programming Assignment: Implementing algorithms in Graphs”.

I am not sure where I am going wrong. Could you suggest an approach to resolve this optimization issue?

The graders’ tests are not as shallow as the run-time tests. Therefore, as you can see from the error, your solutions are not as required.

Try to ask the LLM to give you another solution that is more efficient, also feed the exercises’ entire requirement, the function, and class definitions as well in the prompt!

It basically means the solution the LLM gave to you is not the most efficient or is not efficient enough. Converse with it to change it to a better one, feeding it some feedback that the current one is not efficient….

1 Like