Skip to main content

Enumerating Perfect Matchings in n-Cubes


The perfect matchings in the n-cube have earlier been enumerated for n ≤ 6. A dynamic programming approach is here used to obtain the total number of perfect matchings in the 7-cube, which is 391 689 748 492 473 664 721 077 609 089. The number of equivalence classes of perfect matchings is further shown to be 336 in the 5-cube, 356 788 059 in the 6-cube and 607 158 046 495 120 886 820 621 in the 7-cube. The techniques used can be generalized to arbitrary bipartite and general graphs.

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


  1. 1.

    Clark, L.H., George, J.C., Porter, T.D.: On the number of 1-factors in the n-cube. Congr. Numer. 127, 67–69 (1997)

    MathSciNet  MATH  Google Scholar 

  2. 2.

    Dinitz, J.H., Garnick, D.K., McKay, B.D.: There are 526,915,620 nonisomorphic one-factorizations of K 12. J. Comb. Des. 2, 273–285 (1994)

    MathSciNet  Article  MATH  Google Scholar 

  3. 3.

    Fukuda, K., Matsui, T.: Finding all the perfect matchings in bipartite graphs. Appl. Math. Lett. 7, 15–18 (1994)

    MathSciNet  Article  MATH  Google Scholar 

  4. 4.

    Godsil, C.D.: Algebraic Combinatorics. Chapman & Hall, New York (1993)

    MATH  Google Scholar 

  5. 5.

    Graham, N., Harary, F.: The number of perfect matchings in a hypercube. Appl. Math. Lett. 1, 45–48 (1988)

    MathSciNet  Article  Google Scholar 

  6. 6.

    Haanpää, H., Östergård, P.R.J.: Counting Hamiltonian cycles in bipartite graphs.Math. Comput. (2012, in press)

  7. 7.

    Hulpke, A., Kaski, P., Östergård P.R.J.: The number of Latin squares of order 11. Math. Comput. 80, 1197–1219 (2011)

    Article  MATH  Google Scholar 

  8. 8.

    Kaski, P., Östergård, P.R.J.: There are 1,132,835,421,602,062,347 nonisomorphic one-factorizations of K 14. J. Comb. Des. 17, 147–159 (2009)

    Article  MATH  Google Scholar 

  9. 9.

    Kaski, P., Pottonen, O.: Libexact user’s guide, version 1.0. Technical Report HIIT TR 2008-1, Helsinki Institute for Information Technology HIIT, Helsinki (2008)

  10. 10.

    Lovász, L., Plummer, M.D.: Matching Theory. North-Holland, Amsterdam (1986)

    MATH  Google Scholar 

  11. 11.

    Lundow, P.H.: Computation of matching polynomials and the number of 1-factors in polygraphs. Research Reports No. 12, Department of Mathematics, Umeå University (1996)

  12. 12.

    McKay, B.D., Wanless, I.M.: On the number of Latin squares. Ann. Comb. 9, 335–344 (2005)

    MathSciNet  Article  MATH  Google Scholar 

  13. 13.

    Östergård, P.R.J.: Classification of binary constant weight codes. IEEE Trans. Inf. Theory 56, 3779–3785 (2010)

    Article  Google Scholar 

  14. 14.

    Propp, J.: Enumeration of matchings: problems and progress. In: Billera, L.J., Björner, A., Greene, C., Simion, R.E., Stanley, R.P. (eds.) New Perspectives in Algebraic Combinatorics, pp. 255–291. Cambridge University Press, Cambridge (1999)

    Google Scholar 

  15. 15.

    Uno, T.: Algorithms for enumerating all perfect, maximum and maximal matchings in bipartite graphs. In: Leong, H.W., Imai, H., Jain, S. (eds.) Algorithms and Computation. LNCS 1350, pp. 92–101. Springer-Verlag, Berlin (1997)

    Google Scholar 

  16. 16.

    Uno, T.: A fast algorithm for enumerating bipartite perfect matchings. In: Eades, P., Takaoka, T. (eds.) Algorithms and Computation. LNCS 2223, pp. 367–379. Springer-Verlag, Berlin (2001)

    Google Scholar 

  17. 17.

    Valiant, L.G.: The complexity of computing the permanent. Theor. Comp. Sci. 56, 189–201 (1979)

    MathSciNet  Article  Google Scholar 

Download references

Author information



Corresponding author

Correspondence to Ville H. Pettersson.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Östergård, P.R.J., Pettersson, V.H. Enumerating Perfect Matchings in n-Cubes. Order 30, 821–835 (2013).

Download citation


  • Perfect matching
  • N-cube
  • Dynamic programming
  • Enumeration