Java Reference
Java Reference
KnapsackSolver.java
Go to the documentation of this file.
211 KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER(mainJNI.KnapsackSolver_KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER_get()),
218 KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER_get()),
225 KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER_get());
233 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
KnapsackSolver(KnapsackSolver.SolverType solver_type, String solver_name)
Definition: KnapsackSolver.java:126
KnapsackSolver(String solver_name)
Definition: KnapsackSolver.java:122
boolean isSolutionOptimal()
Returns true if the solution was proven optimal.
Definition: KnapsackSolver.java:154
KNAPSACK_64ITEMS_SOLVER
Optimized method for single dimension small problems Limited to 64 items and one dimension,...
Definition: KnapsackSolver.java:203
KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER
CBC Based Solver This solver can deal with both large number of items and several dimensions.
Definition: KnapsackSolver.java:218
void init(long[] profits, long[][] weights, long[] capacities)
Initializes the solver and enters the problem to be solved.
Definition: KnapsackSolver.java:133
static SolverType swigToEnum(int swigValue)
Definition: KnapsackSolver.java:231
void setTimeLimit(double time_limit_seconds)
Time limit in seconds.
Definition: KnapsackSolver.java:176
KnapsackSolver(long cPtr, boolean cMemoryOwn)
Definition: KnapsackSolver.java:98
Enum controlling which underlying algorithm is used.
Definition: KnapsackSolver.java:186
This library solves knapsack problems.
Definition: KnapsackSolver.java:94
long solve()
Solves the problem and returns the profit of the optimal solution.
Definition: KnapsackSolver.java:140
final int swigValue()
Definition: KnapsackSolver.java:227
String getName()
Definition: KnapsackSolver.java:158
KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER
Dynamic Programming approach for single dimension problems Limited to one dimension,...
Definition: KnapsackSolver.java:211
boolean useReduction()
Definition: KnapsackSolver.java:162
void setUseReduction(boolean use_reduction)
Definition: KnapsackSolver.java:166
boolean bestSolutionContains(int item_id)
Returns true if the item 'item_id' is packed in the optimal knapsack.
Definition: KnapsackSolver.java:147