Generating pivot Gray codes for spanning trees of complete graphs in constant amortized time
Bowie Liu, Dennis Wong, Chan-Tong Lam, Sio-Kei Im

TL;DR
This paper introduces a novel pivot Gray code for spanning trees of complete graphs, enabling efficient enumeration with constant amortized time, and extends the approach to various graph classes.
Contribution
It presents the first pivot Gray code for complete graph spanning trees, solving an open problem and providing a recursive, constant amortized time generation algorithm.
Findings
Generates all spanning trees with single-edge pivots in constant amortized time.
Provides a new proof of Cayley's formula for complete graphs.
Extends the algorithm to various graph classes with optimized time complexity.
Abstract
We present the first known pivot Gray code for spanning trees of complete graphs, listing all spanning trees such that consecutive trees differ by pivoting a single edge around a vertex. This pivot Gray code thus addresses an open problem posed by Knuth in The Art of Computer Programming, Volume 4 (Exercise 101, Section 7.2.1.6, [Knuth, 2011]), rated at a difficulty level of 46 out of 50, and imposes stricter conditions than existing revolving-door or edge-exchange Gray codes for spanning trees of complete graphs. Our recursive algorithm generates each spanning tree in constant amortized time using space. In addition, we provide a novel proof of Cayley's formula, , for the number of spanning trees in a complete graph, derived from our recursive approach. We extend the algorithm to generate edge-exchange Gray codes for general graphs with vertices, achieving…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
