Simple constant amortized time generation of fixed length numeric partitions

  • Authors:
  • John M. Boyer

  • Affiliations:
  • 3917 Onyx Place, Victoria, BC V8P 424, Canada

  • Venue:
  • Journal of Algorithms
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

A numeric partition of n of fixed length k is an unordered sequence of k positive integers that sum to n. A recent implementation of Savage's constant amortized time (CAT) algorithm for generating numeric partitions in a minimal change order required over twenty-five pages of C code. According to Ruskey, there is no simple lexicographic algorithm that generates fixed length numeric partitions in the natural representation in constant amortized time (CAT) per partition. This paper describes such an algorithm and proves it is a CAT algorithm. As a byproduct, CAT generators are given for several other classes of numerical partitions, some of which have no prior CAT algorithm.