A Polynomial-Time Approximation for Pairwise Fair $k$-Median Clustering

Sayan Bandyapadhyay, Eden Chlamtáč, Zachary Friggstad, Mahya Jamshidian, Yury Makarychev, Ali Vakilian

TL;DR

This paper introduces the first polynomial-time algorithm for "Pairwise Fair $k$-Median Clustering" that strictly satisfies fairness constraints without relying on bi-criteria violations (i.e., without allowing slight fairness deviations). The authors achieve an $O(k^2 \cdot \ell \cdot t)$-approximation and complement this with hardness results showing that the problem is inherently tied to the difficulty of capacitated clustering.

What Problem Does This Paper Address?

Standard clustering algorithms (like $k$-median) group data points based purely on geometric similarity. However, this often leads to clusters that are demographically unbalanced, which can be problematic when clustering people for applications like facility location, advertising, or resource allocation.

"Fair clustering" attempts to fix this. While most prior work focused on Fair Representational Clustering (where clusters must match global group proportions within specified bounds), this paper tackles Pairwise Fair Clustering. Here, for every cluster, the ratio of points between any two groups must be bounded by a uniform factor $t$. For example, if $t=2$, no group can outnumber another group by more than double within any single cluster.

Prior solutions for this problem with more than two groups either violated the fairness constraints slightly to achieve polynomial time (bi-criteria approximations) or required exponential running times. This paper provides the first algorithm that guarantees strict fairness in true polynomial time.

Figure 1: (a) A fair representational clustering for three groups red (r, disk), blue (b, square), and green (g, cross). Here αr = 1/3, βr = 2/3, αb = 1/6, βb = 1/3, αg = 1/6, βg = 1/3. C1, C2, C3 are the clusters. (b) A pairwise fair clustering with t = 2 for the same dataset. The clustering in (a) is not pairwise fair for t = 2, as C1 contains 4 red (disk) points, but only 1 blue (square).

Methods

The authors design a multi-step pipeline to achieve a fair assignment without exploding the clustering cost:

  1. Vanilla Clustering: They begin by finding $k$ centers using a standard, unconstrained $k$-median approximation algorithm (such as Byrka et al.'s 2.675-approximation).
  2. Linear Programming (LP) Relaxation: They formulate an LP to find a fractional assignment of points to these centers. To bound assignment costs, they solve this LP across various guessed maximum assignment distances ($D$).
  3. Nearly-Fair Rounding: The fractional LP solution is rounded to an integer assignment using min-cost bipartite matching. This yields a low-cost assignment that is nearly fair, with only a small additive violation.
  4. Fairness Fixing: To eliminate the remaining fairness violations, they unassign a small, bounded number of "excess" points. They then use a local shifting procedure to reassign these points to a designated center while maintaining strict fairness invariants across all clusters.

Datasets

The algorithm was empirically evaluated on four standard datasets from the UCI Machine Learning Repository:

  • bank: Includes categorical data (marital status) and numerical features (age, balance, duration).
  • adult_race: Features categorical data (race) and numerical features (age, final-weight, education-num).
  • creditcard_education: Includes categorical data (education level) and numerical features (limit balance, age, bill amount).
  • census1990_ss: Contains categorical data (age buckets) and numerical features (ancestry, availability, citizenship).

Key Insights and Ideas

  • Strict Fairness is Feasible: Unlike previous approaches that accepted a $\pm 1$ or $\pm 3$ violation of fairness constraints to keep running times polynomial, this paper proves you can fix these violations completely without blowing up the approximation factor exponentially.
  • The Connection to Capacitated Clustering: The authors establish a reduction showing that Pairwise Fair Clustering is closely related to the notorious uniform capacitated $k$-median problem. This explains why the problem is so difficult and justifies why an $O(k^2 \cdot \ell \cdot t)$ factor is acceptable, as even a $o(\log k)$ approximation for the capacitated version remains an open problem.
  • Overlapping Groups Break the Problem: If a data point can belong to multiple protected groups simultaneously (e.g., intersecting identities), the problem becomes drastically harder—specifically, NP-hard to approximate within a factor of $n^{1-\epsilon}$.

Key Results

  • Algorithmic: A true polynomial-time $O(k^2 \cdot \ell \cdot t)$-approximation algorithm for Pairwise Fair $k$-Median clustering.
  • Hardness: Proved that for $\ell = 2$ groups, the problem is as hard as soft uniform capacitated $k$-median. For overlapping groups, it is NP-hard to approximate within $n^{1-\epsilon}$ even for $k=2$.
  • Empirical: In practice, the "cost of fairness" (the increase in clustering cost compared to vanilla $k$-median) is remarkably small, far outperforming the pessimistic theoretical worst-case bound. Furthermore, the runtime bottleneck is actually the initial vanilla clustering step, making the fairness adjustment highly practical.

Limitations and Future Work

  • Large Theoretical Bound: The theoretical approximation factor $O(k^2 \cdot \ell \cdot t)$ is quite large, even though empirical performance is strong. Tightening this gap remains an open challenge.
  • LP Overhead: The algorithm relies on solving multiple LPs across different distance thresholds $D$, which can be computationally intensive for massive datasets (though the authors note this can be parallelized or optimized by sampling distances geometrically).
  • Overlapping Groups: The strict fairness guarantee only applies to disjoint groups; finding a reasonable, non-trivial approximation for overlapping groups without massive violations remains unsolved due to the proven hardness.

Summary updated

BibTeX
@misc{bandyapadhyay2024polynomial,
  author = {Sayan Bandyapadhyay and Eden Chlamtáč and Zachary Friggstad and Mahya Jamshidian and Yury Makarychev and Ali Vakilian},
  title = {{A Polynomial-Time Approximation for Pairwise Fair $k$-Median Clustering}},
  year = {2024},
  eprint = {2405.10378},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.10378},
}
Figure