Class KSAwAstarMain

java.lang.Object
org.ddolib.examples.layered.knapsack.KSAwAstarMain

public class KSAwAstarMain extends Object
Knapsack Problem (KS) with Anytime Weighted A* (AWA*).

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

The program performs the following steps:

  1. Loads a knapsack instance from a data file.
  2. Defines an AwAstarModel with a weight, fast lower bound, and dominance checker.
  3. Runs the AWA* algorithm with a stopping criterion based on relative improvement.
  4. Prints updates when a new incumbent solution is found.
  5. Outputs the final search statistics and displays a progress chart.
  • Method Details

    • main

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