Skip to main content
Log in

A Unified Approach to Algorithms Generating Unrestricted and Restricted Integer Compositions and Integer Partitions

  • Published:
Journal of Mathematical Modelling and Algorithms

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.

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. Andrews, G.: The Theory of Partitions. Cambridge University Press, Cambridge (1998)

    MATH  Google Scholar 

  2. Beyer, T., Swinehart, D.: Algorithm 448: number of multiply-restricted partitions. Commun. ACM 16(7), 379 (1973)

    Article  Google Scholar 

  3. Chinn, P., Heubach, S.: Compositions of n with no occurrence of k. Congressus Numerantium 164, 33–51 (2003)

    MATH  MathSciNet  Google Scholar 

  4. Ehrlich, G.: Loopless algorithms for generating permutations, combinations, and other combinatorial configurations. J. ACM 20, 500–513 (1973)

    Article  MATH  MathSciNet  Google Scholar 

  5. Grimaldi, R.: Compositions without the summand 1. Congressus Numerantium 152, 33–43 (2001)

    MATH  MathSciNet  Google Scholar 

  6. Heubach, S., Mansour, T.: Compositions of n with parts in a set. Congressus Numerantium 168, 127–143 (2004)

    MATH  MathSciNet  Google Scholar 

  7. Kimberling, C.: Enumeration of paths, compositions of integers, and Fibonacci numbers. Fibonacci Q. 39(6) (2001)

  8. Kimberling, C.: Path-counting and Fibonacci numbers. Fibonacci Q. 40(4) (2002)

  9. Klingsberg, P.: A gray code for compositions. J. Algorithms 3, 41–44 (1982)

    Article  MATH  MathSciNet  Google Scholar 

  10. Koepf, W.: Hypergeometric Summation: An Algorithmic Approach to Summation and Special Function Identities. Vieweg, Braunschweig (1998)

    MATH  Google Scholar 

  11. Knuth, D., Szwarcfiter, J.: A structured program to generate all topological sorting arrangements. Inf. Process. Lett. 2, 153–157 (1974)

    Article  MATH  Google Scholar 

  12. Knuth, D.: The Stanford Graphbase. ACM, New York (1994)

    MATH  Google Scholar 

  13. Knuth, D.: The Art of Computer Programming. Addison-Wesley, Reading (1997)

    Google Scholar 

  14. Ruskey, F.: Combinatorial Generation. Working Version (1j-CSC 425/520) (2003)

  15. Sanchis, L., Squire, M.: Parallel algorithms for counting and randomly generating integer partitions. J. Parallel Distrib. Comput. 34(1), 29–35 (1996)

    Article  Google Scholar 

  16. Sloan, N.J.A. (ed.): The online encyclopedia of integer sequences. http://www.research.att.com/~njas/sequences (2008)

  17. 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)

    Google Scholar 

  18. Uppuluri, V., Carpenter, J.: A problem of restricted partitions. Nav. Res. Logist. Q. 21(1), 201–205 (2006)

    Article  MathSciNet  Google Scholar 

  19. Walsh, T.: Loop-free sequencing of bounded integer compositions. J. Comb. Math. Comb. Comput. 33, 323–345 (2000)

    MATH  Google Scholar 

  20. White, J.: Algorithm 373: number of doubly restricted partitions[A1]. Commun. ACM 13(2), 120 (1970)

    Article  Google Scholar 

  21. White, J.: Algorithm 374: restricted partition generator[A1]. Commun. ACM 13(2), 120 (1970)

    Article  Google Scholar 

  22. Yamanaka, K., et al.: Constant time generation of integer partitions. IEICE Trans. Fundam. E90-A(6) (2007)

  23. Zoghbi, A., Stojmenovic, I.: Fast algorithms for generating integer partitions. Int. J. Comput. Math. 70, 319–332 (1998)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to John Douglas (J.D.) Opdyke.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10852-009-9116-2

Keywords

Mathematics Subject Classifications (2000)

Navigation