Inclusion--Exclusion Algorithms for Counting Set Partitions
Andreas Björklund, Thore Husfeldt · 2006
Given a set U with n elements and a family of subsets S sube 2Uwe show how to count the number of k-partitions S1cup ... cup Sk= U into subsets Siisin S in time 2nnO(1). The only assumption on S is that it can be enumerated in time 2nnO(1). In effect we get exact algorithms in time 2nnO(1)for several well-studied partition problems including domatic number, chromatic number, bounded component spanning forest, partition into Hamiltonian subgraphs, and bin packing. If only polynomial space is available, our algorithms run in time 3nnO(1)if membership in S can be decided in polynomial time. For chromatic number, we present a version that runs in time O(2.2461n) and polynomial space. For domatic number, we present a version that runs in time O(2.8718n). Finally, we present a family of polynomial space approximation algorithms that find a number between chi(G) and [(1 + epsi)chi(G)] in time O(1.2209n+ 2.2461e-epsin)