Abstract
An original algorithm is presented that generates both restricted integer compositions and restricted integer partitions that can be constrained simultaneously by (a) upper and lower bounds on the number of summands (“parts”) allowed, and (b) upper and lower bounds on the values of those parts. The algorithm can implement each constraint individually, or no constraints to generate unrestricted sets of integer compositions or partitions. The algorithm is recursive, based directly on very fundamental mathematical constructs, and given its generality, reasonably fast with good time complexity. A general, closed form solution to the open problem of counting the number of integer compositions doubly restricted in this manner also is presented; its formulaic link to an analogous solution for counting doubly-restricted integer partitions is shown to mirror the algorithmic link between these two objects.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Andrews, G.: The Theory of Partitions. Cambridge University Press, Cambridge (1998)
Beyer, T., Swinehart, D.: Algorithm 448: number of multiply-restricted partitions. Commun. ACM 16(7), 379 (1973)
Chinn, P., Heubach, S.: Compositions of n with no occurrence of k. Congressus Numerantium 164, 33–51 (2003)
Ehrlich, G.: Loopless algorithms for generating permutations, combinations, and other combinatorial configurations. J. ACM 20, 500–513 (1973)
Grimaldi, R.: Compositions without the summand 1. Congressus Numerantium 152, 33–43 (2001)
Heubach, S., Mansour, T.: Compositions of n with parts in a set. Congressus Numerantium 168, 127–143 (2004)
Kimberling, C.: Enumeration of paths, compositions of integers, and Fibonacci numbers. Fibonacci Q. 39(6) (2001)
Kimberling, C.: Path-counting and Fibonacci numbers. Fibonacci Q. 40(4) (2002)
Klingsberg, P.: A gray code for compositions. J. Algorithms 3, 41–44 (1982)
Koepf, W.: Hypergeometric Summation: An Algorithmic Approach to Summation and Special Function Identities. Vieweg, Braunschweig (1998)
Knuth, D., Szwarcfiter, J.: A structured program to generate all topological sorting arrangements. Inf. Process. Lett. 2, 153–157 (1974)
Knuth, D.: The Stanford Graphbase. ACM, New York (1994)
Knuth, D.: The Art of Computer Programming. Addison-Wesley, Reading (1997)
Ruskey, F.: Combinatorial Generation. Working Version (1j-CSC 425/520) (2003)
Sanchis, L., Squire, M.: Parallel algorithms for counting and randomly generating integer partitions. J. Parallel Distrib. Comput. 34(1), 29–35 (1996)
Sloan, N.J.A. (ed.): The online encyclopedia of integer sequences. http://www.research.att.com/~njas/sequences (2008)
Stojmenovic, I.: Generating all and random instances of a combinatorial object. In: Nayak, A., Stojmenovic, I. (eds.) Handbook of Applied Algorithms: Solving Scientific, Engineering and Practical Problems. Wiley, New York (2008)
Uppuluri, V., Carpenter, J.: A problem of restricted partitions. Nav. Res. Logist. Q. 21(1), 201–205 (2006)
Walsh, T.: Loop-free sequencing of bounded integer compositions. J. Comb. Math. Comb. Comput. 33, 323–345 (2000)
White, J.: Algorithm 373: number of doubly restricted partitions[A1]. Commun. ACM 13(2), 120 (1970)
White, J.: Algorithm 374: restricted partition generator[A1]. Commun. ACM 13(2), 120 (1970)
Yamanaka, K., et al.: Constant time generation of integer partitions. IEICE Trans. Fundam. E90-A(6) (2007)
Zoghbi, A., Stojmenovic, I.: Fast algorithms for generating integer partitions. Int. J. Comput. Math. 70, 319–332 (1998)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Opdyke, J.D.(. A Unified Approach to Algorithms Generating Unrestricted and Restricted Integer Compositions and Integer Partitions. J Math Model Algor 9, 53–97 (2010). https://doi.org/10.1007/s10852-009-9116-2
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10852-009-9116-2
Keywords
- Integer compositions
- Integer partitions
- Bounded compositions
- Bounded partitions
- Pascal’s triangle
- Fibonacci