Package org.ddolib.examples.knapsack
Class KSAstarMain
java.lang.Object
org.ddolib.examples.knapsack.KSAstarMain
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:
- Loads a knapsack instance from a data file.
- Defines a
Modelwith a fast lower bound and a dominance checker. - Creates a
Solversand runs the A* algorithm. - Prints updates when a new incumbent solution is found.
- 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 Summary
Constructors -
Method Summary
-
Constructor Details
-
KSAstarMain
public KSAstarMain()
-
-
Method Details
-
main
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
-