# Loopless Gray Code Enumeration and the Tower of Bucharest

@inproceedings{Herter2016LooplessGC,
title={Loopless Gray Code Enumeration and the Tower of Bucharest},
author={Felix Herter and G. Rote},
booktitle={FUN},
year={2016}
}
• Published in FUN 2016
• Computer Science
We give new algorithms for generating all n-tuples over an alphabet of m letters, changing only one letter at a time (Gray codes). These algorithms are based on the connection with variations of the Towers of Hanoi game. Our algorithms are loopless, in the sense that the next change can be determined in a constant number of steps, and they can be implemented in hardware. We also give another family of loopless algorithms that is based on the idea of working ahead and saving the work in a buffer… Expand
7 Citations

#### Figures and Topics from this paper

Loopless Gray code enumeration and the Tower of Bucharest
• Computer Science, Mathematics
• Theor. Comput. Sci.
• 2018
New algorithms for generating all n -tuples over an alphabet of m letters, changing only one letter at a time (Gray codes) are given, based on the connection with variations of the Tower of Hanoi game. Expand
New Bounds for Combinatorial Problems and Quasi-Gray Codes
This thesis provides an algorithm that computes a constant approximation of edit distance in truly sub-quadratic time and gives a construction of a sparse sub-graph that preserves the distance between a designated source and any other vertex as long as the total weight increment of all the edges is bounded by some constant. Expand
A constant-time algorithm for middle levels Gray codes
• Computer Science, Mathematics
• SODA
• 2017
This work presents an algorithm for computing a middle levels Gray code in optimal time and space: each new set in the Gray code is generated in time $\mathcal{O}(1)$ on average, and the required space is $\math Cal O(n)$. Expand
Minimal Dominating Sets in a Tree: Counting, Enumeration, and Extremal Results
• G. Rote
• Computer Science, Mathematics
• ArXiv
• 2019
A semi-automatic way as a kind of "dominant eigenvalue" of a bilinear operation on sixtuples that is derived from the dynamic-programming recursion for computing the number of minimal dominating sets of a tree is obtained. Expand
Optimal Quasi-Gray Codes: Does the Alphabet Matter?
• Computer Science, Mathematics
• ArXiv
• 2017
The results significantly improve on previously known constructions and for the odd-size alphabets the worst-case barrier for space-optimal (non-redundant) quasi-Gray codes with constant number of writes is broken. Expand
Reconfigurable Fault‐tolerance mapping of ternary N‐cubes onto chips
• Computer Science
• Concurr. Comput. Pract. Exp.
• 2020
A linear algorithm is proposed to layout incomplete ternary n‐cube network onto torus NoC, and theoretical analysis demonstrates that the proposed algorithm can reduce the network cost and wirelength, which be conducive to estimate the wire length and chip area. Expand
A Constant-Time Algorithm for Middle Levels Gray Codes
• Mathematics, Computer Science
• Algorithmica
• 2019
This work presents an algorithm for computing a middle levels Gray code in optimal time and space: each new set in the Gray code is generated in time $${{\mathcal {O}}}(1)$$ O ( 1 ) on average, and the required space is  {{\ mathcal { O}}}(n)$O ( n ) . Expand #### References SHOWING 1-10 OF 27 REFERENCES Loopless Gray code enumeration and the Tower of Bucharest • Computer Science, Mathematics • Theor. Comput. Sci. • 2018 New algorithms for generating all n -tuples over an alphabet of m letters, changing only one letter at a time (Gray codes) are given, based on the connection with variations of the Tower of Hanoi game. Expand GENERALIZED GRAY CODES WITH APPLICATIONS It is shown that the Tower of Hanoi problem, in which disks can only be moved to the adjacent pegs, can be solved by enumerating the (3, k)-Gray code, where k is the number of disks to be moved. Expand Remark on algorithm 246: Graycode [Z] The following modifications to Algorithm 246 will generate Gray code for any N, with each code word being generated in a bounded amount of time. Let A be a vector of zeros and ones of length N whichExpand Efficient generation of the binary reflected gray code and its applications • Mathematics, Computer Science • CACM • 1976 Algorithms to generate the n-bit binary reflected Gray code and codewords of fixed weight in that code are presented and applications to the generation of the combinations of n things taken k at a time, the compositions of integers, and the permutations of a multiset are discussed. Expand The Tower of Hanoi with Forbidden Moves • Amir Sapir • Mathematics, Computer Science • Comput. J. • 2004 This work considers a variant of the classical three-peg Tower of Hanoi problem, where limitations on the possible moves among the pegs are imposed, and provides optimal algorithms for the problem for all these graphs, and finds the number of moves each requires. Expand A constant-time algorithm for middle levels Gray codes • Computer Science, Mathematics • SODA • 2017 This work presents an algorithm for computing a middle levels Gray code in optimal time and space: each new set in the Gray code is generated in time$\mathcal{O}(1)$on average, and the required space is$\math Cal O(n)\$. Expand
Loopless Algorithms for Generating Permutations, Combinations, and Other Combinatorial Configurations
The purpose of this work is to find a method for building loopless algorithms for listing combinatorial items, like partitions, permutations, combinations. Gray code, etc. Algorithms for the aboveExpand
The Towers of Hanoi Problem
• Mathematics, Computer Science
• Inf. Process. Lett.
• 1980
In the Towers of Hanoi Problem there are three pegs A, B and C, and n (n 3 1) disks of different diameters, and there is a simple recursive solution, which is used by many texts as an example of recursive programming. Expand
The Tower of Hanoi - Myths and Maths
• Computer Science, Mathematics
• 2013
This is the first comprehensive monograph on the mathematical theory of the solitaire game The Tower of Hanoi which was invented in the 19th century by the French number theorist douard Lucas and contains a thorough, largely self-contained presentation of the essential mathematical facts with complete proofs. Expand
Counting and Enumerating Crossing-free Geometric Graphs
The main idea is to reduce the problem of counting geometric graphs to counting source-sink paths in a directed acyclic graph and achieve an exponential speed-up in the worst-case over any methods in the literature. Expand