0% found this document useful (0 votes)
23 views3 pages

Hamiltonian Cycle

A Hamiltonian cycle is a closed loop in an undirected graph that visits each vertex exactly once and returns to the starting point. There is no general method to determine the existence of a Hamiltonian cycle; exhaustive search is required. Hamiltonian cycles have applications in fields like computer graphics, genome mapping, and optimizing routes in school districts.

Uploaded by

munnasarker010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Hamiltonian Cycle

A Hamiltonian cycle is a closed loop in an undirected graph that visits each vertex exactly once and returns to the starting point. There is no general method to determine the existence of a Hamiltonian cycle; exhaustive search is required. Hamiltonian cycles have applications in fields like computer graphics, genome mapping, and optimizing routes in school districts.

Uploaded by

munnasarker010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Hamiltonian Cycle

Hamiltonian Path in an undirected graph is a path that visits each vertex exactly once. A
Hamiltonian cycle is a Hamiltonian Path such that there is an edge from the last vertex to the first
vertex of the Hamiltonian Path.

A Hamiltonian cycle is a closed loop on a graph where every node (vertex) is visited exactly
once.

A loop is just an edge that joins a node to itself; so a Hamiltonian cycle is a path traveling from a
point back to itself, visiting every node en route.

If a graph with more than one node has a Hamiltonian cycle, we call it a Hamiltonian graph.

There isn’t any equation or general trick to finding out whether a graph has a Hamiltonian cycle;
the only way to determine this is to do a complete and exhaustive search, going through all the
options.

Input:
A 2D array graph[V][V] where V is the number of vertices in graph and graph[V][V] is
adjacency matrix representation of the graph. A value graph[i][j] is 1 if there is a direct edge
from i to j, otherwise graph[i][j] is 0.

Output:
An array path[V] that should contain the Hamiltonian Path. path[i] should represent the ith
vertex in the Hamiltonian Path. The code should also return false if there is no Hamiltonian
Cycle in the graph.
Examples of Hamiltonian Graphs

Every complete graph with more than two vertices is a Hamiltonian graph. This follows from the
definition of a complete graph: an undirected, simple graph such that every pair of nodes is
connected by a unique edge.

The graph of every platonic solid is a Hamiltonian graph. So the graph of a cube, a tetrahedron,
an octahedron, or an icosahedron are all Hamiltonian graphs with Hamiltonian cycles.

o a complete graph with more than two vertices is Hamiltonian


o every cycle graph is Hamiltonian
o every platonic solid, considered as a graph, is Hamiltonian

History of the Hamiltonian Cycle

The Hamiltonian cycle was named after Sir William Rowan Hamilton who, in 1857, invented a
puzzle-game which involved hunting for a Hamiltonian cycle. The game, called the Icosian
game, was distributed as a dodecahedron graph with a hole at each vertex. To solve the puzzle or
win the game one had to use pegs and string to find the Hamiltonian cycle — a closed loop that
visited every hole exactly once. The solution is shown in the image above.

Applications of Hamiltonian cycles and Graphs

A search for Hamiltonian cycles isn’t just a fun game for the afternoon off. It has real
applications in such diverse fields as computer graphics, electronic circuit design, mapping
genomes, and operations research.

For instance, when mapping genomes scientists must combine many tiny fragments of genetic
code, into one single genomic sequence. This can be done by finding a Hamiltonian cycle or
Hamiltonian path, where each of the reads are considered nodes in a graph and each overlap is
considered to be an edge.

In a much less complex application of exactly the same math, school districts use Hamiltonian
cycles to plan the best route to pick up students from across the district. Here students may be
considered nodes, the paths between them edges, and the bus wishes to travel a route that will
pass each students house exactly once.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy