Constraints

A constraint is a logic formula defining allowed combinations of values for a set of variables (see Variables), i.e., restrictions over variables that must be respected in order to get a feasible solution. A constraint is equipped with a (set of) filtering algorithm(s), named propagator(s). A propagator removes, from the domains of the target variables, values that cannot correspond to a valid combination of values. A solution of a problem is a variable-value assignment verifying all the constraints.

Constraints are directly declared from a Model object (see Model).

Integer and boolean constraints

All constraints over integer and boolean variables are declared in the IntConstraintFactory abstract class, which is implemented by the Model class.

absolute

all_different

all_different_except_0

all_different_prec

all_equal

among

and

argmax

argmin

arithm

at_least_n_values

at_most_n_values

bin_packing

bits_int_channeling

bools_int_channeling

circuit

clauses_int_channeling

cost_regular

count

cumulative

decreasing

diff_n

distance

div

element

global_cardinality

increasing

int_value_precede_chain

inverse_channeling

keysort

knapsack

lex_chain_less

lex_chain_less_eq

lex_less

lex_less_eq

max

mddc

member

min

mod

multi_cost_regular

n_values

not

not_all_equal

not_member

or

path

pow

regular

scalar

sort

square

sub_circuit

sub_path

sum

table

times

tree

Set constraints

All constraints over set variables in the SetConstraintFactory abstract class, which is implemented by the Model class. Set constraints have the set_ prefix, indeed, as several set constraints have the same name as int constraints, we made the choice to semantically distinguish them, contrarily to the Choco Java API, as method Python does not support method overloading.

set_all_different

set_all_disjoint

set_all_equal

set_bools_channeling

set_disjoint

set_element

set_intersection

set_ints_channeling

set_inverse_set

set_le

set_lt

set_max

set_max_indices

set_member_int

set_member_set

set_min

set_min_indices

set_nb_empty

set_not_empty

set_not_member_int

set_offset

set_partition

set_subset_eq

set_sum

set_sum_element

set_symmetric

set_union

set_union_indices

Graph constraints

All constraints over graph variables in the GraphConstraintFactory abstract class, which is implemented by the Model class. Graph constraints have the graph_ prefix, indeed, as method Python does not support method overloading, we made the choice to semantically distinguish them to avoid method name conflicts.

graph_anti_symmetric

graph_biconnected

graph_connected

graph_cycle

graph_degrees

graph_diameter

graph_directed_forest

graph_directed_tree

graph_edge_channeling

graph_forest

graph_in_degrees

graph_loop_set

graph_max_degree

graph_max_degrees

graph_max_in_degree

graph_max_in_degrees

graph_max_out_degree

graph_max_out_degrees

graph_min_degree

graph_min_degrees

graph_min_in_degree

graph_min_in_degrees

graph_min_out_degree

graph_min_out_degrees

graph_nb_cliques

graph_nb_connected_components

graph_nb_edges

graph_nb_loops

graph_nb_nodes

graph_nb_strongly_connected_components

graph_neighbors_channeling

graph_no_circuit

graph_no_cycle

graph_node_channeling

graph_node_neighbors_channeling

graph_node_predecessors_channeling

graph_node_successors_channeling

graph_nodes_channeling

graph_out_degrees

graph_reachability

graph_size_connected_components

graph_size_max_connected_components

graph_size_min_connected_components

graph_strongly_connected

graph_subgraph

graph_successors_channeling

graph_symmetric

graph_transitivity

graph_tree