Hamiltonian Cycle |

A few definitions first:

**Definition 1**- A graph G = (V, E) is called ``dense'' if for each pair of non-adjacent
vertices
*u*and*v*, where*n*= |*V*| and denotes the degree of the vertex . **Definition 2**- A ``Hamiltonian cycle'' on G is a sequence of vertices
(
)
such that
for all
and {
*v*_{il},*v*_{il}} is an edge of G.

The problem is: write a program that, given a dense undirected graph G = (V; E) as input, determines
whether G admits a Hamiltonian cycle on G and outputs that cycle, if there is one,
or outputs ```N`'' if there is none.

*n*_{1}

*%*

*n*_{2}

*%*

where *n*_{i} is the number of vertices
(0 < *n*_{i} < 256)
and
are integers between 1 and *n* indicating that
there exists an edge between vertex *u*_{ih} and *u*_{il}

or containing:

`N`

4 1 2 2 3 2 4 3 4 3 1 % 6 1 2 1 3 1 6 3 2 3 4 5 2 5 4 6 5 6 4 %

1 2 4 3 1 1 3 2 5 4 6 1

Update: