Class BKSLnsMain
java.lang.Object
org.ddolib.examples.boundedknapsack.BKSLnsMain
Entry point for solving the Bounded Knapsack Problem (BKS)
using a Large Neighborhood Search (LNS) approach combined with
Decision Diagram Optimization (DDO).
The Bounded Knapsack Problem consists in selecting quantities of items (each with a profit, weight, and upper bound) such that the total weight does not exceed the knapsack capacity while maximizing the total profit.
This class demonstrates how to:
- Generate a synthetic BKS instance
- Define a
LnsModelwith problem-specific components - Incorporate dominance rules to prune the search space
- Run a Large Neighborhood Search (LNS) optimization
- Print intermediate and final solutions
Instance Configuration
- Number of items: 35
- Knapsack capacity: 100
- Instance type: strongly correlated profits and weights
- Random seed: 0
Model Components
BKSProblem– defines the knapsack instanceBKSFastLowerBound– provides a fast lower bound estimationBKSDominance– defines dominance relations between statesSimpleDominanceChecker– applies dominance pruningBKSRanking– ranks states during decision diagram compilationFixedWidth– limits the decision diagram width
Search Configuration
- Search strategy: Large Neighborhood Search (LNS)
- Time limit: 10,000 milliseconds
- Width heuristic: fixed width of 100 nodes per layer
Output
The program prints:
- Intermediate solutions during the search
- Final solution statistics
- The best solution found
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BKSLnsMain
public BKSLnsMain()
-
-
Method Details
-
main
Main entry point of the program.Builds a BKS instance, configures the LNS model with problem-specific heuristics and dominance rules, and runs the optimization process.
- Parameters:
args- command-line arguments (currently unused)
-