OR-Tools solve traveling salesman (TSP) without returning to the home node
问题 I'm using Google Or-Tools to solve a Traveling Salesman Problem by using this example (basically I just replaced the distances matrix with mine). As in the example, I set data['depot'] = 0 . For my application it is not important to return to the first node at the end of the path. I can remove the last edge from the solution but I wonder that if I could remove this constraint altogether it might find a better path overall. 回答1: Make sure the distance from all nodes to 0 (the depot) is null.