C++ Reference: class KnapsackGenericSolver
Note: This documentation is automatically generated.
----- KnapsackGenericSolver -----
KnapsackGenericSolver is the multi-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), and selecting another dimension when more constrained. TODO(user): In the case of a multi-dimensional knapsack problem, implement an aggregated propagator to combine all dimensions and give a better guide to select the next item (see, for instance, Dobson's aggregated efficiency).
Method | |
---|---|
best_solution | Return type: Arguments: Returns true if the item 'item_id' is packed in the optimal knapsack. |
GetLowerAndUpperBoundWhenItem | Return type: Arguments: |
GetNumberOfItems | Return type: |
Init | Return type: Arguments: Initializes the solver and enters the problem to be solved. |
KnapsackGenericSolver | Return type: Arguments: |
~KnapsackGenericSolver | |
set_primary_propagator_id | Return type: Arguments: Sets which propagator should be used to guide the search. 'primary_propagator_id' should be in 0..p-1 with p the number of propagators. |
Solve | Return type: Arguments: Solves the problem and returns the profit of the optimal solution. |