applications
Class MaxProfitBBKnapsack

java.lang.Object
  |
  +--applications.MaxProfitBBKnapsack

public class MaxProfitBBKnapsack
extends java.lang.Object


Constructor Summary
MaxProfitBBKnapsack()
           
 
Method Summary
static double knapsack(double[] theProfit, double[] theWeight, double theCapacity, int[] bestPacking)
           
static void main(java.lang.String[] args)
          test program
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxProfitBBKnapsack

public MaxProfitBBKnapsack()
Method Detail

knapsack

public static double knapsack(double[] theProfit,
                              double[] theWeight,
                              double theCapacity,
                              int[] bestPacking)
Parameters:
theProfit[1:theProfit.length] - is array of object profits
theWeight[1:theProfit.length] - is array of object weights
theCapacity - is knapsack capacity
bestPacking - set to best knapsack filling
Returns:
profit of best filling

main

public static void main(java.lang.String[] args)
test program