Finding paths with the right cost

  • Authors:
  • Matti Nykänen;Esko Ukkonen

  • Affiliations:
  • Department of Computer Science, University of Helsinki, Finland;Department of Computer Science, University of Helsinki, Finland

  • Venue:
  • STACS'99 Proceedings of the 16th annual conference on Theoretical aspects of computer science
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

We study a problem related to finding shortest paths in weighted graphs. We ask whether or not there is a path between two nodes that is of a given cost. The edge weights of the graph can be both positive and negative integers, or even integer vectors.We show that most variants of this problem are NP-complete. We also develop a pseudopolynomial algorithm for the case where the edge weights are integers. The running time of this algorithm is O(M2N3 + |w|min(|w|, M)N2) where N is the number of nodes in the graph, M is the largest absolute value of any edge weight, and w is the target cost. The algorithm is based on preprocessing the graph with a relaxation algorithm to eliminate the effects of weight sign alternations along a path.