Skip to main content
QUICK REVIEW

[Paper Review] Capacitated Dynamic Programming: Faster Knapsack and Graph Algorithms

Kyriakos Axiotis, Christos Tzamos|arXiv (Cornell University)|Feb 18, 2018
Optimization and Packing ProblemsEngineering16 references10 citations
TL;DR

This paper presents a novel dynamic programming approach that reduces the Knapsack problem's runtime from O(Tn) to O(TD), where D is the number of distinct weights, by exploiting concavity in subproblems. It achieves faster algorithms for Knapsack and related graph problems by eliminating dependence on capacity T when weights or values are bounded, matching conditional lower bounds and enabling linear-time solutions for k-sparse Δ-separated sequences.

ABSTRACT

One of the most fundamental problems in Computer Science is the Knapsack problem. Given a set of n items with different weights and values, it asks to pick the most valuable subset whose total weight is below a capacity threshold T. Despite its wide applicability in various areas in Computer Science, Operations Research, and Finance, the best known running time for the problem is O(Tn). The main result of our work is an improved algorithm running in time O(TD), where D is the number of distinct weights. Previously, faster runtimes for Knapsack were only possible when both weights and values are bounded by M and V respectively, running in time O(nMV) [Pisinger'99]. In comparison, our algorithm implies a bound of O(nM^2) without any dependence on V, or O(nV^2) without any dependence on M. Additionally, for the unbounded Knapsack problem, we provide an algorithm running in time O(M^2) or O(V^2). Both our algorithms match recent conditional lower bounds shown for the Knapsack problem [Cygan et al'17, Künnemann et al'17]. We also initiate a systematic study of general capacitated dynamic programming, of which Knapsack is a core problem. This problem asks to compute the maximum weight path of length k in an edge- or node-weighted directed acyclic graph. In a graph with m edges, these problems are solvable by dynamic programming in time O(km), and we explore under which conditions the dependence on k can be eliminated. We identify large classes of graphs where this is possible and apply our results to obtain linear time algorithms for the problem of k-sparse Delta-separated sequences. The main technical innovation behind our results is identifying and exploiting concavity that appears in relaxations and subproblems of the tasks we consider.

Motivation & Objective

  • To overcome the long-standing O(Tn) runtime bottleneck in the classic Knapsack problem.
  • To eliminate the dependence on total capacity T in dynamic programming for Knapsack and related problems.
  • To identify structural conditions under which the k-dependence in capacitated dynamic programming can be removed.
  • To develop a general framework for solving capacitated dynamic programming problems using concavity and structural properties.
  • To match or improve upon recent conditional lower bounds for Knapsack and related problems.

Proposed method

  • Partition items by distinct weights and solve each group independently using greedy selection, leveraging equal weights to achieve O(T) time per group.
  • Exploit concavity in relaxed subproblems and relaxations of the Knapsack problem to design efficient algorithms.
  • Use a transformation to model the problem as a maximum-reward path in a DAG with Monge-weighted edges.
  • Apply the Monge property and divide-and-conquer techniques to compute paths efficiently in O(m log n log(nM)) time.
  • Construct a DAG with O(n) edges that preserves path structure and enables linear-time computation for k-sparse Δ-separated sequences.
  • Use the Steinitz Lemma to derive structural properties that allow removing logarithmic factors in T for unbounded Knapsack.

Experimental results

Research questions

  • RQ1Can the O(Tn) runtime of the classic Knapsack algorithm be improved when the number of distinct weights D is small?
  • RQ2Is it possible to eliminate the dependence on capacity T in Knapsack when weights or values are bounded?
  • RQ3Under what structural conditions can the k-dependence in capacitated dynamic programming be removed?
  • RQ4Can the conditional lower bound for Knapsack based on (max,+)-convolution be circumvented?
  • RQ5What classes of graphs allow for linear-time computation of maximum-reward paths with k edges?

Key findings

  • The Knapsack problem can be solved in O(TD) time, where D is the number of distinct weights, improving over O(Tn) when D ≪ n.
  • For bounded weights M, the algorithm runs in O(nM²) time, and for bounded values V, it runs in O(nV²) time, improving over Pisinger’s O(nMV) algorithm.
  • The unbounded Knapsack problem is solved in O(M²) or O(V²) time, matching known conditional lower bounds.
  • A linear-time algorithm is achieved for k-sparse Δ-separated sequences by exploiting concavity and DAG structure.
  • For Monge-weighted DAGs, any row or column of the k-th tropical matrix power can be computed in Õ(m) time, improving over O(km) standard DP.
  • The algorithm matches the conditional lower bound for (max,+)-convolution, showing it is nearly optimal under current complexity assumptions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.