= Cardinality constraint
{title2=$\sum_i X_i=k,\quad X_i\in\{0,1\}$}
A <cardinality constraint> restricts how many members of a specified collection are selected or satisfy a property. For <Boolean variables>, exactly $k$ selected entries gives the displayed <sum>; upper and lower bounds give at-most and at-least variants. <Constraint propagation> can maintain the number already selected and the number still available. A requirement involving many <variables> is a global constraint, even when it has a compact arithmetic description.
Back to article page