# Problem of m travelling salesmen (TSP) in Sage. [Linear programming] [closed]

I have to solve problem of m TSP's by linear programming. Distances are euclidean, so one of good solutions is when only one salesman visits all the cities. This is the solution i get when running that program (start city is city number 8, so it is 7th in sage cause we count from 0):

This is link to my program in Cocalc [comments are in Polish]:

After running this, i get solution with 1 salesman. However, if in two constraint in for I change <=2 to ==2; that change requires putting 2 salesmen on the battlefield. However, my program still does solution with only one. Why? In another worksheet I did also with 3, and also I got only 1 salesman when doing ==3 instaed of <=3 in constraints. I program in Cocalc, not in SageMath installed on PC.

By the way, that forum has extremely annoying captcha - I spent 10 minutes doing it, bcs it always was saying that i picked wrong images....

edit retag reopen merge delete