C++ Reference: class KnapsackSolverForCuts
Note: This documentation is automatically generated.
----- KnapsackSolverForCuts -----
KnapsackSolverForCuts is the one-dimensional knapsack solver class. In the current implementation, the next item to assign is given by the primary propagator. Using SetPrimaryPropagator allows changing the default (propagator of the first dimension).
Method | |
---|---|
best_solution | Return type: Arguments: Returns true if the item 'item_id' is packed in the optimal knapsack. |
GetLowerAndUpperBoundWhenItem | Return type: Arguments: Gets the lower and the upper bound when the item is in or out of the knapsack. To ensure objects are correctly initialized, this method should not be called before Init(). |
GetName | Return type: |
GetNumberOfItems | Return type: |
GetUpperBound | Return type: Get the best upper bound found so far. |
Init | Return type: Arguments: Initializes the solver and enters the problem to be solved. |
KnapsackSolverForCuts | Return type: Arguments: |
KnapsackSolverForCuts | Arguments: |
set_node_limit | Return type: Arguments: Stops the knapsack solver after processing 'node_limit' nodes. |
set_solution_lower_bound_threshold | Return type: Arguments: The solver stops if a solution with profit better than 'solution_lower_bound_threshold' is found. |
set_solution_upper_bound_threshold | Return type: Arguments: The solver stops if the upper bound on profit drops below 'solution_upper_bound_threshold'. |
Solve | Return type: Arguments: Solves the problem and returns the profit of the best solution found. |