Simple combinatorial Gray codes constructed by reversing sublists
We present three related results about simple combinatorial Gray codes constructed recursively by reversing certain sublists. First, we show a bijection between the list of compositions of Knuth and the list of combinations of Eades and McKay. Secondly, we provide a short description of a list of combinations satisfying a more restrictive closeness criteria of Chase. Finally, we develop a new, simply described, Gray code list of the partitions of a set into a fixed number of blocks, as represented by restricted growth sequences. In each case the recursive definition of the list is easily translatable into an algorithm for generating the list in time proportional to the number of elements in the list; i.e., each object is produced in O(1) amortized time by the algorithm.
Unable to display preview. Download preview PDF.
- [Ch]P.J. Chase, Combination Generation and Graylex Ordering, Congressus Numerantium, 69 (1989) 215–242.Google Scholar
- [EaMc]P. Eades and B. McKay, An Algorithm for Generating Subsets of Fixed Size with a Strong Minimal Change Property, Information Processing Letters, 19 (1984) 131–133.Google Scholar
- [FiRe]J.A. Fill and E.M. Reingold, Solutions Manual for Combinatorial Algorithms: Theory and Practice, Prentice-Hall, 1977.Google Scholar
- [ReNiDe]E.M. Reingold, J. Nievergelt and N. Deo, Combinatorial Algorithms, Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1977.Google Scholar
- [Wi]Herbert S. Wilf, Combinatorial Algorithms: An Update, SIAM CBMS-55, 1989.Google Scholar