Skip to main content
Log in

Dynamic Programming on the Word RAM

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

Dynamic programming is one of the fundamental techniques for solving optimization problems. In this paper we propose a general framework which can be used to decrease the time and space complexity of these algorithms with a logarithmic factor. The framework is based on word encoding, i.e. by representing subsolutions as bits in an integer. In this way word parallelism can be used in the evaluation of the dynamic programming recursion. Using this encoding the subset-sum problem can be solved in O( n b/ log b) time and O(b/ log b) space, where n is the number of integers given and b is the target sum. The knapsack problem can be solved in O( n m/ log m) time and O(m/ log m) space, where n is the number of items and m = max{b,z} is the maximum of the capacity b and the optimal solution value z . The problem of finding a path of a given length b in a directed acyclic graph G=(V,E) can be solved in O(|E|b/ log b) time and O(|V|b/ log b) space. Several other examples are given showing the generality of the achieved technique. Extensive computational experiments are provided to demonstrate that the achieved results are not only of theoretical interest but actually lead to algorithms which are up to two orders of magnitude faster than their predecessors. This is a surprising observation as the increase in speed is larger than the word size of the processor.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Pisinger Dynamic Programming on the Word RAM. Algorithmica 35, 128–145 (2003). https://doi.org/10.1007/s00453-002-0989-y

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-002-0989-y

Keywords

Navigation