Class KSAstarMain

java.lang.Object
org.ddolib.examples.knapsack.KSAstarMain

public class KSAstarMain extends Object
Knapsack Problem (KS) with AsTar.

This class demonstrates how to solve an instance of the Knapsack Problem (KS) using the A* search algorithm.

The program performs the following steps:

  1. Loads a knapsack instance from a data file.
  2. Defines a Model with a fast lower bound and a dominance checker.
  3. Creates a Solvers and runs the A* algorithm.
  4. Prints updates when a new incumbent solution is found.
  5. Outputs the final search statistics.

The A* solver uses the specified dominance checker and fast lower bound to prune the search tree and guide the exploration efficiently.

  • Constructor Details

    • KSAstarMain

      public KSAstarMain()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Entry point of the A* demonstration for the Knapsack Problem.
      Parameters:
      args - command-line arguments (not used)
      Throws:
      IOException - if the instance file cannot be read