Class KSModel

java.lang.Object
org.ddolib.examples.nolayer.knapsack.KSModel
All Implemented Interfaces:
Model<KSState>

public class KSModel extends Object implements Model<KSState>
Base model for the Knapsack Problem (KS), using the no-layer modeling API.

Bundles a KSProblem instance together with the KSFlb fast lower bound used to guide and prune the search.

  • Constructor Details

    • KSModel

      public KSModel(KSProblem problem)
      Creates a new model for the given knapsack instance.
      Parameters:
      problem - the knapsack instance to solve
  • Method Details

    • problem

      public Problem<KSState> problem()
      Description copied from interface: Model
      Returns the optimization problem instance associated with this model.
      Specified by:
      problem in interface Model<KSState>
      Returns:
      the Problem defining the structure, transitions, and objective function
    • lowerBound

      public FastLowerBound<KSState> lowerBound()
      Description copied from interface: Model
      Returns a heuristic that estimates a lower bound on the objective value for a given state.
      Specified by:
      lowerBound in interface Model<KSState>
      Returns:
      the FastLowerBound heuristic