|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--Opus5.ZeroOneKnapsackProblem
Represents a 0/1 knapsack problem.
| Inner Class Summary | |
protected class |
ZeroOneKnapsackProblem.Node
|
| Field Summary | |
protected int |
capacity
The capacity of the knapsack. |
protected int |
numberOfItems
The total number of items from which to choose. |
protected int[] |
profit
The profits associated with taking each of the items. |
protected int[] |
weight
The weights of each of the items. |
| Constructor Summary | |
ZeroOneKnapsackProblem(int[] weight,
int[] profit,
int capacity)
Constructs a ZeroOneKnapsackProblem
with the specified weights, profits and capacity. |
|
| Method Summary | |
Solution |
solve(Solver solver)
Solves this 0/1 knapsack problem using the specified solver. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int numberOfItems
protected int[] weight
protected int[] profit
protected int capacity
| Constructor Detail |
public ZeroOneKnapsackProblem(int[] weight,
int[] profit,
int capacity)
ZeroOneKnapsackProblem
with the specified weights, profits and capacity.weight - The weights of the items to be considered.weight - The profits of the items to be considered.capacity - The total capacity of the knapsack.| Method Detail |
public Solution solve(Solver solver)
solver - The solver to use.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||