English

A Linear-Time Approximation Scheme for the Densest Subgraph Problem

Data Structures and Algorithms 2026-08-11 v1

Abstract

In the undirected \emph{Densest Subgraph Problem (DSG)} the goal is to output a subset SS of vertices of a given graph GG that maximizes the quantity E(S)/S|E(S)|/|S|, where E(S)E(S) is the set of edges in the subgraph induced by SS. The problem is well studied in both theory and practice, and it admits natural efficient exact algorithms, as well as near-linear time algorithms with a (1ε)(1-\varepsilon) approximation ratio. However, all previously-known approximation schemes incur logarithmic factors in the size of the graph or other parameters of the graph. This raises the question of whether a linear time (1ε)(1-\varepsilon)-approximation can be obtained for all ε>0\varepsilon>0. We answer this question affirmatively by providing a (1ε)(1-\varepsilon)-approximation algorithm running in time O(n+mε3log1ε)O\left(\frac{n+m}{\varepsilon^3}\log \frac{1}{\varepsilon}\right), where mm and nn are respectively the number of edges and vertices of GG. To the best of our knowledge, this is the first truly linear-time approximation scheme for the problem (when ε>0\varepsilon>0 is a constant). Our algorithm uses assignments arising from a flow-based formulation together with a structural carving lemma. This lemma allows us to progressively carve "sparse" parts of the graph while nearly preserving the densest subgraph, allowing us to shift heavy computations to smaller instances, which eventually yields the mentioned runtime. Our framework also yields a (1/2ε)(1/2 -\varepsilon)-approximation for the \emph{Densest At-Least-kk Subgraph Problem}, where in addition to maximizing the density, we require the subgraph to have at least kk vertices. Our algorithm runs in time O((n+m)log2nlog1εε)O\left( \frac{(n+m) \log^2 n \log \frac{1}{\varepsilon}}{\varepsilon} \right). This nearly matches the known 1/21/2 approximation hardness while running in near-linear time.

Keywords

Cite

@article{arxiv.2608.11094,
  title  = {A Linear-Time Approximation Scheme for the Densest Subgraph Problem},
  author = {Elena Grigorescu and Mehrshad Taziki},
  journal= {arXiv preprint arXiv:2608.11094},
  year   = {2026}
}