A stupid thought about Hamilton Path problem - Theory

This is a discussion on A stupid thought about Hamilton Path problem - Theory ; Hamilton Path: to find a shortest path in graph G from vertex s to vertex t through all the other vertices once and only once. My thought: First find a random path P from s to t. Then do this ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

A stupid thought about Hamilton Path problem

  1. Default A stupid thought about Hamilton Path problem

    Hamilton Path: to find a shortest path in graph G from vertex s to
    vertex t through all the other vertices once and only once.

    My thought:

    First find a random path P from s to t.

    Then do this loop until no change happens in a pass:

    Do
    For Each vertex pair i, j, (note that i and j are not necessarily
    adjacent vertices)
    if a swap of i and j in path P can lead to a shorter path, then
    swap them and the new path becomes P
    Loop


    Any counterexample to this algorithm?

    Regards,
    Yao Ziyuan


  2. Default Re: A stupid thought about Hamilton Path problem

    The flaw seems to be that only two-vertex swaps are not sufficient. For
    example, a three-vertex swap:

    s -...-> i -...-> j -...-> k -...-> t
    =>
    s -...-> j -...-> k -...-> i -...-> t

    is not accomplishable by a series of two-vertex swaps.



    On Dec 4, 5:04 am, "Booted Cat" <yaoziy...{}> wrote:
    > Hamilton Path: to find a shortest path in graph G from vertex s to
    > vertex t through all the other vertices once and only once.
    >
    > My thought:
    >
    > First find a random path P from s to t.
    >
    > Then do this loop until no change happens in a pass:
    >
    > Do
    > For Each vertex pair i, j, (note that i and j are not necessarily
    > adjacent vertices)
    > if a swap of i and j in path P can lead to a shorter path, then
    > swap them and the new path becomes P
    > Loop
    >
    > Any counterexample to this algorithm?
    >
    > Regards,
    > Yao Ziyuan



  3. Default Re: A stupid thought about Hamilton Path problem

    On 3 Dec 2006 13:04:13 -0800, "Booted Cat" <yaoziyuan{}>
    wrote:

    >Hamilton Path: to find a shortest path in graph G from vertex s to
    >vertex t through all the other vertices once and only once.
    >


    For definition of Hamiltonian path look here

    http://en.wikipedia.org/wiki/Hamiltonian_path


    >My thought:
    >
    >First find a random path P from s to t.
    >
    >Then do this loop until no change happens in a pass:
    >
    >Do
    > For Each vertex pair i, j, (note that i and j are not necessarily
    >adjacent vertices)
    > if a swap of i and j in path P can lead to a shorter path, then
    >swap them and the new path becomes P
    >Loop
    >
    >
    >Any counterexample to this algorithm?


    Run google on Travelling Salesman Problem. You can start from here

    http://en.wikipedia.org/wiki/Traveling_Salesman_Problem

    and check teh section "iterative improvement"

    A.L.

  4. Default Re: A stupid thought about Hamilton Path problem

    Forgot Wikipedia is one's friend...

    On Dec 4, 7:20 am, A.L. <alewa...{}fala2005.com> wrote:
    > On 3 Dec 2006 13:04:13 -0800, "Booted Cat" <yaoziy...{}>
    > wrote:
    >
    > >Hamilton Path: to find a shortest path in graph G from vertex s to
    > >vertex t through all the other vertices once and only once.For definition of Hamiltonian path look here

    >
    > http://en.wikipedia.org/wiki/Hamiltonian_path
    >
    > >My thought:

    >
    > >First find a random path P from s to t.

    >
    > >Then do this loop until no change happens in a pass:

    >
    > >Do
    > > For Each vertex pair i, j, (note that i and j are not necessarily
    > >adjacent vertices)
    > > if a swap of i and j in path P can lead to a shorter path, then
    > >swap them and the new path becomes P
    > >Loop

    >
    > >Any counterexample to this algorithm?Run google on Travelling Salesman Problem. You can start from here

    >
    > http://en.wikipedia.org/wiki/Traveling_Salesman_Problem
    >
    > and check teh section "iterative improvement"
    >
    > A.L.



  5. Default Re: A stupid thought about Hamilton Path problem

    On 3 Dec 2006 16:11:56 -0800, "Booted Cat" <yaoziyuan{}>
    wrote:

    >Forgot Wikipedia is one's friend...


    That what?...

    A.L.

  6. Default Re: A stupid thought about Hamilton Path problem



    > The flaw seems to be that only two-vertex swaps are not sufficient. For
    > example, a three-vertex swap:
    >
    > s -...-> i -...-> j -...-> k -...-> t
    > =>
    > s -...-> j -...-> k -...-> i -...-> t
    >
    > is not accomplishable by a series of two-vertex swaps.
    >

    Huh?

    xijky
    xjiky
    xjkiy


  7. Default Re: A stupid thought about Hamilton Path problem

    Because in order to successfully swap i and j, the pairwise swap must
    lead to a shorter path; and this may not be satisfied.

    On Dec 6, 11:13 pm, "d...{}comcast.net" <d...{}comcast.net> wrote:
    > > The flaw seems to be that only two-vertex swaps are not sufficient. For
    > > example, a three-vertex swap:

    >
    > > s -...-> i -...-> j -...-> k -...-> t
    > > =>
    > > s -...-> j -...-> k -...-> i -...-> t

    >
    > > is not accomplishable by a series of two-vertex swaps.Huh?

    >
    > xijky
    > xjiky
    > xjkiy



  8. Default Re: A stupid thought about Hamilton Path problem

    Booted Cat wrote:
    > Because in order to successfully swap i and j, the pairwise swap must
    > lead to a shorter path; and this may not be satisfied.


    Shorter path? You didn't give them lengths.

    It gets worse. You stated the key step of the algorithm:

    if a swap of i and j in path P can lead to a shorter path

    What does that mean? "Can lead to a shorter path" does not
    necessarily mean that the immediately resulting path is shorter.

    Plus, as A.L. pointed out, "Hamiltonian path" means, as near as
    anyone can tell, the same problem as "Hamiltonian Circuit".
    Shorter? What does that even have to do with the problem?


    --
    --Bryan

  9. Default Re: A stupid thought about Hamilton Path problem

    Bryan Olson wrote:
    ....
    > What does that mean? "Can lead to a shorter path" does not
    > necessarily mean that the immediately resulting path is shorter.

    ....

    This is the essential problem, so far, with hill-climbing approaches to
    NP-complete problems. They tend to have local optima, where any single
    small change makes things worse, but improvement would be possible with
    a large change.

    Patricia

  10. Default Re: A stupid thought about Hamilton Path problem

    On Thu, 07 Dec 2006 13:04:13 GMT, Patricia Shanahan <pats{}acm.org>
    wrote:

    >Bryan Olson wrote:
    >...
    >> What does that mean? "Can lead to a shorter path" does not
    >> necessarily mean that the immediately resulting path is shorter.

    >...
    >
    >This is the essential problem, so far, with hill-climbing approaches to
    >NP-complete problems. They tend to have local optima, where any single
    >small change makes things worse, but improvement would be possible with
    >a large change.
    >
    >Patricia


    Don't pay attention, someone Booted Cat generates nonsense not only
    in this thread but also in others

    A.L.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 12-05-2004, 02:50 PM
  2. Replies: 5
    Last Post: 11-13-2004, 04:18 PM
  3. Replies: 2
    Last Post: 11-09-2004, 09:24 AM
  4. This problem might be harder than I thought...
    By Application Development in forum Inetserver
    Replies: 1
    Last Post: 08-10-2003, 06:50 PM