Package org.ddolib.examples.tsptw
Class TSPTWDdoMain
java.lang.Object
org.ddolib.examples.tsptw.TSPTWDdoMain
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
TSPTWDdoMain
public TSPTWDdoMain()
-
-
Method Details
-
main
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:
- Loads the TSPTW problem instance from a file (default or provided via arguments).
- Defines a DDO model including:
- Relaxation using
TSPTWRelax - Ranking using
TSPTWRanking - Lower bound using
TSPTWFastLowerBound - Dominance using
TSPTWDominanceandSimpleDominanceChecker - Frontier using
SimpleFrontierandCutSetType.Frontier - Width heuristic using
FixedWidth - Caching enabled
- Relaxation using
- Solves the problem using the DDO solver.
- 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
- Run the default instance:
-