Maximal Propagate (cpmpy.tools.maximal_propagate)

Maximal propagation of CPMpy constraints using repeated solving.

cpmpy.tools.maximal_propagate.maximal_propagate(constraints, vars=None, solver='ortools', method='union')[source]

Maximal propagation algorithm for CP programs.

Returns all values for variables for which at least one model exists. I.e., returns a globally consistent constraint network.

Parameters:
  • constraints – list of CPMpy constraints

  • vars – list of variables, optional, list of variables to propagate.

  • solver – name of a solver, see SolverLookup.solvernames() for faster propagation, use incremental solver such as pysat, z3 or gurobi.

  • method – method of propagation, optional, for large domains, use ‘union’, for small domains use ‘intersect’

cpmpy.tools.maximal_propagate.maximal_propagate_intersect(constraints, vars, solver='ortools')[source]

Maximal propagation of constraints using intersection of models. Each iteration of the algorithm requires a solution with at least one unseen variable assignment.

cpmpy.tools.maximal_propagate.maximal_propagate_union(constraints, vars, solver='ortools')[source]

Maximal propagation of constraints using union of models. Each iteration of the algorithm requires a solution with at least one unseen variable assignment.