![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
Definition at line 1185 of file knapsack_solver.cc.
Public Member Functions | |
| KnapsackMIPSolver (MPSolver::OptimizationProblemType problem_type, absl::string_view solver_name) | |
| void | Init (const std::vector< int64_t > &profits, const std::vector< std::vector< int64_t > > &weights, const std::vector< int64_t > &capacities) override |
| Initializes the solver and enters the problem to be solved. | |
| int64_t | Solve (TimeLimit *time_limit, double time_limit_in_second, bool *is_solution_optimal) override |
| Solves the problem and returns the profit of the optimal solution. | |
| bool | best_solution (int item_id) const override |
| Returns true if the item 'item_id' is packed in the optimal knapsack. | |
| Public Member Functions inherited from operations_research::BaseKnapsackSolver | |
| BaseKnapsackSolver (absl::string_view solver_name) | |
| virtual | ~BaseKnapsackSolver ()=default |
| virtual void | GetLowerAndUpperBoundWhenItem (int item_id, bool is_item_in, int64_t *lower_bound, int64_t *upper_bound) |
| virtual std::string | GetName () const |
| operations_research::KnapsackMIPSolver::KnapsackMIPSolver | ( | MPSolver::OptimizationProblemType | problem_type, |
| absl::string_view | solver_name ) |
Definition at line 1212 of file knapsack_solver.cc.
|
inlineoverridevirtual |
Returns true if the item 'item_id' is packed in the optimal knapsack.
Implements operations_research::BaseKnapsackSolver.
Definition at line 1200 of file knapsack_solver.cc.
|
overridevirtual |
Initializes the solver and enters the problem to be solved.
Implements operations_research::BaseKnapsackSolver.
Definition at line 1222 of file knapsack_solver.cc.
|
overridevirtual |
Solves the problem and returns the profit of the optimal solution.
Implements operations_research::BaseKnapsackSolver.
Definition at line 1230 of file knapsack_solver.cc.