Fourier meets möbius: fast subset convolution

Andreas Björklund, Thore Husfeldt, Petteri Kaski, Mikko Koivisto

TL;DR

This paper introduces a breakthrough algorithm for subset convolution, reducing the computational complexity from the long-standing $O(3^n)$ to a much faster $O(n^2 2^n)$. By combining the Fast Möbius Transform with a "ranked" bookkeeping trick, the authors provide a general-purpose tool that exponentially speeds up classic hard problems like the Steiner Tree problem and various graph partitioning tasks.

What Problem Does This Paper Address?

Many combinatorial problems require iterating over subsets. A common pattern is the subset convolution: given two functions $f$ and $g$ defined on subsets of an $n$-element set, we want to compute a new function $h$ where: $$h(S) = \sum_{T \subseteq S} f(T)g(S \setminus T)$$ This looks remarkably like a standard convolution (like those solved by Fast Fourier Transforms), but with a catch: the subsets $T$ and $S \setminus T$ must be disjoint and their union must exactly equal $S$.

Until this paper, the standard way to solve this was a direct "brute force" iteration over all pairs of subsets, which takes $O(3^n)$ time. While $3^n$ is better than $4^n$, it still grows very quickly. For $n=25$, $3^n$ is about 847 billion operations, while $n^2 2^n$ is only about 21 billion—a massive practical difference.

Methods

The authors bridge the gap between "natural" group-theoretic convolutions (like XOR convolution, which uses the Walsh-Hadamard Transform) and the "truncated" nature of subset convolution.

The key innovation is the Ranked Möbius Transform.

  1. Ranking: Instead of just transforming the function $f(S)$, they create a "ranked" version $f(k, S)$ which is equal to $f(S)$ if the size of $S$ is $k$, and $0$ otherwise.
  2. Fast Möbius Transform (FMT): They apply the FMT to this ranked function. The FMT is the subset-lattice equivalent of the FFT, running in $O(n 2^n)$.
  3. Convolution over Rank: For every subset $X$, they perform a small polynomial-like convolution on the rank index $k$. This ensures that when we combine two subsets, their sizes add up correctly ($|T| + |U| = |S|$). This "size-tracking" is what enforces the disjointness required by the subset convolution.
  4. Inversion: Finally, they apply the inverse Ranked Möbius Transform to get the result.

Datasets

As a theoretical computer science paper, it does not use empirical datasets. Instead, it evaluates the algorithm's performance through computational complexity analysis on classic algorithmic benchmarks:

  • The Minimum Steiner Tree Problem: Finding the shortest path network connecting a set of terminal nodes in a graph.
  • Graph Partitioning: Problems like $k$-coloring or domatic partitioning.
  • Hypergraph Problems: Specifically the Minimum Connected Spanning Subhypergraph (MCSH).

Key Insights and Ideas

  • The "Rank" Trick: The most elegant insight is that subset convolution is essentially a standard Möbius convolution where you enforce a "size constraint." By adding an extra dimension for the size (rank) of the subset, you can use fast transform methods that otherwise wouldn't respect the disjointness of the subsets.
  • Semiring Embedding: Subset convolution is naturally defined over rings (where you can add and multiply). However, optimization problems often use "min-sum" semirings (where "addition" is taking the minimum and "multiplication" is addition). The authors show you can "embed" these optimization problems into a standard ring by using large integers and base-$\beta$ encoding, allowing the fast algorithm to solve optimization tasks.
  • Fourier vs. Möbius: The paper clarifies why standard FFT-based approaches (like zero-padding) fail to beat $O(3^n)$ for this specific problem, highlighting the unique suitability of the Möbius transform for subset lattices.

Key Results

  • General Speedup: Proved that subset convolution over any ring can be done in $O(n^2 2^n)$ time.
  • Steiner Tree Breakthrough: They improved the complexity of the classic Dreyfus–Wagner algorithm for the Steiner Tree problem from $O^*(3^k)$ to $O^*(2^k)$, where $k$ is the number of terminals. This is a significant result for a problem that is central to network design and VLSI layout.
  • Coloring and Partitioning: The algorithm provides a unified way to solve various "set cover" style partitioning problems in $O^*(2^n)$ time, matching or simplifying previous specialized results.

Limitations and Future Work

  • Integer Weights: The speedup for optimization problems (min-sum semirings) depends on the edge weights being relatively small integers. If weights are arbitrary real numbers, the "embedding" trick becomes less efficient.
  • Constant Factors: While the exponential growth is much slower ($2^n$ vs $3^n$), the $n^2$ factor and the overhead of the transforms mean that for very small $n$, the $O(3^n)$ approach might still be competitive.
  • Memory: Like many transform-based algorithms, this requires $O(n 2^n)$ space to store the ranked tables, which can be a bottleneck for very large $n$.

The authors suggest that this technique is a "basic building block" and expect it to find applications in many other areas of exact algorithms for NP-hard problems.

Summary updated

BibTeX
@inproceedings{bjorklund2007fourier,
  author = {Andreas Björklund and Thore Husfeldt and Petteri Kaski and Mikko Koivisto},
  title = {{Fourier meets möbius: fast subset convolution}},
  booktitle = {STOC},
  year = {2007},
  doi = {10.1145/1250790.1250801},
}

Loading related content...

Figure