NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Nearly-Linear Time Algorithm for Submodular Maximization with a Knapsack Constraint

Alina Ene, Huy L. Nguyen

TL;DR

Maximizing a monotone submodular function under a knapsack constraint is a foundational problem in discrete optimization, but standard continuous relaxation approaches hit a quadratic $\Omega(n^2)$ running time barrier. This paper presents the first nearly-linear time algorithm in the ground set size $n$, achieving a nearly-optimal $(1 - 1/e - \epsilon)$-approximation using $(1/\epsilon)^{O(1/\epsilon^4)} n \log^2 n$ time. The key breakthrough is keeping almost all coordinates integral throughout the optimization, allowing exact evaluations of the continuous relaxation in constant time.

What Problem Does This Paper Address?

Submodular functions formalize the principle of "diminishing returns" and appear across machine learning (sensor placement, data summarization) and economics (viral marketing, resource allocation). When constrained by a budget or knapsack capacity, finding the optimal subset is NP-hard.

The gold standard approximation ratio for monotone submodular maximization is $1 - 1/e \approx 0.632$. Existing near-optimal algorithms rely on the multilinear extension—a continuous relaxation defined over the unit hypercube $[0, 1]^V$. However, computing or estimating the multilinear extension requires sampling or high-degree polynomials, making each evaluation costly and inherently bottlenecking algorithms to $\Omega(n^2)$ time. The authors set out to determine whether a near-optimal $(1 - 1/e - \epsilon)$-approximation is achievable in nearly-linear running time $\tilde{O}(n)$.

Methods

The authors design a hybrid approach combining value guessing, fractional steps, and lazy greedy selection:

  1. Partitioning the Optimal Solution: OPT is conceptually split into a small set of "heavy/valuable" items ($\text{OPT}_1$, size $O(1/\epsilon^3)$) and the remaining items ($\text{OPT}_2$).
  2. Marginal Gain Discretization & Guessing: Instead of enumerating elements (which costs $\Omega(n^3)$ or more), the algorithm guesses the discretized marginal gains of items in $\text{OPT}_1$ and large-gain items in $\text{OPT}_2$.
  3. Fractional Updates for $\text{OPT}_1$: For $\text{OPT}_1$, the algorithm iteratively selects the cheapest elements meeting the guessed marginal gains and increases their coordinate fractionally by $\epsilon$.
  4. Lazy Density Greedy for $\text{OPT}_2$: The remaining budget is filled by integrally adding elements via a discrete greedy approach based on marginal value-to-cost density. Submodularity enables "lazy evaluations" via priority queues, reducing queries to $\tilde{O}(n)$.
  5. Specialized Swap Rounding: The final vector has only $O(1/\epsilon^4)$ fractional coordinates. The authors design a variant of swap rounding that matches fractional elements against items in $\text{OPT}_1$ to preserve budget feasibility without losing objective value.

Datasets

Not discussed in the paper. This is a purely theoretical paper and does not include empirical benchmarks or experiments.

Key Insights and Ideas

  • Sparse Fractional Support Overcomes the $\Omega(n^2)$ Barrier: Evaluating the multilinear extension usually requires evaluating an expectation over random subsets. Because only $O(1/\epsilon^4)$ entries ever become strictly fractional (independent of $n$), the multilinear extension can be evaluated exactly in $O(1)$ oracle calls.
  • Handling Unknown Remaining Budget: Because $\text{OPT}_1$ is packed fractionally, the algorithm cannot predetermine how much knapsack capacity remains for $\text{OPT}_2$. The authors bypass this by filtering out large-gain items and proving that discrete density greedy will stop before violating the budget.
  • Ordered Swap Rounding: Standard matroid rounding can inadvertently pick the same item multiple times if an item belongs to several fractional parts. Sorting fractional items by cost and transferring mass between pairs preserves an invariant against $\text{OPT}_1$, ensuring budget feasibility.

Key Results

  • Approximation Ratio: Achieves a $(1 - 1/e - \epsilon)$-approximation for monotone submodular knapsack maximization.
  • Query & Time Complexity:
  • Function evaluations: $(1/\epsilon)^{O(1/\epsilon^4)} n \log n$
  • Arithmetic operations: $(1/\epsilon)^{O(1/\epsilon^4)} n \log^2 n$
  • Theoretical Significance: Improves upon prior polynomial-time continuous greedy algorithms running in $O(n^5)$ or $n^2 (\log n / \epsilon)^{O(1/\epsilon^8)}$ time, reaching nearly-linear dependence on $n$.

Limitations and Future Work

  • Galactic Constants (Impractical for Implementation): As the authors explicitly acknowledge, the algorithm is impractical due to the massive $(1/\epsilon)^{O(1/\epsilon^4)}$ dependence. Even for moderate values like $\epsilon = 0.1$, the search space of guessed values is astronomical.
  • Multiple Knapsack Constraints: While the continuous relaxation approach naturally extends to $d > 1$ knapsack constraints in $(n \log n) \cdot \exp(d, 1/\epsilon)$ time, rounding the solution without violating multiple constraints remains an open problem.

Summary updated

BibTeX
@inproceedings{ene2019nearly,
  author = {Alina Ene and Huy L. Nguyen},
  title = {{A Nearly-Linear Time Algorithm for Submodular Maximization with a Knapsack Constraint}},
  booktitle = {ICALP},
  year = {2019},
  url = {https://openreview.net/forum?id=U9FdmmoBWbU},
}
Figure