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(M 2 N 3 + |w|min(|w|, M)N 2) 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.
Supported by Academy of Finland grant number 42977.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
N. Alon, Z. Galil, and O. Margalit. On the exponent of the all pairs shortest path problem. Journal of Computer and System Sciences, 54:255–262, 1997.
D.P. Bertsekas. An auction algorithm for shortest paths. SIAM Journal on Optimization, 1(4):425–447, 1991.
D. Coppersmith and S. Winograd. Matrix multiplication via arithmetic progressions. Journal of Symbolic Computation, 9:251–280, 1990.
T.H. Cormen, C.E. Leiserson, and R.L. Rivest. Introduction to Algorithms. McGraw-Hill, 1990.
H.N. Gabow and R.E. Tarjan. Faster scaling algorithms for network problems. SIAM Journal on Computing, 18(5):1013–1036, 1989.
Z. Galil and O. Margalit. All pairs shortest distances for graphs with small integer length edges. Journal of Computer and System Sciences, 54:243–254, 1997.
M.R. Garey and D.S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. Freeman, 1979.
G. Grahne and M. Nykänen. Safety, translation and evaluation of Alignment Calculus. In Advances in Databases and Information Systems, Springer Electronic Workshops in Computing, pages 295–304, 1997.
G. Grahne, M. Nykänen, and E. Ukkonen. Reasoning about strings in databases. In ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, pages 303–312, 1994.
D. Gusfield. Algorithms on Strings, Trees, and Sequences: Computer Science and Computational Biology. Cambridge University Press, 1997.
S.R. Kosaraju. Decidability of reachability in vector addition systems. In ACM Symposium on Theory of Computing, pages 267–281, 1982.
E.W. Mayr. An algorithm for the general Petri net reachability problem. SIAM Journal on Computing, 13(3):441–460, 1984.
M. Nykänen. Querying String Databases with Modal Logic. PhD thesis, Department of Computer Science, University of Helsinki, Finland, 1997.
M. Nykänen. Using acceptors as transducers. In Third International Workshop on Implementing Automata (WIA’ 98), 1998. In press.
C.H. Papadimitriou and K. Steiglitz. Combinatorial Optimization: Algorithms and Complexity. Prentice-Hall, 1982.
R. Seidel. On the all-pairs-shortest-path problem in unweighted undirected graphs. Journal of Computer and System Sciences, 51:400–403, 1995.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nykänen, M., Ukkonen, E. (1999). Finding Paths with the Right Cost. In: Meinel, C., Tison, S. (eds) STACS 99. STACS 1999. Lecture Notes in Computer Science, vol 1563. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49116-3_32
Download citation
DOI: https://doi.org/10.1007/3-540-49116-3_32
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65691-3
Online ISBN: 978-3-540-49116-3
eBook Packages: Springer Book Archive