Why is the time constraint for large graphs shorter than for medium graphs?

These are both heuristic solutions, so it doesn’t make sense why the large graph needs to be solved in under 0.5s while the medium graph time limit is 1.3s. Did the grader get these mixed up?

1 Like

The implementation of the large graph should be more efficient for the same input, because it has to deal with severe cases (much larger number of vertices)!

I am not following. If my implementation passes the 0.5s requirement for the large 1000 node complete graph, then why will it not automatically meet the 1.3 second requirement for the 300 node medium graph?

IOW why do I need a separate solution for tsp_medium_graph? What new requirement is there that makes this a different problem from the tsp_large_graph requirement?

Is there a typo in that tsp_large_graph will be for complete graphs but tsp_medium_graph needs to work for incomplete graphs?

The other question is:
In the doc_string for tsp_medium_graph, the text says “under 1 second”
BUT
In 3 - Exercises section: the requirement for Exercise 4 is “less than 1.3 seconds”

Which one is the correct requirement?

Please advise.

Thank you.

cc: @lucas.coutinho @gent.spah

Technically speaking the large implementation should cover the small and the medium graph. But I think what they want to achieve here is see different implementation of the solution when different graph sizes are dealt with and there are quite a few. I did the assignment a couple of days ago and it seems the LLM suggests different solutions when prompted for different size of graphs although sometimes it mixes them up as well.

The main thing to remember is that you dont want the same solution for all cases.

About this its a bit messy I saw that too, maybe @lucas.coutinho can help here!

1 Like