Lune

SODA2026顶会

Generating pivot Gray codes for spanning trees of complete graphs in constant amortized time

Bowie Liu, Dennis Wong, Chan-Tong Lam, Sio-Kei Im

2026年份
1被引次数

摘要

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 O(n2)O(n^2) space. In addition, we provide a novel proof of Cayley’s formula, nn−2n^{n-2}, 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 nn vertices, achieving O(n2)O(n^2) time per tree using O(n2)O(n^2) space. For specific graph classes, the algorithm can be optimized to generate edge-exchange Gray codes for spanning trees in constant amortized time per tree for complete bipartite graphs, O(n)O(n)-amortized time per tree for fan graphs, and O(n)O(n)-amortized time per tree for wheel graphs, all using O(n2)O(n^2) space.

问问这篇 Paper

智能体会读完全文。

Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。

可以从这些问题问起

智能体调用

Luneget_paper_fulltext

在 Lune 里问

免费开始,无需绑卡

它引用的顶会 Paper1

相关 Paper

黄昏的海面,两侧是细线勾勒的悬崖