Java Reference

Java Reference

KnapsackSolver.SolverType Enum Reference

Detailed Description

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.

Definition at line 189 of file KnapsackSolver.java.

Public Member Functions

final int swigValue ()
 

Static Public Member Functions

static SolverType swigToEnum (int swigValue)
 

Public Attributes

 KNAPSACK_BRUTE_FORCE_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_BRUTE_FORCE_SOLVER_get())
 Brute force method. More...
 
 KNAPSACK_64ITEMS_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_64ITEMS_SOLVER_get())
 Optimized method for single dimension small problems

Limited to 64 items and one dimension, this
solver uses a branch & bound algorithm. More...
 
 KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER_get())
 Dynamic Programming approach for single dimension problems

Limited to one dimension, this solver is based on a dynamic programming
algorithm. More...
 
 KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER_get())
 CBC Based Solver

This solver can deal with both large number of items and several
dimensions. More...
 
 KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER_get())
 Generic Solver. More...
 

Member Function Documentation

◆ swigToEnum()

static SolverType swigToEnum ( int  swigValue)
inlinestatic

Definition at line 234 of file KnapsackSolver.java.

◆ swigValue()

final int swigValue ( )
inline

Definition at line 230 of file KnapsackSolver.java.

Member Data Documentation

◆ KNAPSACK_64ITEMS_SOLVER

KNAPSACK_64ITEMS_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_64ITEMS_SOLVER_get())

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.

Definition at line 206 of file KnapsackSolver.java.

◆ KNAPSACK_BRUTE_FORCE_SOLVER

KNAPSACK_BRUTE_FORCE_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_BRUTE_FORCE_SOLVER_get())

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.

Definition at line 198 of file KnapsackSolver.java.

◆ KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER

KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_DYNAMIC_PROGRAMMING_SOLVER_get())

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).

Definition at line 214 of file KnapsackSolver.java.

◆ KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER

KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER_get())

Generic Solver.



This solver can deal with both large number of items and several
dimensions. This solver is based on branch and bound.

Definition at line 228 of file KnapsackSolver.java.

◆ KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER

KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER =(mainJNI.KnapsackSolver_KNAPSACK_MULTIDIMENSION_CBC_MIP_SOLVER_get())

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.

Definition at line 221 of file KnapsackSolver.java.


The documentation for this enum was generated from the following file: