TL;DR
Clustering data across multiple database tables traditionally requires executing expensive joins that cause a massive explosion in data size. This paper introduces the first efficient relative approximation algorithms for $k$-median and significantly improved algorithms for $k$-means clustering directly on relational data without materializing the join. By smartly constructing small "coresets" using database theory techniques, their randomized algorithms achieve excellent approximation guarantees with a running time that scales linearly with the database size.
What Problem Does This Paper Address?
In the real world, data rarely lives in a single flat table; it is distributed across relational database management systems (DBMS) in multiple tables (e.g., users, transactions, and locations). To perform machine learning tasks like $k$-means or $k$-median clustering on this data, data scientists typically must first "join" these tables together.
However, this two-step approach (join then cluster) is incredibly inefficient. The size of the join result can be polynomially larger than the input tables, leading to massive computational bottlenecks. While previous work attempted to solve this "relational clustering" problem, existing solutions either suffered from large additive errors, massive constant relative approximation factors, or impractical running times. Specifically, no efficient relative approximation algorithm existed for the relational $k$-median problem until now.
Methods
The authors bypass the expensive join step by constructing a coreset—a small, weighted subset of data points that accurately approximates the clustering cost of the full dataset.
Their approach adapts a classic geometric coreset technique (originally designed for standard flat tables) that constructs an exponential grid around a set of initial rough cluster centers. However, adapting this to relational data is non-trivial because you cannot easily count or sample points in a grid cell without doing the join.
To solve this, the authors leverage advanced database algorithms (like the Yannakakis algorithm and recent join-sampling techniques) to count and sample tuples inside bounding boxes directly from the unjoined tables. They propose two main variants:
- A deterministic algorithm: This precisely calculates the arrangement of intersecting grid cells to avoid double-counting points, but it is computationally slower.
- A fast randomized algorithm: This uses uniform random sampling to classify grid cells as "heavy" (dense) or "light" (sparse), significantly speeding up the coreset construction.
Once the coreset is built, any standard traditional clustering algorithm can be run on top of it to find the final cluster centers. To handle the full multi-attribute space, the algorithm processes attributes bottom-up using a balanced binary tree, solving the problem in lower dimensions first and combining them hierarchically.
Datasets
Not discussed in the paper. This is a purely theoretical paper focused on proving algorithmic complexity and approximation guarantees; it does not include experimental evaluations on real or synthetic datasets.
Key Insights and Ideas
- In-Database Coreset Construction: The core "aha" moment is realizing that you don't need to materialize the points to build a geometric coreset; you just need to be able to count and sample them within specific axis-aligned bounding boxes—a task that relational database theory already knows how to do efficiently.
- Heavy vs. Light Cells: To avoid the expensive exact geometric cell-intersection calculations required by the deterministic approach, the randomized algorithm uses a clever "charging process." Light cells (which are hard to compute exactly) are safely ignored or approximated because their error can be mathematically charged to nearby heavy cells without blowing up the approximation factor.
Key Results
The paper delivers major theoretical upgrades for both $k$-median and $k$-means relational clustering, outperforming the state-of-the-art relative approximation algorithms as summarized in their comparison table:
- For $k$-median: They provide the first efficient relative approximation algorithm, achieving a $(2+\varepsilon)\gamma$ factor for discrete clustering in $\tilde{O}(k^2 N^{\mathsf{fhw}} + k^4 + T_{\gamma}^{\mathsf{med}}(k^2))$ time for the randomized version (where $\mathsf{fhw}$ is the fractional hypertree width, a measure of query complexity).
- For $k$-means: Their algorithm slashes the approximation factor down to $(4+\varepsilon)\gamma$, vastly outperforming prior bounds like $320 + 644(1+\varepsilon)\gamma$ from Moseley et al., while also improving or matching the best-known running times.
Limitations and Future Work
The authors note several open directions and implicit limitations:
- Objective Functions: The current framework is tailored specifically to $k$-means and $k$-median objectives. Extending this to other clustering objectives, like the sum of radii clustering, remains an open challenge.
- Query Complexity: The algorithms assume full conjunctive queries. Future work is needed to handle more complex database queries, such as those involving inequalities or negations (NOT joins).
- Distance Metrics: The geometric guarantees rely heavily on the Euclidean distance metric. Relational data often benefits from other metrics like Hamming, Jaccard, or cosine distance, which are not currently supported by this method.
Summary updated