Cardinality Networks: a theoretical and empirical study
We introduce Cardinality Networks, a new CNF encoding of cardinality constraints. It improves upon the previously existing encodings such as the sorting networks of E,n and Sorensson (JSAT 2:1-26, 2006) in that it requires much less clauses and auxiliary variables, while arc consistency is still preserved: e.g., for a constraint x (1) + ... + x (n) a parts per thousand currency signaEuro parts per thousand k, as soon as k variables among the x (i) 's become true, unit propagation sets all other x (i) 's to false. Our encoding also still admits incremental strengthening: this constraint for any smaller k is obtained without adding any new clauses, by setting a single variable to false. Here we give precise recursive definitions of the clause sets that are needed and give detailed proofs of the required properties. We demonstrate the practical impact of this new encoding by careful experiments comparing it with previous encodings on real-world instances.
cardinality constraints sat sat encodings