Perfect Hashing and CNF Encodings of Cardinality Constraints

  • Yael Ben-Haim
  • Alexander Ivrii
  • Oded Margalit
  • Arie Matsliah
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7317)


We study the problem of encoding cardinality constraints (threshold functions) on Boolean variables into CNF. Specifically, we propose new encodings based on (perfect) hashing that are efficient in terms of the number of clauses, auxiliary variables, and propagation strength. We compare the properties of our encodings to known ones, and provide experimental results evaluating their practical effectiveness.


Hash Function Auxiliary Variable Boolean Variable Conjunctive Normal Form Cardinality Constraint 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [AN96]
    Alon, N., Naor, M.: Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions. Algorithmica 16(4/5), 434–449 (1996)MathSciNetzbMATHCrossRefGoogle Scholar
  2. [ANOR09]
    Asín, R., Nieuwenhuis, R., Oliveras, A., Rodríguez-Carbonell, E.: Cardinality Networks and Their Applications. In: Kullmann, O. (ed.) SAT 2009. LNCS, vol. 5584, pp. 167–180. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  3. [Bai11]
    Bailleux, O.: On the expressive power of unit resolution. Technical Report arXiv:1106.3498 (June 2011)Google Scholar
  4. [BB03]
    Bailleux, O., Boufkhad, Y.: Efficient CNF Encoding of Boolean Cardinality Constraints. In: Rossi, F. (ed.) CP 2003. LNCS, vol. 2833, pp. 108–122. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  5. [BKNW09]
    Bessiere, C., Katsirelos, G., Narodytska, N., Walsh, T.: Circuit complexity and decompositions of global constraints. In: Proceedings of the 21st International Joint Conference on Artifical Intelligence, IJCAI 2009, pp. 412–418. Morgan Kaufmann Publishers Inc., San Francisco (2009)Google Scholar
  6. [CLRS09]
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press (2009)Google Scholar
  7. [ES06]
    Eén, N., Sörensson, N.: Translating Pseudo-Boolean constraints into SAT. JSAT 2(1-4), 1–26 (2006)zbMATHGoogle Scholar
  8. [FG10]
    Frisch, A.M., Giannaros, P.A.: SAT encodings of the at-most-k constraint. In: ModRef (2010)Google Scholar
  9. [FK84]
    Fredman, M.L., Komlós, J.: On the size of separating systems and families of perfect hash functions. SIAM Journal on Algebraic and Discrete Methods 5(1), 61–68 (1984)zbMATHCrossRefGoogle Scholar
  10. [FPDN05]
    Frisch, A.M., Peugniez, T.J., Doggett, A.J., Nightingale, P.: Solving non-Boolean satisfiability problems with stochastic local search: A comparison of encodings. J. Autom. Reasoning 35(1-3), 143–179 (2005)MathSciNetzbMATHCrossRefGoogle Scholar
  11. [KM03]
    Kim, K.-M.: Perfect hash families: Constructions and applications. Master Thesis (2003)Google Scholar
  12. [Sin05]
    Sinz, C.: Towards an Optimal CNF Encoding of Boolean Cardinality Constraints. In: van Beek, P. (ed.) CP 2005. LNCS, vol. 3709, pp. 827–831. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  13. [War98]
    Warners, J.P.: A linear-time transformation of linear inequalities into conjunctive normal form. Inf. Process. Lett. 68(2), 63–69 (1998)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Yael Ben-Haim
    • 1
  • Alexander Ivrii
    • 1
  • Oded Margalit
    • 1
  • Arie Matsliah
    • 1
  1. 1.IBM R&D Labs in IsraelHaifaIsrael

Personalised recommendations