Skip to main content
Log in

A general exhaustive generation algorithm for Gray structures

  • Original article
  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

Starting from a succession rule for Catalan numbers, we define a procedure for encoding and listing the objects enumerated by these numbers such that two consecutive codes of the list differ only by one digit. The Gray code we obtain can be generalized to all the succession rules with the stability property: each label (k) has in its productions two labels c 1 and c 2, always in the same position, regardless of k. Because of this link, we define Gray structures as the sets of those combinatorial objects whose construction can be encoded by a succession rule with the stability property. This property is a characteristic that can be found among various succession rules, such as the finite, factorial or transcendental ones. We also indicate an algorithm which is a very slight modification of Walsh’s one, working in O(1) worst-case time per word for generating Gray codes.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Bacchelli S., Barcucci E., Grazzini E. and Pergola E. (2004). Exhaustive generation of combinatorial objects by ECO. Acta Inform. 40(8): 585–602

    Article  MATH  Google Scholar 

  2. Bose P., Buss J.F. and Lubiw A. (1998). Pattern matching for permutations. Inform. Process. Lett. 65: 277–283

    Article  Google Scholar 

  3. Banderier C., Bousquet-Mélou M., Denise A., Flajolet P., Gardy D. and Gouyou-Beauchamps D. (2002). Generating functions for generating trees. Discrete Math. 246: 29–55

    Article  MATH  Google Scholar 

  4. Barcucci E., Del Lungo A. and Pergola E. (1999). Random generation of trees and other combinatorial objects. Theoret. Comput. Sci 218: 219–232

    Article  MATH  Google Scholar 

  5. Barcucci E., Del Lungo A., Pergola E. and Pinzani R. (1999). ECO: a methodology for the enumeration of combinatorial objects,. J. Differ. Equ. Appl. 5: 435–490

    Article  MATH  Google Scholar 

  6. Barcucci E., Del Lungo A., Pergola E. and Pinzani R. (1999). Some combinatorial interpretations of q-analogs of Schröder numbers. Ann. Combin. 3: 171–190

    Article  MATH  Google Scholar 

  7. Baril J. and Vajnovszki V. (2004). Gray code for derangements. Discrete Appl. Math. 140: 207–221

    Article  MATH  Google Scholar 

  8. Bitner J.R., Ehrlich G. and Reingold E.M. (1976). Efficient generation of the binary reflected Gray code and its applications. Commun. ACM 19: 517–521

    Article  MATH  Google Scholar 

  9. Brlek S., Duchi E., Pergola E. and Rinaldi S. (2005). On the equivalence problem for succession rules. Discrete Math. 298: 142–154

    Article  MATH  Google Scholar 

  10. Chung F.R.K., Graham R.L., Hoggat V.E. and Kleiman M. (1978). The number of Baxter permutations. J. Combin. Theory Ser. A 24: 382–394

    Article  MATH  Google Scholar 

  11. Johnson S.M. (1963). Generation of permutations by adjacent transpositions. Math. Comp. 17: 282–285

    Article  MATH  Google Scholar 

  12. Ludman J.E. (1981). Gray code generation for MPSK signals. IEEE Trans. Commun. COM 29: 1519–1522

    Article  Google Scholar 

  13. Pegola E., Pinzani R. and Rinaldi S. (2002). Approximating algebraic function by means of rational ones. Theoret. Comput. Sci. 270: 643–657

    Article  Google Scholar 

  14. Ruskey F. and Proskurowski A. (1990). Generating binary trees by transpositions. J. Algorithms 11: 68–84

    Article  MATH  Google Scholar 

  15. Vajnovszki V. (1996). Constant time algorithm for generating binary trees gray codes. Stud. Inform. Control 5(1): 15–21

    Google Scholar 

  16. Vajnovszki V. (2002). Gray visiting Motzkin. Acta Inform. 38: 793–811

    Article  MATH  Google Scholar 

  17. Walsh T. (2003). Generating Gray Codes in O(1) worst-case time per word. LNCS 2731: 73–88

    Google Scholar 

  18. Walsh T. (2001). Gray codes for involutions. J. Combin. Math. Combin. Comput. 36: 95–118

    MATH  Google Scholar 

  19. West J. (1995). Generating trees and the Catalan and Schröder numbers. Discrete Math. 146: 247–262

    Article  MATH  Google Scholar 

  20. West J. (1996). Generating trees and forbidden subsequences. Discrete Math. 157: 363–374

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Elisa Pergola.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bernini, A., Grazzini, E., Pergola, E. et al. A general exhaustive generation algorithm for Gray structures. Acta Informatica 44, 361–376 (2007). https://doi.org/10.1007/s00236-007-0053-0

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00236-007-0053-0

Keywords

Navigation