Constant Time Generation of Set Partitions

  • Authors:
  • Shin-Ichiro Kawano;Shin-Ichi Nakano

  • Affiliations:
  • The authors are with the Department of Computer Science, Gunma University, Kiryu-shi, 376-8515 Japan. E-mail: kawano@msc.cs.gunma-u.ac.jp, E-mail: nakano@msc.cs.gunma-u.ac.jp;The authors are with the Department of Computer Science, Gunma University, Kiryu-shi, 376-8515 Japan. E-mail: kawano@msc.cs.gunma-u.ac.jp, E-mail: nakano@msc.cs.gunma-u.ac.jp

  • Venue:
  • IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper we give a simple algorithm to generate all partitions of {1, 2, ..., n} into k non-empty subsets. The number of such partitions is known as the Stirling number of the second kind. The algorithm generates each partition in constant time without repetition. By choosing k = 1, 2, ..., n we can also generate all partitions of {1, 2, ..., n} into subsets. The number of such partitions is known as the Bell number.