Table of Contents
Fetching ...

Benchmarking of algorithms for set partitions

Arnav Khinvasara, Alexander Pikovski

TL;DR

This paper tackles the practical enumeration of set partitions by surveying Bell-number calculations and benchmarking four non-recursive enumeration algorithms. It provides $B_n$ approximations, including a Lambert $W$-based asymptotic $B_n^\ast$ with strong accuracy across a broad range of $n$, and a simple upper bound $\overline{B}_n$ for quick estimates. Empirical benchmarks across platforms and compilers show that the Djokic-1989 algorithm delivers the best performance in practice, though runtime depends on the operating system and toolchain. The work offers a clear, implementation-ready recommendation for practitioners needing exhaustive partitioning under computational constraints, and points to future avenues on restricted partitions and Gray-code approaches.

Abstract

Set partitions are arrangements of distinct objects into groups. The problem of listing all set partitions arises in a variety of settings, in particular in combinatorial optimization tasks. After a brief review, we give practical approximate formulas for determining the number of set partitions, both for small and large set sizes. Several algorithms for enumerating all set partitions are reviewed, and benchmarking tests were conducted. The algorithm of Djokic et al. is recommended for practical use.

Benchmarking of algorithms for set partitions

TL;DR

This paper tackles the practical enumeration of set partitions by surveying Bell-number calculations and benchmarking four non-recursive enumeration algorithms. It provides approximations, including a Lambert -based asymptotic with strong accuracy across a broad range of , and a simple upper bound for quick estimates. Empirical benchmarks across platforms and compilers show that the Djokic-1989 algorithm delivers the best performance in practice, though runtime depends on the operating system and toolchain. The work offers a clear, implementation-ready recommendation for practitioners needing exhaustive partitioning under computational constraints, and points to future avenues on restricted partitions and Gray-code approaches.

Abstract

Set partitions are arrangements of distinct objects into groups. The problem of listing all set partitions arises in a variety of settings, in particular in combinatorial optimization tasks. After a brief review, we give practical approximate formulas for determining the number of set partitions, both for small and large set sizes. Several algorithms for enumerating all set partitions are reviewed, and benchmarking tests were conducted. The algorithm of Djokic et al. is recommended for practical use.
Paper Structure (6 sections, 3 equations, 2 tables)