World's most popular travel blog for travel bloggers.

[Solved]: Can a graph have a cycle containing all nodes but not Hamiltonian?

, , No Comments
Problem Detail: 

Is it possible for a graph to have a cycle that goes through all the nodes, but it does not have a Hamiltonian cycle (i.e. the cycle goes through some nodes more than once)? If yes, can anyone prove it? If not, can anyone give a counterexample?

Asked By : Aden Dong

Answered By : Vor

Just pick a tree which - by definition - doesn't have any simple cycle, but is connected, so you can visit all the nodes and return to the starting one but you must pass on some nodes more than once.

There are also graphs which have an Eulerian cycle (a cycle that traverses every edge exactly once) but not an Hamiltonian cycle. For example pick a graph made with two triangles having one vertex in common.

Best Answer from StackOverflow

Question Source :

3.2K people like this

 Download Related Notes/Documents


Post a Comment

Let us know your responses and feedback