Class TSPAstarMain

java.lang.Object
org.ddolib.examples.layered.tsp.TSPAstarMain

public class TSPAstarMain extends Object
The Traveling Salesman Problem (TSP) with AsTar. Main class to solve a Traveling Salesman Problem (TSP) instance using the A* algorithm.

This class reads a problem instance from a file (XML format), initializes a TSPProblem and a Model with a fast lower bound (TSPFastLowerBound), and then solves the problem using an A* search solver. The solution and search statistics are printed to the console.

Usage:

 java TSPAstarMain [instanceFile]
 

If no instanceFile argument is provided, a default instance ("data/TSP/instance_18_0.xml") is used.

  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Entry point of the program. Builds a TSP instance and solves it using the A* algorithm.
      Parameters:
      args - optional command-line argument: path to the TSP instance file (default: data/TSP/instance_18_0.xml)
      Throws:
      IOException - if there is an error reading the instance file