Does the addition of a new vertex always guarantee a Hamiltonian path or cycle?

AI Thread Summary
The discussion centers on the relationship between Hamiltonian cycles (HC) and Hamiltonian paths (HP) in graph theory, as explored in a lecture from NPTEL. The key point is that if a graph G has a Hamiltonian cycle, it necessarily has a Hamiltonian path. The discussion further elaborates on a method to determine if G has a Hamiltonian path by constructing a new graph G' that includes an additional vertex connected to all vertices of G. The theorem states that G has a Hamiltonian path if and only if G' has a Hamiltonian cycle. The conversation highlights the implications of the HC algorithm's output: if HC indicates that G' has a cycle, then G has a path; if HC indicates no cycle exists in G', then G lacks a path. The clarity of this relationship is critical for understanding the computational complexity of determining Hamiltonian paths based on Hamiltonian cycles.
atrus_ovis
Messages
99
Reaction score
0
Watching this lecture from nptel about NP completeness:
http://www.youtube.com/watch?v=76n4BjlL1cs&feature=player_embedded

-We have an algorithm, HC , which given a graph tells us whether or not it has a hamiltonian cycle.
-We want to use it in order to create an algorithm that determines whether an input graph has a hamiltonian path.


If the input has a HC, then it has a HP as well.Okay.

But around 29:00, it is stated:

If the input doesn't have a HC (the output of HC algorithm is a "no"), we add a vertex to it that connects to all other vertices in the graph.If that new gragh G' has a HC, then the original graph G has a HP.
But thinking about this, how bout this example?

edit:in the pic, i meant to say that "graph G doesn't have a HP"
 

Attachments

  • ham.JPG
    ham.JPG
    9.4 KB · Views: 509
Last edited:
Technology news on Phys.org
You've misunderstood what the goal is. The goal is to find out whether G has a HP.
See: http://www.youtube.com/watch?v=76n4BjlL1cs&feature=youtu.be#t=21m08s"

The input is the Graph G' which consists of the original Graph G and the additional vertex u connected to all vertices of G.

We want to find out if G has a HP by using the following theorem:
G has a HP iff G' has a HC

In your example, let us pretend that we do not know whether G has a HP.
So, we form G' and use it as an input for HC. Now, there are two possible outcomes:
(i) HC says: yes, G' has a HC. It then follows that G has an HP.
(ii) HC says: no, G' has no HC. It then follows that G has no HP.
 
Last edited by a moderator:
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top