In graph theory and theoretical computer science, the longest path problem is the problem of finding a simple path of maximum length in a given graph. A path is called simple if it does not have any repeated vertices; the length of a path may either be measured by its number of edges, or (in weighted graphs) by the sum of the weights of its edges. In contrast to the shortest path problem, which can be solved in polynomial time in graphs without negative-weight cycles, the longest path problem is NP-hard, meaning that it cannot be solved in polynomial time for arbitrary graphs unless P = NP. Stronger hardness results are also known showing that it is difficult to approximate. However, it has a linear time solution for directed acyclic graphs, which has important applications in finding the critical path in scheduling problems.
Read more about Longest Path Problem: NP-hardness, Acyclic Graphs and Critical Paths, Approximation, Parameterized Complexity, Special Classes of Graphs, See Also
Famous quotes containing the words longest, path and/or problem:
“The ensuing year will be the longest of my life, and the last of such hateful labours. The next we will sow our cabbages together.”
—Thomas Jefferson (17431826)
“So long as you are praised think only that you are not yet on your own path but on that of another.”
—Friedrich Nietzsche (18441900)
“The problem for the King is just how strict
The lack of liberty, the squeeze of the law
And discipline should be in school and state....”
—Robert Frost (18741963)