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.
Similar content being viewed by others
References
Bacchelli S., Barcucci E., Grazzini E. and Pergola E. (2004). Exhaustive generation of combinatorial objects by ECO. Acta Inform. 40(8): 585–602
Bose P., Buss J.F. and Lubiw A. (1998). Pattern matching for permutations. Inform. Process. Lett. 65: 277–283
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
Barcucci E., Del Lungo A. and Pergola E. (1999). Random generation of trees and other combinatorial objects. Theoret. Comput. Sci 218: 219–232
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
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
Baril J. and Vajnovszki V. (2004). Gray code for derangements. Discrete Appl. Math. 140: 207–221
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
Brlek S., Duchi E., Pergola E. and Rinaldi S. (2005). On the equivalence problem for succession rules. Discrete Math. 298: 142–154
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
Johnson S.M. (1963). Generation of permutations by adjacent transpositions. Math. Comp. 17: 282–285
Ludman J.E. (1981). Gray code generation for MPSK signals. IEEE Trans. Commun. COM 29: 1519–1522
Pegola E., Pinzani R. and Rinaldi S. (2002). Approximating algebraic function by means of rational ones. Theoret. Comput. Sci. 270: 643–657
Ruskey F. and Proskurowski A. (1990). Generating binary trees by transpositions. J. Algorithms 11: 68–84
Vajnovszki V. (1996). Constant time algorithm for generating binary trees gray codes. Stud. Inform. Control 5(1): 15–21
Vajnovszki V. (2002). Gray visiting Motzkin. Acta Inform. 38: 793–811
Walsh T. (2003). Generating Gray Codes in O(1) worst-case time per word. LNCS 2731: 73–88
Walsh T. (2001). Gray codes for involutions. J. Combin. Math. Combin. Comput. 36: 95–118
West J. (1995). Generating trees and the Catalan and Schröder numbers. Discrete Math. 146: 247–262
West J. (1996). Generating trees and forbidden subsequences. Discrete Math. 157: 363–374
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00236-007-0053-0