Module org.maxicp

Class LightBinaryKnapsack

java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.LightBinaryKnapsack
All Implemented Interfaces:
CPConstraint, ConcreteConstraint<ConcreteCPModel>

public class LightBinaryKnapsack extends AbstractCPConstraint
Lightweight Binary Knapsack constraint enforcing load = sum_i items[i] * weights[i] using bound reasoning on the required and possible loads.
  • Constructor Details

    • LightBinaryKnapsack

      public LightBinaryKnapsack(CPBoolVar[] items, int[] weights, CPIntVar load)
      Creates a lightweight binary knapsack constraint load = sum_i items[i] * weights[i].
      Parameters:
      items - the binary selection variables for each item
      weights - the weight of each item
      load - the total weight variable of the selected items
  • Method Details