tsp python code