Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
2  
Indeed for the first kind (a closed walk), any connected graph is sufficient. –  Luke Mathieson Nov 6 '12 at 0:23
    
ahh thanks! i wonder why that didn't come to me... –  Aden Dong Nov 6 '12 at 3:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.