Module org.maxicp

Class TSPTWSuccessor

java.lang.Object
org.maxicp.cp.examples.raw.tsptw.TSPTWSuccessor

public class TSPTWSuccessor extends Object
Traveling Salesman Problem with Time Windows (TSPTW) using a successor-based routing model.

Model:

  • succ[i] = successor of node i in the tour
  • Circuit on succ
  • arrive[i] = arrival time at node i, propagated forward via successor: arrive[succ[i]] >= arrive[i] + dist[i][succ[i]]
  • CostAllDifferentDC as a redundant filtering for the total distance

The depot is duplicated at the end of the instance (node n-1). The tour starts at node 0 and ends at node n-1, so succ[n-1] = 0 closes the circuit. The arrival time at node 0 is fixed to 0.

Time window constraints: for each node i, earliest[i] <= arrive[i] <= latest[i] and arrive[succ[i]] >= arrive[i] + dist[i][succ[i]]. The latter uses the row dist[i] directly via an element constraint, avoiding the need to extract columns from the distance matrix.

Instances from: https://lopez-ibanez.eu/tsptw-instances

  • Constructor Details

    • TSPTWSuccessor

      public TSPTWSuccessor()
  • Method Details

    • main

      public static void main(String[] args)