Fast algorithms for genegrating integer partitions

We present two new algorithms for generating integer partitions in the standard representation. They generate partitions in lexicographic and anti-lexicographic order, respectively. We prove that both algorithm generate partitions with constant average delay, exclusive of the output. These are the first known algorithms to produce partitions in the standard representation and with constant average delay. The performance of all known integer partition algorithms-is measured and compared, separately for the standard and multiplicity representation. An empirical test shows that both new algorithms are several times faster than any of previously known algorithms for generating unrestricted integer partitions in the standard representation. Moreover, they are faster than any known algorithm for generating integer partition in the multiplicity representation (exclusive of the output).

[1]  L. Dickson History of the Theory of Numbers , 1924, Nature.

[2]  John McKay,et al.  Algorithm 371: Partitions in natural order [A1] , 1970, Commun. ACM.

[3]  JOHN S. WHITE Algorithm 374: Restricted partition generator [A1] , 1970, CACM.

[4]  Robert Sedgewick,et al.  Permutation Generation Methods , 1977, CSUR.

[5]  Teruo Hikita Listing and Counting Subtrees of Equal Size of a Binary Tree , 1983, Inf. Process. Lett..

[6]  Ronald C. Read,et al.  A survey of graph generation techniques , 1981 .

[7]  John S. White Algorithm 373: Number of doubly restricted partitions [A1] , 1970, CACM.

[8]  Anthony E. Trojanowski Ranking and Listing Algorithms for k-ary Trees , 1978, SIAM J. Comput..

[9]  C. L. Liu,et al.  Introduction to Combinatorial Mathematics. , 1971 .

[10]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[11]  Louis Comtet Partitions of Integers , 1974 .

[12]  Ivan Stojmenovic,et al.  A Fast Iterative Algorithm for Generating Set Partitions , 1989, Comput. J..

[13]  Trevor Fenner,et al.  Tree Traversal Related Algorithms for Generating Integer Partitions , 1983, SIAM J. Comput..

[14]  Laura A. Sanchis Counting and generating integer partitions in parallel , 1992, Proceedings ICCI `92: Fourth International Conference on Computing and Information.

[15]  Frank Ruskey,et al.  Generating Binary Trees Lexicographically , 1977, SIAM J. Comput..

[16]  Herbert S. Wilf,et al.  A Method and Two Algorithms on the Theory of Partitions , 1975, J. Comb. Theory, Ser. A.

[17]  Shmuel Zaks,et al.  Generating Trees and Other Combinatorial Objects Lexicographically , 1979, SIAM J. Comput..

[18]  Deborah Evelyn An Introduction to Computational Combinatorics , 1979 .

[19]  John Riordan,et al.  Introduction to Combinatorial Analysis , 1958 .

[20]  Frank Rubin Partition of Integers , 1976, TOMS.

[21]  G. Andrews The Theory of Partitions: Frontmatter , 1976 .

[22]  Frank Stockmal Algorithm 95: Generation of partitions in part-count form , 1962, CACM.

[23]  Mark B. Wells,et al.  Elements of Combinatorial Computing , 2014 .

[24]  John Riordan,et al.  Introduction to Combinatorial Analysis , 1959 .

[25]  Selim G. Akl A Comparison of Combination Generation Methods , 1981, TOMS.

[26]  M. C. Er,et al.  A Fast Algorithm for Generating Set Partitions , 1988, Comput. J..

[27]  Sandra Mitchell Hedetniemi,et al.  Constant Time Generation of Rooted Trees , 1980, SIAM J. Comput..

[28]  Carla D. Savage Gray Code Sequences of Partitions , 1989, J. Algorithms.

[29]  Trevor I. Fenner,et al.  A Binary Tree Representation and Related Algorithms for Generating Partitions , 1980, Comput. J..

[30]  Chak-Kuen Wong,et al.  Ranking and Unranking of B-Trees , 1983, J. Algorithms.

[31]  T. V. Narayana,et al.  An Algorithm for Generating Partitions and Its Applications , 1971, J. Comb. Theory, Ser. A.

[32]  Ivan Stojmenovic,et al.  On Generating B-Trees with Constant Average Delay and in Lexicographic Order , 1994, Inf. Process. Lett..

[33]  Antoine C. Zoghbi Algorithms for generating integer partitions. , 1993 .

[34]  T. C. Hu,et al.  Combinatorial algorithms , 1982 .

[35]  Dominique Roelants van Baronaigien A Loopless Algorithm for Generating Binary Tree Sequences , 1991, Inf. Process. Lett..