Module org.maxicp

Class Sorted

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

public class Sorted extends AbstractCPConstraint
Sorted constraint, x is sorted in y according to permutation o
Author:
pschaus
  • Constructor Details

    • Sorted

      public Sorted(CPIntVar[] x, CPIntVar[] o, CPIntVar[] y)
      x is sorted in y according to permutation o y[0] invalid input: '<'= y[1] invalid input: '<'= ... invalid input: '<'= y[n-1] x[i] = y[o[i]] for all i
      Parameters:
      x - a set of n variables
      o - a permutation of 0..n-1, so that x[i] = y[o[i]]
      y - a set of n variables, y[i] is the ith smallest value of x
  • Method Details