The grammar problem, a generalization of the single-source shortest-path problem introduced by Knuth, is to compute the minimum-cost derivation of a terminal string from one or more non-terminals of a given context-free grammar, with the cost of a derivation being suitably defined. In this paper we present an incremental algorithm for a version of the grammar problem. As a special case of this algorithm we obtain an efficient incremental algorithm for the singlesource shortest-path problem with positive edge lengths. The aspect of our incremental algorithm that distinguishes it from all other work on the dynamic shortest-path problem is its ability to handle "multiple heterogeneous modifications": between updates, the input graph is allowed to be restructured by an arbitrary mixture of edge insertions, edge deletions, and edge-length changes.
REF gives an incremental algorithm for a version of the grammar problem and as corollaries obtain incremental algorithms for single-source shortest path problems with positive edge weights.
An Incremental Algorithm for a Generalization of the Shortest-Path Problem
Journal of Algorithms
Mathematics Computer Science