Class KSAwAstarMain
java.lang.Object
org.ddolib.examples.layered.knapsack.KSAwAstarMain
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:
- Loads a knapsack instance from a data file.
- Defines an
AwAstarModelwith a weight, fast lower bound, and dominance checker. - Runs the AWA* algorithm with a stopping criterion based on relative improvement.
- Prints updates when a new incumbent solution is found.
- Outputs the final search statistics and displays a progress chart.
-
Method Summary
-
Method Details
-
main
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
-