Issue while trying to solve TSP in week-3 graded section

I’m running into this issue while trying to solve a small TSP. It throws this error when trying to run the tests provided. Any idea why?

Process tsp_small_graph:
Traceback (most recent call last):
File “/opt/conda/lib/python3.11/multiprocessing/process.py”, line 314, in _bootstrap
self.run()
File “/opt/conda/lib/python3.11/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/home/jovyan/work/unittests.py”, line 91, in helper
out = func(start)
^^^^^^^^^^^
File “/tmp/ipykernel_90/3441927076.py”, line 108, in tsp_small_graph
C[bits, k] = min(res)[0]
^^^^^^^^
ValueError: min() arg is an empty sequence

Hi @tejkonganda,

It could be that your execution environment is not up-to-date. Especially if your kernel has been idle for a while. Try rerunning you the code cell from start. To do a clear run, from the menu bar at the top or your notebook, click:
Kernel → restart and clear all output
Cell → run all above ( from your current cell)

Let’s know if you are still having problem.

Are you consulting the LLM regarding the generation of code for this exercise? Or are you just solving it yourself?

Hey. I used the LLM. I was able to resolve it and move on and complete the assignment using the LLM. Thanks.

1 Like