Class TSPTWDdoMain

java.lang.Object
org.ddolib.examples.tsptw.TSPTWDdoMain

public class TSPTWDdoMain extends Object
The Traveling Salesman Problem with Time Windows (TSP with Time Windows) with Ddo. Main class for solving the Traveling Salesman Problem with Time Windows (TSPTW) using a Decision Diagram Optimization (DDO) approach.

This class demonstrates how to load a TSPTW problem instance, define a DDO model with relaxation, ranking, lower bound, dominance, frontier, width heuristic, and caching, and solve the problem using Solvers.minimizeDdo(DdoModel, java.util.function.BiConsumer). The solution and search statistics are printed to the console.

Default data files come from López-Ibáñes and Blum benchmark instances.

  • Constructor Details

    • TSPTWDdoMain

      public TSPTWDdoMain()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Entry point of the application.

      Execution examples:

      • Run the default instance: mvn exec:java -Dexec.mainClass="org.ddolib.ddosolver.examples.tsptw.TSPTWMain"
      • Run a specific instance with optional maximum MDD width: mvn exec:java -Dexec.mainClass="org.ddolib.ddosolver.examples.tsptw.TSPTWMain" -Dexec.args="<your file> <max width>"

      The method performs the following steps:

      1. Loads the TSPTW problem instance from a file (default or provided via arguments).
      2. Defines a DDO model including:
      3. Solves the problem using the DDO solver.
      4. Prints the solution and search statistics to the console.
      Parameters:
      args - optional command-line arguments specifying the instance file and maximum width
      Throws:
      IOException - if an I/O error occurs while reading the instance file or printing the solution