70 research outputs found
A constant-time algorithm for middle levels Gray codes
For any integer a middle levels Gray code is a cyclic listing of
all -element and -element subsets of such that
any two consecutive subsets differ in adding or removing a single element. The
question whether such a Gray code exists for any has been the subject
of intensive research during the last 30 years, and has been answered
affirmatively only recently [T. M\"utze. Proof of the middle levels conjecture.
Proc. London Math. Soc., 112(4):677--713, 2016]. In a follow-up paper [T.
M\"utze and J. Nummenpalo. An efficient algorithm for computing a middle levels
Gray code. To appear in ACM Transactions on Algorithms, 2018] this existence
proof was turned into an algorithm that computes each new set in the Gray code
in time on average. In this work we present an algorithm for
computing a middle levels Gray code in optimal time and space: each new set is
generated in time on average, and the required space is
A constant-time algorithm for middle levels Gray codes
For any integer~, a \emph{middle levels Gray code} is a cyclic listing of all -element and -element subsets of such that any two consecutive sets differ in adding or removing a single element.
The question whether such a Gray code exists for any~ has been the subject of intensive research during the last 30 years, and has been answered affirmatively only recently [T.~M\"utze. Proof of the middle levels conjecture. \textit{Proc. London Math. Soc.}, 112(4):677--713, 2016].
In a follow-up paper [T.~M\"utze and J.~Nummenpalo. An efficient algorithm for computing a middle levels Gray code. \textit{ACM Trans. Algorithms}, 14(2):29~pp., 2018] this existence proof was turned into an algorithm that computes each new set in the Gray code in time~\cO(n) on average.
In this work we present an algorithm for computing a middle levels Gray code in optimal time and space: each new set is generated in time~\cO(1), and the required space is~\cO(n)
Generation, Ranking and Unranking of Ordered Trees with Degree Bounds
We study the problem of generating, ranking and unranking of unlabeled
ordered trees whose nodes have maximum degree of . This class of trees
represents a generalization of chemical trees. A chemical tree is an unlabeled
tree in which no node has degree greater than 4. By allowing up to
children for each node of chemical tree instead of 4, we will have a
generalization of chemical trees. Here, we introduce a new encoding over an
alphabet of size 4 for representing unlabeled ordered trees with maximum degree
of . We use this encoding for generating these trees in A-order with
constant average time and O(n) worst case time. Due to the given encoding, with
a precomputation of size and time O(n^2) (assuming is constant), both
ranking and unranking algorithms are also designed taking O(n) and O(nlogn)
time complexities.Comment: In Proceedings DCM 2015, arXiv:1603.0053
On the central levels problem
The \emph{central levels problem} asserts that the subgraph of the -dimensional hypercube induced by all bitstrings with at least many 1s and at most many 1s, i.e., the vertices in the middle levels, has a Hamilton cycle for any and .
This problem was raised independently by Buck and Wiedemann, Savage, Gregor and {\v{S}}krekovski, and by Shen and Williams, and it is a common generalization of the well-known \emph{middle levels problem}, namely the case , and classical binary Gray codes, namely the case .
In this paper we present a general constructive solution of the central levels problem.
Our results also imply the existence of optimal cycles through any sequence of consecutive levels in the -dimensional hypercube for any and .
Moreover, extending an earlier construction by Streib and Trotter, we construct a Hamilton cycle through the -dimensional hypercube, , that contains the symmetric chain decomposition constructed by Greene and Kleitman in the 1970s, and we provide a loopless algorithm for computing the corresponding Gray code
- …