I am trying to implement some form of heuristic for the TSP where I'm decreasing the size of the model by restricting the declaration of variables X(i,j) to those combination (i,j) for which j belong to the, say, 10 cities nearest to i. Here X(i,j) is an binary variable indicating whether or not edge (i,j) is in the tour.
I created a subset of the cities to find the nearest neighbors of city i, but how can I implement it in the model? Do I need to add an extra constraint or?
Added you'll find the code of my AIMMS project.
Thanks in advance!
Best answer by mohansxView original
Aimms provides a TSP approach based on adding lazy constraints to avoid subtours.
Hope it helps.
You will make the index domain of X(i, j) as
X(i, j) | j in NearestNeighbors(i)
That will create only those combinations of (i, j) where j is a nearest neighbor of the node i.