Skip to main content

Towards an Optimal CNF Encoding of Boolean Cardinality Constraints

  • Conference paper
Principles and Practice of Constraint Programming - CP 2005 (CP 2005)

Part of the book series: Lecture Notes in Computer Science ((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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Institutional subscriptions


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others


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

    Article  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)

    Article  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)

    Chapter  Google Scholar 

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

    Article  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)

    Article  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)

Publish with us

Policies and ethics