#include <knapsack_solver.h>
Definition at line 117 of file knapsack_solver.h.
◆ SolverType
| Enumerator |
|---|
| KNAPSACK_BRUTE_FORCE_SOLVER | |
| KNAPSACK_64ITEMS_SOLVER | |
| KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER | |
| KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER | |
Definition at line 119 of file knapsack_solver.h.
◆ KnapsackSolver() [1/2]
| operations_research::KnapsackSolver::KnapsackSolver |
( |
const std::string & |
solver_name | ) |
|
|
explicit |
◆ KnapsackSolver() [2/2]
| operations_research::KnapsackSolver::KnapsackSolver |
( |
SolverType |
solver_type, |
|
|
const std::string & |
solver_name |
|
) |
| |
◆ ~KnapsackSolver()
| virtual operations_research::KnapsackSolver::~KnapsackSolver |
( |
| ) |
|
|
virtual |
◆ BestSolutionContains()
| bool operations_research::KnapsackSolver::BestSolutionContains |
( |
int |
item_id | ) |
const |
Returns true if the item 'item_id' is packed in the optimal knapsack.
◆ GetName()
| std::string operations_research::KnapsackSolver::GetName |
( |
| ) |
const |
◆ Init()
| void operations_research::KnapsackSolver::Init |
( |
const std::vector< int64 > & |
profits, |
|
|
const std::vector< std::vector< int64 > > & |
weights, |
|
|
const std::vector< int64 > & |
capacities |
|
) |
| |
Initializes the solver and enters the problem to be solved.
◆ IsSolutionOptimal()
| bool operations_research::KnapsackSolver::IsSolutionOptimal |
( |
| ) |
const |
|
inline |
◆ set_time_limit()
| void operations_research::KnapsackSolver::set_time_limit |
( |
double |
time_limit_seconds | ) |
|
|
inline |
Time limit in seconds.
When a finite time limit is set the solution obtained might not be optimal if the limit is reached.
Definition at line 155 of file knapsack_solver.h.
◆ set_use_reduction()
| void operations_research::KnapsackSolver::set_use_reduction |
( |
bool |
use_reduction | ) |
|
|
inline |
◆ Solve()
| int64 operations_research::KnapsackSolver::Solve |
( |
| ) |
|
Solves the problem and returns the profit of the optimal solution.
◆ use_reduction()
| bool operations_research::KnapsackSolver::use_reduction |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: