Module org.maxicp

Class CostCardinalityMaxDC

java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.CostCardinalityMaxDC
All Implemented Interfaces:
CPConstraint, ConcreteConstraint<ConcreteCPModel>
Direct Known Subclasses:
CostAllDifferentDC

public class CostCardinalityMaxDC extends AbstractCPConstraint
Implementation of the Global Cardinality Constraint with Costs from the paper

Margaux Schmied, Jean-Charles Régin: Efficient Implementation of the Global Cardinality Constraint with Costs. CP 2024

Author:
Margaux Schmied
  • Constructor Details

    • CostCardinalityMaxDC

      public CostCardinalityMaxDC(CPIntVar[] x, int[] upper, int[][] costs, CPIntVar H, CostCardinalityMaxDC.Algorithm algorithm)
      Constraint the maximum number of occurrences of a range of values in x.
      Parameters:
      x - The variables to constraint (at least one), only non-negative values
      upper - The upper cardinality bounds, upper[i] is the maximum number of occurrences of value i in x The size of upper must be equal to the number of columns in costs and equal to the larest value in x.
      costs - The costs associated with each value in x.
      H - The maximum cost allowed for the assignment.
      algorithm - The algorithm to use for the constraint, either SCHMIED_REGIN_2024 or REGIN_2002.
    • CostCardinalityMaxDC

      public CostCardinalityMaxDC(CPIntVar[] x, int[] upper, int[][] costs, CPIntVar H)
      Constraint the maximum number of occurrences of a range of values in x.
      Parameters:
      x - The variables to constraint (at least one), only non-negative values
      upper - The upper cardinality bounds, upper[i] is the maximum number of occurrences of value i in x The size of upper must be equal to the number of columns in costs and equal to the larest value in x.
      costs - The costs associated with each value in x.
      H - The maximum cost allowed for the assignment.
  • Method Details