Clique-width is a graph invariant that has been widely studied in combinatorics and computer science. However, computing the clique-width of a graph is an intricate problem, the exact clique-width is not known even for very small graphs. We present a new method for computing the clique-width of graphs based on an encoding to propositional satisfiability (SAT) which is then evaluated by a SAT solver. Our encoding is based on a reformulation of clique-width in terms of partitions that utilizes an efficient encoding of cardinality constraints. Our SAT-based method is the first to discover the exact clique-width of various small graphs, including famous graphs from the literature as well as random graphs of various density. With our method we determined the smallest graphs that require a small pre-described clique-width.


Random Graph Parse Tree Prime Graph Cardinality Constraint Small Graph 
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. 1.
    Audemard, G., Simon, L.: Predicting learnt clauses quality in modern sat solvers. In: Proceedings of the 21st International Jont Conference on Artifical Intelligence, IJCAI 2009, pp. 399–404. Morgan Kaufmann Publishers Inc., San Francisco (2009)Google Scholar
  2. 2.
    Beyß, M.: Fast algorithm for rank-width. In: Kučera, A., Henzinger, T.A., Nešetřil, J., Vojnar, T., Antoš, D. (eds.) MEMICS 2012. LNCS, vol. 7721, pp. 82–93. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  3. 3.
    Biere, A.: Lingeling and friends entering the SAT Challenge 2012. In: Balint, A., Belov, A., Diepold, A., Gerber, S., Järvisalo, M., Sinz, C. (eds.) Solver and Benchmark Descriptions. Department of Computer Science Series of Publications B, vol. B-2012-2, pp. 33–34. University of Helsinki (2012)Google Scholar
  4. 4.
    Bui-Xuan, B.-M., Telle, J.A., Vatshelle, M.: Boolean-width of graphs. Theoretical Computer Science 412(39), 5187–5204 (2011)MathSciNetzbMATHCrossRefGoogle Scholar
  5. 5.
    Corneil, D.G., Habib, M., Lanlignel, J.-M., Reed, B., Rotics, U.: Polynomial-time recognition of clique-width ≤ 3 graphs. Discr. Appl. Math. 160(6), 834–865 (2012)MathSciNetzbMATHCrossRefGoogle Scholar
  6. 6.
    Corneil, D.G., Rotics, U.: On the relationship between clique-width and treewidth. SIAM J. Comput. 34(4), 825–847 (2005)MathSciNetzbMATHCrossRefGoogle Scholar
  7. 7.
    Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization problems on graphs of bounded clique-width. Theory Comput. Syst. 33(2), 125–150 (2000)MathSciNetzbMATHCrossRefGoogle Scholar
  8. 8.
    Courcelle, B., Makowsky, J.A., Rotics, U.: On the fixed parameter complexity of graph enumeration problems definable in monadic second-order logic. Discr. Appl. Math. 108(1-2), 23–52 (2001)MathSciNetzbMATHCrossRefGoogle Scholar
  9. 9.
    Courcelle, B., Olariu, S.: Upper bounds to the clique-width of graphs. Discr. Appl. Math. 101(1-3), 77–114 (2000)MathSciNetzbMATHCrossRefGoogle Scholar
  10. 10.
    Courcelle, B., Engelfriet, J., Rozenberg, G.: Context-free handle-rewriting hypergraph grammars. In: Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) Graph Grammars 1990. LNCS, vol. 532, pp. 253–268. Springer, Heidelberg (1991)CrossRefGoogle Scholar
  11. 11.
    Courcelle, B., Engelfriet, J., Rozenberg, G.: Handle-rewriting hypergraph grammars. J. of Computer and System Sciences 46(2), 218–270 (1993)MathSciNetzbMATHCrossRefGoogle Scholar
  12. 12.
    Courcelle, B., Twigg, A.: Constrained-path labellings on graphs of bounded clique-width. Theory Comput. Syst. 47(2), 531–567 (2010)MathSciNetzbMATHCrossRefGoogle Scholar
  13. 13.
    Diestel, R.: Graph Theory, 2nd edn. Graduate Texts in Mathematics, vol. 173. Springer, New York (2000)Google Scholar
  14. 14.
    Alex Dow, P., Korf, R.E.: Best-first search for treewidth. In: Proceedings of the Twenty-Second AAAI Conference on Artificial Intelligence, Vancouver, British Columbia, Canada, July 22-26, pp. 1146–1151. AAAI Press (2007)Google Scholar
  15. 15.
    Eén, N., Sörensson, N.: An extensible SAT-solver. In: Giunchiglia, E., Tacchella, A. (eds.) SAT 2003. LNCS, vol. 2919, pp. 502–518. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  16. 16.
    Fellows, M.R., Rosamond, F.A., Rotics, U., Szeider, S.: Clique-width is NP-complete. SIAM J. Discrete Math. 23(2), 909–939 (2009)MathSciNetzbMATHCrossRefGoogle Scholar
  17. 17.
    Gebser, M., Kaufmann, B., Neumann, A., Schaub, T.: clasp: A conflict-driven answer set solver. In: Baral, C., Brewka, G., Schlipf, J. (eds.) LPNMR 2007. LNCS (LNAI), vol. 4483, pp. 260–265. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  18. 18.
    Gent, I.P.: Arc consistency in SAT. In: van Harmelen, F. (ed.) 15th European Conference on Artificial Intelligence (ECAI 2002), pp. 121–125. IOS Press (2002)Google Scholar
  19. 19.
    Gogate, V., Dechter, R.: A complete anytime algorithm for treewidth. In: Proceedings of the Proceedings of the Twentieth Conference Annual Conference on Uncertainty in Artificial Intelligence (UAI 2004), Arlington, Virginia, pp. 201–208. AUAI Press (2004)Google Scholar
  20. 20.
    Golumbic, M.C., Rotics, U.: On the clique-width of perfect graph classes extended abstract. Internat. J. Found. Comput. Sci. 11(3), 423–443 (2000); Selected papers from In: Widmayer, P., Neyer, G., Eidenbenz, S. (eds.) WG 1999. LNCS, vol. 1665, pp. 135–443. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  21. 21.
    Habib, M., Paul, C.: A survey of the algorithmic aspects of modular decomposition. Computer Science Review 4(1), 41–59 (2010)CrossRefGoogle Scholar
  22. 22.
    Heggernes, P., Meister, D., Papadopoulos, C.: Characterising the linear clique-width of a class of graphs by forbidden induced subgraphs. Discr. Appl. Math. 160(6), 888–901 (2012)MathSciNetzbMATHCrossRefGoogle Scholar
  23. 23.
    Heggernes, P., Meister, D., Rotics, U.: Computing the clique-width of large path powers in linear time via a new characterisation of clique-width. In: Kulikov, A., Vereshchagin, N. (eds.) CSR 2011. LNCS, vol. 6651, pp. 233–246. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  24. 24.
    Hvidevold, E.M., Sharmin, S., Telle, J.A., Vatshelle, M.: Finding good decompositions for dynamic programming on dense graphs. In: Marx, D., Rossmanith, P. (eds.) IPEC 2011. LNCS, vol. 7112, pp. 219–231. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  25. 25.
    Katebi, H., Sakallah, K.A., Markov, I.L.: Conflict anticipation in the search for graph automorphisms. In: Bjørner, N., Voronkov, A. (eds.) LPAR-18 2012. LNCS, vol. 7180, pp. 243–257. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  26. 26.
    Koster, A.M.C.A., Bodlaender, H.L., van Hoesel, S.P.M.: Treewidth: Computational experiments. Electronic Notes in Discrete Mathematics 8, 54–57 (2001)CrossRefGoogle Scholar
  27. 27.
    Lee, C., Lee, J., Oum, S.-I.: Rank-width of random graphs. J. Graph Theory 70(3), 339–347 (2012)MathSciNetzbMATHCrossRefGoogle Scholar
  28. 28.
    McKay, B.D.: Practical graph isomorphism. In: Proceedings of the Tenth Manitoba Conference on Numerical Mathematics and Computing, Vol. I (Winnipeg, Man., 1980), Winnipeg, Man, vol. 30, pp. 45–87 (1981)Google Scholar
  29. 29.
    Oum, S.-I.: Approximating rank-width and clique-width quickly. ACM Transactions on Algorithms 5(1) (2008)Google Scholar
  30. 30.
    Oum, S.-I., Seymour, P.: Approximating clique-width and branch-width. J. Combin. Theory Ser. B 96(4), 514–528 (2006)MathSciNetzbMATHCrossRefGoogle Scholar
  31. 31.
    Samer, M., Veith, H.: Encoding treewidth into SAT. In: Kullmann, O. (ed.) SAT 2009. LNCS, vol. 5584, pp. 45–50. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  32. 32.
    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
  33. 33.
    Cole Smith, J., Ulusal, E., Hicks, I.V.: A combinatorial optimization algorithm for solving the branchwidth problem. Comput. Optim. Appl. 51(3), 1211–1229 (2012)MathSciNetzbMATHCrossRefGoogle Scholar
  34. 34.
    Tamura, N., Taga, A., Kitagawa, S., Banbara, M.: Compiling finite linear CSP into SAT. Constraints 14(2), 254–272 (2009)MathSciNetzbMATHCrossRefGoogle Scholar
  35. 35.
    Walsh, T.: SAT v CSP. In: Dechter, R. (ed.) CP 2000. LNCS, vol. 1894, pp. 441–456. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  36. 36.
    Wanke, E.: k-NLC graphs and polynomial algorithms. Discr. Appl. Math. 54(2-3), 251–266 (1994); Efficient algorithms and partial k-treesGoogle Scholar
  37. 37.
    Weisstein, E.: MathWorld online mathematics resource,

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Marijn J. H. Heule
    • 1
  • Stefan Szeider
    • 2
  1. 1.Department of Computer SciencesThe University of Texas at AustinUSA
  2. 2.Institute of Information SystemsVienna University of TechnologyViennaAustria

Personalised recommendations