Jump to content

Talk:Longest path problem: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Dfarrell07 (talk | contribs)
m Does k=|V|?: Signed my last post. Sorry, I'm not experienced with discussion pages.
Line 12: Line 12:


:I think you are right. In all cases in the NP-C section, when |V| is used to describe the length of the HC, |V| - 1 should be used. I will make the edits. [[User:Dfarrell07|Dfarrell07]] ([[User talk:Dfarrell07|talk]]) 04:37, 17 October 2011 (UTC)
:I think you are right. In all cases in the NP-C section, when |V| is used to describe the length of the HC, |V| - 1 should be used. I will make the edits. [[User:Dfarrell07|Dfarrell07]] ([[User talk:Dfarrell07|talk]]) 04:37, 17 October 2011 (UTC)

== number of k-length paths through matrix multiplication ==

Similar to the concern below, I doubt if the generic decision problem is NP-complete. There is a popular method where the adjacency matrix A is repeatedly multiplied. The entry [i, j] in the k-th power of A gives the number of k-length paths from Vi to Vj. It would appear this computation is O(n^3 * logk).


== Is generic problem also NP-complete? ==
== Is generic problem also NP-complete? ==

Revision as of 02:38, 21 October 2011

WikiProject iconMathematics Start‑class Low‑priority
WikiProject iconThis article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-priority on the project's priority scale.
WikiProject iconComputing Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
WikiProject iconComputer science Start‑class Low‑importance
WikiProject iconThis article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
LowThis article has been rated as Low-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

Highest-weight tour

Please can someone add some discussion of the node equivalent of this edge path problem, or the highest-weight subpath problem, where one has to find the highest weight subpath (i.e. given node weights, not edge weights) of given length? Obviously if the subpath is a tour then it has fixed constant weight, since all nodes are visited. But if one needs a subpath of maximum weight, do you have to simply do a brute-force search? It seems that dynamic programming can't solve this problem, because optimal subproblems depend upon the path used to get to the subproblem (because nodes can't be traversed twice), so subproblems can't be reused between different paths used to reach the subproblem. —Preceding unsigned comment added by 128.30.48.28 (talk) 21:44, 2 November 2010 (UTC)[reply]

Does k=|V|?

The page states "...we use the algorithm for the longest path problem on the same input graph and set k=|V|, the number of vertices in the graph." Yet the definition of Hamiltonian Path states that each vertex is visited once. In a simple example 2 vertices only produce 1 edge. K should equal |V| - 1 unless the original author meant Hamiltonian "Cycle" in which the path returns to the start. But this would contradict the definition of Longest Path I believe. —Preceding unsigned comment added by 71.10.229.128 (talk) 03:57, 15 December 2010 (UTC)[reply]

I think you are right. In all cases in the NP-C section, when |V| is used to describe the length of the HC, |V| - 1 should be used. I will make the edits. Dfarrell07 (talk) 04:37, 17 October 2011 (UTC)[reply]

number of k-length paths through matrix multiplication

Similar to the concern below, I doubt if the generic decision problem is NP-complete. There is a popular method where the adjacency matrix A is repeatedly multiplied. The entry [i, j] in the k-th power of A gives the number of k-length paths from Vi to Vj. It would appear this computation is O(n^3 * logk).

Is generic problem also NP-complete?

I understand that decision problem with k=|V| is equivalent to Hamilton cycle which is NP-complete.

But what if we ask for k < |V|, or something else in weighted graph. Obviously in some cases it is trivia (for example if k smaller than any edge which obviously will answer yes, if positively-weighted graph contains any cycle, or if it is bigger than sum of all edges or k > |V| in unweighed graph, in which answer is obviously no, as no such simple path exists).

Is there any general results about restricting k to other values? Will problem still be NP? —Preceding unsigned comment added by 91.213.255.7 (talk) 05:44, 3 February 2011 (UTC)[reply]