Traveling salesman skipping some cities.

graph theoryoptimization

There is 10 cities and traveling salesman has to find shortest route to visit just any 5 of them.

What would be a proper approach to solve 'traveling-salesman-like' problem where there is more cities available than salesman needs to visit?

Best Answer

With OR-Tools (very good idea) :

  1. Allow the solver to drop all nodes with the AddDisjunction() method https://developers.google.com/optimization/routing/penalties

  2. Add the (custom) constraint $$ \sum_{v \in V} x_v = 5$$ where $x_v$ takes value $1$ iff node $v$ is visited. You need to use the solver().Add() method :https://github.com/google/or-tools/issues/847.

Related Question