Abstract
This paper presents a new algorithm that arrives at a generalized solution for the generation of restricted weak compositions of n-parts. In particular, this generalized algorithm covers many commonly sought compositions such as bounded compositions, restricted compositions, weak compositions, and restricted part compositions. Introduced is an algorithm for generating generalized types of restricted weak compositions called first-order, and second-order restricted weak compositions.
Similar content being viewed by others
References
Bacchelli, S., Barcucci, E., Grazzini, E., Pergola, E.: Exhaustive generation of combinatorial objects by eco. Acta Inform. 40, 585–602 (2004)
Bernini, A., Grazzini, E., Pergola, E., Pinzani, R.: A general exhaustive generation algorithm for gray structures. Acta Inform. 44, 361–376 (2007)
Gray, F.: Pulse code communication. US Patent 2632058 (1953)
Heubach, S., Mansour, T.: Combinatorics of Compositions and Words. CRC Press (2010)
Klingsberg, P.: A gray code for compositions. J. Algorithms 3(1), 41–44 (1981)
Knuth, D.: The Art of Computer Programming, vol. 4. Addison Wesley (2005)
Mansour, T., Nassar, G.: Gray codes, loopless algorithm and partitions. J. Math. Model. Algor. 7, 291–310 (2008)
Mansour, T., Nassar, G.: Loop-free gray code algorithms for the set of compositions. J. Math. Model. Algor. 9, 343–345 (2010)
Opdyke, J.: A unified approach to algorithms generating unrestricted and restricted integer compositions and integer partitions. Journal of Mathematical Modelling and Algorithms 9(1), 53–97 (2010)
Reingold, E.M., Nievergelt, J., Deo, N.: Combinatorial algorithms: theory and practice. Prentice-Hall Inc. (1977)
Vajnovszki, V., Vernay, R.: Restricted compositions and permutations: from old to new gray codes. Inf. Process. Lett. 111(13), 650–655 (2011)
Walsh, T.: Loop-free sequencing of bounded integer compositions. J. Comb. Math. Comb. Comput. 33, 323–345 (2000)
Walsh, T.: Generating gray codes in o(1) worse-case time per word. Discret. Math. Theor. Comput. Sci. 2731, 73–88 (2003)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Page, D.R. Generalized Algorithm for Restricted Weak Composition Generation. J Math Model Algor 12, 345–372 (2013). https://doi.org/10.1007/s10852-012-9194-4
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10852-012-9194-4
Keywords
- Restricted compositions
- Restricted weak compositions
- Generalized algorithms
- Generalized compositions
- Generation algorithms
- Enumeration algorithms
- Integer compositions
- Weak integer compositions
- Enumeration
- Combinatorics
- Computational number theory