Showing NP-completeness of longest path problem

  • Thread starter Thread starter TaPaKaH
  • Start date Start date
  • Tags Tags
    Path
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
TaPaKaH
Messages
51
Reaction score
0

Homework Statement


Show that the following problem is NP-complete:
Given: A directed graph ##G=(V,E)##, source and target nodes ##s,t\in V## and a parameter K.
Goal: Determine whether there exists a simple ##s,t##-path in ##G## of length at least ##K##.

The Attempt at a Solution


I've already shown that the problem is in NP, but I can't come up with a poly time reduction from a known NP-complete problem. Any ideas welcome.
 
Physics news on Phys.org
TaPaKaH said:

Homework Statement


Show that the following problem is NP-complete:
Given: A directed graph ##G=(V,E)##, source and target nodes ##s,t\in V## and a parameter K.
Goal: Determine whether there exists a simple ##s,t##-path in ##G## of length at least ##K##.

The Attempt at a Solution


I've already shown that the problem is in NP, but I can't come up with a poly time reduction from a known NP-complete problem. Any ideas welcome.

Google "longest path problem"; several on-line articles have all you need.
 
TaPaKaH, what are some NP-complete problems you are allowed to reduce to? Ones that are graph related already (ones that are related to doing walks around a graph in particular) would be particularly nice as starting points.
 
2-partition, 3-partition, TSP (undirected), ILP, SAT, 3-SAT, clique, vertex cover, independent set, Hamiltonian path (undirected) and cycle (directed and undirected) is what I am allowed to use.
 
I just managed to come up with a reduction from directed Hamiltonial cycle.