Gray Codes and Symmetric Chains

Authors Petr Gregor, Sven Jäger, Torsten Mütze, Joe Sawada, Kaja Wille

Thumbnail PDF


  • Filesize: 0.63 MB
  • 14 pages

Document Identifiers

Author Details

Petr Gregor
  • Department of Theoretical Computer Science and Mathematical Logic, Charles University, Prague, Czech Republic
Sven Jäger
  • Institut für Mathematik, Technische Universität Berlin, Germany
Torsten Mütze
  • Institut für Mathematik, Technische Universität Berlin, Germany
Joe Sawada
  • School of Computer Science, University of Guelph, Canada
Kaja Wille
  • Institut für Mathematik, Technische Universität Berlin, Germany

Cite AsGet BibTex

Petr Gregor, Sven Jäger, Torsten Mütze, Joe Sawada, and Kaja Wille. Gray Codes and Symmetric Chains. In 45th International Colloquium on Automata, Languages, and Programming (ICALP 2018). Leibniz International Proceedings in Informatics (LIPIcs), Volume 107, pp. 66:1-66:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2018)


We consider the problem of constructing a cyclic listing of all bitstrings of length 2n+1 with Hamming weights in the interval [n+1-l,n+l], where 1 <= l <= n+1, by flipping a single bit in each step. This is a far-ranging generalization of the well-known middle two levels problem (l=1). We provide a solution for the case l=2 and solve a relaxed version of the problem for general values of l, by constructing cycle factors for those instances. Our proof uses symmetric chain decompositions of the hypercube, a concept known from the theory of posets, and we present several new constructions of such decompositions. In particular, we construct four pairwise edge-disjoint symmetric chain decompositions of the n-dimensional hypercube for any n >= 12.

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Combinatorics
  • Mathematics of computing → Graph theory
  • Gray code
  • Hamilton cycle
  • hypercube
  • poset
  • symmetric chain


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. M. Aigner. Lexicographic matching in Boolean algebras. J. Combin. Theory Ser. B, 14:187-194, 1973. Google Scholar
  2. B. Bollobás. Combinatorics: set systems, hypergraphs, families of vectors and combinatorial probability. Cambridge University Press, Cambridge, 1986. Google Scholar
  3. B. Bultena and F. Ruskey. Transition restricted Gray codes. Electron. J. Combin., 3(1):Paper 11, 11 pp., 1996. URL:
  4. N. de Bruijn, C. van Ebbenhorst Tengbergen, and D. Kruyswijk. On the set of divisors of a number. Nieuw Arch. Wiskunde (2), 23:191-193, 1951. Google Scholar
  5. D. Dimitrov, T. Dvořák, P. Gregor, and R. Škrekovski. Linear time construction of a compressed Gray code. European J. Combin., 34(1):69-81, 2013. URL:
  6. M. El-Hashash and A. Hassan. On the Hamiltonicity of two subgraphs of the hypercube. In Proceedings of the Thirty-second Southeastern International Conference on Combinatorics, Graph Theory and Computing (Baton Rouge, LA, 2001), volume 148, pages 7-32, 2001. Google Scholar
  7. L. Goddyn and P. Gvozdjak. Binary Gray codes with long bit runs. Electron. J. Combin., 10:Paper 27, 10 pp., 2003. URL:
  8. F. Gray. Pulse code communication, 1953. March 17, 1953 (filed Nov. 1947). U.S. Patent 2,632,058. Google Scholar
  9. C. Greene and D. J. Kleitman. Strong versions of Sperner’s theorem. J. Combin. Theory Ser. A, 20(1):80-88, 1976. Google Scholar
  10. P. Gregor, S. Jäger, T. Mütze, J. Sawada, and K. Wille. Gray codes and symmetric chains. arXiv:1802.06021. Preprint version of the present article, 2018. Google Scholar
  11. P. Gregor and T. Mütze. Trimming and gluing Gray codes. Theoret. Comput. Sci., 714:74-95, 2018. URL:
  12. P. Gregor, T. Mütze, and J. Nummenpalo. A short proof of the middle levels theorem. To appear in Discrete Analysis. arXiv:1710.08249, 2018. Google Scholar
  13. P. Gregor and R. Škrekovski. On generalized middle-level problem. Inform. Sci., 180(12):2448-2457, 2010. URL:
  14. J. Griggs, C. E. Killian, and C. D. Savage. Venn diagrams and symmetric chain decompositions in the Boolean lattice. Electron. J. Combin., 11(1):Paper 2, 30 pp., 2004. URL:
  15. A. E. Holroyd. Perfect snake-in-the-box codes for rank modulation. IEEE Trans. Inform. Theory, 63(1):104-110, 2017. URL:
  16. A. E. Holroyd, F. Ruskey, and A. Williams. Shorthand universal cycles for permutations. Algorithmica, 64(2):215-245, 2012. URL:
  17. J. R. Johnson. Universal cycles for permutations. Discrete Math., 309(17):5264-5270, 2009. URL:
  18. J. R. Johnson. An inductive construction for Hamilton cycles in Kneser graphs. Electron. J. Combin., 18(1):Paper 189, 12 pp., 2011. Google Scholar
  19. H. A. Kierstead and W. T. Trotter. Explicit matchings in the middle levels of the Boolean lattice. Order, 5(2):163-171, 1988. URL:
  20. D. E. Knuth. The Art of Computer Programming. Vol. 4A. Combinatorial Algorithms. Part 1. Addison-Wesley, Upper Saddle River, NJ, 2011. Google Scholar
  21. S. Locke and R. Stong. Problem 10892: Spanning cycles in hypercubes. Amer. Math. Monthly, 110:440-441, 2003. Google Scholar
  22. T. Mütze. Proof of the middle levels conjecture. Proc. Lond. Math. Soc., 112(4):677-713, 2016. URL:
  23. T. Mütze and J. Nummenpalo. A constant-time algorithm for middle levels Gray codes. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2238-2253. SIAM, Philadelphia, PA, 2017. URL:
  24. T. Mütze, J. Nummenpalo, and B. Walczak. Sparse Kneser graphs are Hamiltonian. To appear in Proceedings of the 50th Annual ACM Symposium on the Theory of Computing (STOC 2018). arXiv:1711.01636, 2018. Google Scholar
  25. O. Pikhurko. On edge decompositions of posets. Order, 16(3):231-244 (2000), 1999. URL:
  26. F. Ruskey, C. D. Savage, and S. Wagon. The search for simple symmetric Venn diagrams. Notices Amer. Math. Soc., 53(11):1304-1312, 2006. Google Scholar
  27. C. D. Savage. Long cycles in the middle two levels of the Boolean lattice. Ars Combin., 35(A):97-108, 1993. Google Scholar
  28. C. D. Savage. A survey of combinatorial Gray codes. SIAM Rev., 39(4):605-629, 1997. URL:
  29. C. D. Savage and P. Winkler. Monotone Gray codes and the middle levels problem. J. Combin. Theory Ser. A, 70(2):230-248, 1995. URL:
  30. J. Sawada and A. Williams. A Hamilton path for the sigma-tau problem. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018, pages 568-575, 2018. URL:
  31. J. Shearer and D. J. Kleitman. Probabilities of independent choices being ordered. Stud. Appl. Math., 60(3):271-276, 1979. URL:
  32. H. Spink. Orthogonal symmetric chain decompositions of hypercubes. arXiv:1706.08545, June 2017. Google Scholar
  33. N. Streib and W. T. Trotter. Hamiltonian cycles and symmetric chains in Boolean lattices. Graphs Combin., 30(6):1565-1586, 2014. URL:
  34. I. N. Suparta and A. J. van Zanten. A construction of Gray codes inducing complete graphs. Discrete Math., 308(18):4124-4132, 2008. URL:
  35. G. C. Tootill. The use of cyclic permuted codes in relay counting circuits. Proceedings IEE, Part B Supplement, 103, 1956. Google Scholar
  36. D. E. White and S. G. Williamson. Recursive matching algorithms and linear orders on the subset lattice. J. Combin. Theory Ser. A, 23(2):117-127, 1977. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail