## Special case of Hamiltonian cycle

Moderator: Board moderators

alex[LSD]
Learning poster
Posts: 53
Joined: Sat Jan 24, 2004 9:22 pm
Location: Tomsk, Siberia, RUSSIA
Contact:

### Special case of Hamiltonian cycle

I need help with:
http://acm.sgu.ru/problem.php?contest=0&problem=122
If you don't want to open it, the problem is:
You have an undirected graph with N vertices. Each vertex has at least (N+1)/2 neighbours. Needed is to construct a hamiltonian cycle. I guess it is assumed that it always exists.
I heard people talk about some vertex merging technique, but I just couldn't come up with it. Too old and too dumb maybe. HEEEEELP!
The more contests are held, the happier I am.

nnahas
New poster
Posts: 40
Joined: Mon Nov 01, 2004 7:56 pm

### Re: Special case of Hamiltonian cycle

alex[LSD] wrote:I need help with:
http://acm.sgu.ru/problem.php?contest=0&problem=122
If you don't want to open it, the problem is:
You have an undirected graph with N vertices. Each vertex has at least (N+1)/2 neighbours. Needed is to construct a hamiltonian cycle. I guess it is assumed that it always exists.
I heard people talk about some vertex merging technique, but I just couldn't come up with it. Too old and too dumb maybe. HEEEEELP!
Read the first section of this paper (Proof of Ore's theorem) :
http://www.ecp6.jussieu.fr/pageperso/ bondy/research/papers/shortproofs.ps

The proof implicitly gives an algorithm (O(V^2) if I am not mistaken) . Also there is a typo in the proof, so replace every occurence of "S+" with "S"

alex[LSD]
Learning poster
Posts: 53
Joined: Sat Jan 24, 2004 9:22 pm
Location: Tomsk, Siberia, RUSSIA
Contact:
Wow! You are everywhere! Great!
Thanks for the link, if by V you mean the number of vertices, than the ALGO looks pretty much like the one everybody has used.
10k u very much!
The more contests are held, the happier I am.

alex[LSD]
Learning poster
Posts: 53
Joined: Sat Jan 24, 2004 9:22 pm
Location: Tomsk, Siberia, RUSSIA
Contact:
Got AC, sad that I can't come up with trics like this.
The more contests are held, the happier I am.

nnahas
New poster
Posts: 40
Joined: Mon Nov 01, 2004 7:56 pm
alex[LSD] wrote:Got AC, sad that I can't come up with trics like this.
I don't know if that can make you feel better, but I didn't come up with it either. I just had studied the theorem (and its proof) when I was at university