Enum KnapsackSolver.SolverType
- All Implemented Interfaces:
Serializable,Comparable<KnapsackSolver.SolverType>,java.lang.constant.Constable
- Enclosing class:
KnapsackSolver
Enum controlling which underlying algorithm is used.
This enum is passed to the constructor of the KnapsackSolver object.
It selects which solving method will be used.
This enum is passed to the constructor of the KnapsackSolver object.
It selects which solving method will be used.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOptimized method for single dimension small problems
Limited to 64 items and one dimension, this
solver uses a branch & bound algorithm.Brute force method.
Limited to 30 items and one dimension, this
solver uses a brute force algorithm, ie. explores all possible states.
Experiments show competitive performance for instances with less than
15 items.Divide and Conquer approach for single dimension problems
Limited to one dimension, this solver is based on a divide and conquer
technique and is suitable for larger problems than Dynamic Programming
Solver.Dynamic Programming approach for single dimension problems
Limited to one dimension, this solver is based on a dynamic programming
algorithm.Generic Solver.
This solver can deal with both large number of items and several
dimensions.CBC Based Solver
This solver can deal with both large number of items and several
dimensions.CP-SAT based solver
This solver can deal with both large number of items and several
dimensions.SCIP based solver
This solver can deal with both large number of items and several
dimensions. -
Method Summary
Modifier and TypeMethodDescriptionstatic KnapsackSolver.SolverTypeswigToEnum(int swigValue) final intstatic KnapsackSolver.SolverTypeReturns the enum constant of this type with the specified name.static KnapsackSolver.SolverType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
KNAPSACK_BRUTE_FORCE_SOLVER
Brute force method.
Limited to 30 items and one dimension, this
solver uses a brute force algorithm, ie. explores all possible states.
Experiments show competitive performance for instances with less than
15 items. -
KNAPSACK_64ITEMS_SOLVER
Optimized method for single dimension small problems
Limited to 64 items and one dimension, this
solver uses a branch & bound algorithm. This solver is about 4 times
faster than KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER. -
KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER
Dynamic Programming approach for single dimension problems
Limited to one dimension, this solver is based on a dynamic programming
algorithm. The time and space complexity is O(capacity *
number_of_items). -
KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER
CBC Based Solver
This solver can deal with both large number of items and several
dimensions. This solver is based on Integer Programming solver CBC. -
KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER
Generic Solver.
This solver can deal with both large number of items and several
dimensions. This solver is based on branch and bound. -
KNAPSACK_MULTIDIMENSION_SCIP_MIP_SOLVER
SCIP based solver
This solver can deal with both large number of items and several
dimensions. This solver is based on Integer Programming solver SCIP. -
KNAPSACK_DIVIDE_AND_CONQUER_SOLVER
Divide and Conquer approach for single dimension problems
Limited to one dimension, this solver is based on a divide and conquer
technique and is suitable for larger problems than Dynamic Programming
Solver. The time complexity is O(capacity * number_of_items) and the
space complexity is O(capacity + number_of_items). -
KNAPSACK_MULTIDIMENSION_CP_SAT_SOLVER
CP-SAT based solver
This solver can deal with both large number of items and several
dimensions. This solver is based on the CP-SAT solver
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
swigValue
public final int swigValue() -
swigToEnum
-