Longest Path

Input

Graph G=(V,E)G = (V, E), length (e)Z+\ell(e) \in \mathbb{Z}^{+} for each eEe \in E, positive integer KK, specified vertices s,tVs, t \in V.

Question

Is there a simple path in GG from ss to tt of length KK or more, i.e. whose edge lengths sum to at least KK?

Classes

Comments

Remains NP-complete if (e)=1\ell(e) = 1 for all eEe \in E, as does the corresponding problem for directed paths in directed graphs. The general problem can be solved in polynomial time for acyclic digraphs, e.g. see (Lawler, 1976). The analogous directed and undirected shortest path problems can be solved for arbitrary graphs in polynomial time (e.g. see (Lawler, 1976)), but are NP-complete if negative lengths are allowed.

Proofs

NP-complete

Transformation from [problem:hamiltonian-path-between-two-vertices].

Reducible from

References