Package org.ddolib.examples.tsp
Class TSPLnsMain
java.lang.Object
org.ddolib.examples.tsp.TSPLnsMain
Entry point for solving the Traveling Salesman Problem (TSP) using a
Large Neighborhood Search (LNS) approach.
This class reads an instance file describing a TSP problem, constructs an LNS model, and searches for an optimal or near-optimal tour within a time limit. The best solution found is printed to standard output.
Usage:
java TSPLnsMain [instanceFilePath]
instanceFilePath(optional): Path to the TSP instance file. If omitted, the default instance located atdata/TSP/instance_18_0.xmlis used.
The LNS model is configured with:
- A
TSPFastLowerBoundfor efficient lower bound estimation. - A
TSPRankingto rank tour decisions during the search. - A fixed width heuristic (
FixedWidth) with a width of 500 for tree exploration.
The search is limited to 10,000 milliseconds (10 seconds) per iteration, and the
best solution found is printed using SolutionPrinter.
This implementation does not include dominance checks.
- Version:
- 1.0
- Author:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TSPLnsMain
public TSPLnsMain()
-
-
Method Details
-
main
Main method to run the TSP LNS solver.- Parameters:
args- optional command-line argument:args[0]: path to the TSP instance file (default:data/TSP/instance_18_0.xml)
- Throws:
IOException- if there is an error reading the instance file.
-