Skip to main content

Towards an Optimal CNF Encoding of Boolean Cardinality Constraints

  • Conference paper

Part of the Lecture Notes in Computer Science book series (LNPSE,volume 3709)


We consider the problem of encoding Boolean cardinality constraints in conjunctive normal form (CNF). Boolean cardinality constraints are formulae expressing that at most (resp. at least) k out of n propositional variables are true. We give two novel encodings that improve upon existing results, one which requires only 7n clauses and 2n auxiliary variables, and another one demanding \(\mathcal{O}(n \cdot k)\) clauses, but with the advantage that inconsistencies can be detected in linear time by unit propagation alone. Moreover, we prove a linear lower bound on the number of required clauses for any such encoding.


  • Boolean Function
  • Auxiliary Variable
  • Unit Propagation
  • Conjunctive Normal Form
  • Binary Number

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.

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Küchlin, W., Sinz, C.: Proving consistency assertions for automotive product data management. J. Automated Reasoning 24, 145–163 (2000)

    CrossRef  MATH  Google Scholar 

  2. Cabon, B., de Givry, S., Lobjois, L., Schiex, T., Warners, J.P.: Radio link frequency assignment. Constraints 4, 79–89 (1999)

    CrossRef  MATH  Google Scholar 

  3. 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)

    CrossRef  Google Scholar 

  4. Warners, J.P.: A linear-time transformation of linear inequalities into conjunctive normal form. Inf. Process. Lett. 68, 63–69 (1998)

    CrossRef  MathSciNet  Google Scholar 

  5. Tseitin, G.S.: On the complexity of derivation in propositional calculus. In: Slisenko, A.O. (ed.) Studies in Constructive Mathematics and Mathematical Logic, pp. 115–125 (1970)

    Google Scholar 

  6. Jackson, P., Sheridan, D.: The optimality of a fast CNF conversion and its use with SAT. Technical Report APES-82-2004, APES Research Group (2004), Available from

  7. Muller, D.E., Preparata, F.P.: Bounds to complexities of networks for sorting and for switching. J. ACM 22, 195–201 (1975)

    CrossRef  MATH  MathSciNet  Google Scholar 

  8. Wegener, I.: The Complexity of Boolean Functions. Wiley-Teubner, Chichester (1987)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations


Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Sinz, C. (2005). Towards an Optimal CNF Encoding of Boolean Cardinality Constraints. In: van Beek, P. (eds) Principles and Practice of Constraint Programming - CP 2005. CP 2005. Lecture Notes in Computer Science, vol 3709. Springer, Berlin, Heidelberg.

Download citation

  • DOI:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29238-8

  • Online ISBN: 978-3-540-32050-0

  • eBook Packages: Computer ScienceComputer Science (R0)