Loop-free Gray code algorithm for the e-restricted growth functions

https://doi.org/10.1016/j.ipl.2011.03.006Get rights and content

Abstract

The subject of Gray codes algorithms for the set partitions of {1,2,,n} had been covered in several works. The first Gray code for that set was introduced by Knuth (1975) [5], later, Ruskey presented a modified version of Knuthʼs algorithm with distance two, Ehrlich (1973) [3] introduced a loop-free algorithm for the set of partitions of {1,2,,n}, Ruskey and Savage (1994) [9] generalized Ehrlichʼs results and give two Gray codes for the set of partitions of {1,2,,n}, and recently, Mansour et al. (2008) [7] gave another Gray code and loop-free generating algorithm for that set by adopting plane tree techniques.

In this paper, we introduce the set of e-restricted growth functions (a generalization of restricted growth functions) and extend the aforementioned results by giving a Gray code with distance one for this set; and as a particular case we obtain a new Gray code for set partitions in restricted growth function representation. Our Gray code satisfies some prefix properties and can be implemented by a loop-free generating algorithm using classical techniques; such algorithms can be used as a practical solution of some difficult problems. Finally, we give some enumerative results concerning the restricted growth functions of order d.

Highlights

► We give a Gray code for the set of e-restricted growth functions. ► We obtain a new Gray code for the set partitions. ► We present a loop-free generating algorithm for our Gray code. ► We give some enumerative results concerning our restricted growth functions.

References (15)

There are more references available in the full text version of this article.

Cited by (7)

  • Gray codes and lexicographical combinatorial generation for nonnesting and sparse nonnesting set partitions

    2015, Theoretical Computer Science
    Citation Excerpt :

    Such theory of Gray codes has a vast range of applications in several areas such as hardware and software testing, thermodynamic, biology and biochemistry; see [3,48] and the references therein. There exist results for (lexicographical) combinatorial generation of several classes of permutations and set partitions, see e.g. [8,20,22,33,35,39,40,50,54,57,58], but so far there are no direct, explicit efficient algorithms for the lexicographical combinatorial generation of noncrossing and nonnesting partitions. Specifically, all known results up to now for generating (not lexicographically) nonnesting partitions use a generating tree approach which often involves passing through Young tableaux or lattice paths, see [10] and the references therein.

  • Efficient generation of restricted growth words

    2013, Information Processing Letters
  • Skeletal program enumeration for rigorous compiler testing

    2017, Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)
View all citing articles on Scopus
View full text