Search code examples
linear-programmingcplextraveling-salesmanmixed-integer-programming

How to interpret sub tour elimination constraint in travelling salesman problem in cplex?


I have written the following code:

enter image description here

How to interpret auxiliary constraints and sub tour elimination constraints in the following formulation?

enter image description here


Solution

  • The interpretation of the MTZ subtour elimination approach is actually quite simple. Assign numbers u(i) to each node in the order in which they are visited. The constraint

    u(i) - u(j) + n x(i,j) <= n - 1
    

    can be interpreted as

    u(j) >= u(i) + 1 - M*(1-x(i,j))
    

    or

    x(i,j) = 1 ==>   u(j) >= u(i) + 1
    

    If you have a subtour say 2-3-2 this cannot hold:

    2-3 means u(3) >= u(2)+1
    3-2 means u(2) >= u(3)+1 
    

    As the whole tour should be allowed, we just drop the first node from this check.