hamiltonian cycles and paths l.
Skip this Video
Loading SlideShow in 5 Seconds..
Hamiltonian Cycles and paths PowerPoint Presentation
Download Presentation
Hamiltonian Cycles and paths

Loading in 2 Seconds...

play fullscreen
1 / 23

Hamiltonian Cycles and paths - PowerPoint PPT Presentation

  • Uploaded on

Hamiltonian Cycles and paths. Bin Zhou. Definitions. Hamiltonian cycle (HC): is a cycle which passes once and exactly once through every vertex of G (G can be digraph). Hamiltonian path: is a path which passes once and exactly once through every vertex of G (G can be digraph).

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Hamiltonian Cycles and paths' - Patman

Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
  • Hamiltonian cycle (HC): is a cycle which passes once and exactly once through every vertex of G (G can be digraph).
  • Hamiltonian path: is a path which passes once and exactly once through every vertex of G (G can be digraph).
  • A graph is Hamiltonian iff a Hamiltonian cycle (HC) exists.
  • Invented by Sir William Rowan Hamilton in 1859 as a game
  • Since 1936, some progress have been made
  • Such as sufficient and necessary conditions be given
  • G.A. Dirac, 1952,

If G is a simple graph with n(>=3) vertices, and if the degree of each is at least 1/2n, then G is Hamiltonian

  • O.Ore , 1960

If G is a simple graph with n(>=3) vertices, and if the sum of the degrees of each pair of non-adjacent vertices is at least n, then G is Hamiltonian

  • Bondy and Chvatal , 1976

For G to be Hamiltonian, it is necessary and sufficient that [G]n be Hamiltonian. ([G]n is gotten from G by adding edges joining non-adjacent vertices whose sum of degrees is equal to, or greater than n)

  • Fraudee, Dould, Jacobsen, Schelp (1989)

If G is a 2-connected graph such that for every pair of nonadjacent nodes u and v,


then G is Hamiltonian

  • Hamiltonian cycles in fault random geometric network
  • In a network, if Hamiltonian cycles exist, the fault tolerance is better.
hamiltonian problem is npc
Hamiltonian problem is NPC
  • This is a well known NP complete problem
  • For general graph, we can not find an exactly linear time complexity algorithm to find a Hamiltonian cycle or path
hc algorithms
HC algorithms
  • For general graphs, no efficient algorithm

NP-complete for perfect graphs, planar bipartite graphs, grid graphs, 3-connected planar graphs

  • For some special graphs, exist efficient algorithms.

N. Ghiba, T. Nishizeki (1989)

Polynomial algorithm for 4-connected planar graphs.

G.Gutin (1997)

Polynomial algorithm for quasi-transitive digraphs

some algorithms for hc
Some Algorithms for HC
  • L. Pósa (1976)

Rotational transformation

  • B. Bollobás, T.I.Fenner, and A. M. Frieze

Cycle extension (HAM) (1987)

  • Silvano Martello

Algorithm 595 (1983)

two classes of algorithms
Two classes of algorithms
  • Heuristic algorithm

Pósa, UHC, DHC, HAM, etc

  • Backtrack algorithm

595HAM, KTC, MultiPath

backtrack algorithm
Backtrack Algorithm
  • Recurse(Path p, endpoint e)
  • While (e has unvisited neighbors)

{ GetNewNode x; (add x node to P)

PruneGraph. (Prune graph. If result graph does not permit a HC forming, remove x from P and continue)

FormCycle (If P includes all nodes then try to form cycle. Fail, remove x and continue; Succ, return success)

BackTrack: Recurse(P,x)


Return fail.

backtrack algorithm13
Backtrack Algorithm
  • Search all the potential solutions
  • Employ pruning of some kind to restrict the amount of researching
  • Advantage:

Find all solution, can decide HC exists or not

  • Disadvantage

Worst case, needs exponential time. Normally, take a long time

heuristic algorithm
Heuristic Algorithm

Initialize path P

While {

Find new unvisited node.

If found { Extend path P and pruning on the graph. If this choice does not permit HC, remove the extended node.

} else

Transform Path. Try all possible endpoints of this path

Form cycle. Try to find HC


heuristic algorithm15
Heuristic Algorithm
  • Advantage:

Fast. Linear or low-order polynomial time

  • Disadvantage

Maybe can not find the HC

ham heuristic algorithm
Ham heuristic algorithm
  • Try to extend existing path and never decrease the path length
  • Do cycle extension
  • Do rotational transformation
ham algorithm
Ham algorithm

Start from a random node and find a neighbor to get a path P. |P|=2

Do {

Change partial path array A. oldlength=|P|.

While |P|==oldlength {

Find neighbors of P’s endpoints.Try to extend P.

For (each neighbor) do {

If Extendable

Extend and continue;


Do cycle extension or rotational transformation; }

Check termination condition and change P



cycle extention
Cycle Extention

Path P:






Path P’:






rotational transformation
Rotational transformation

Path P:





Path P’:





  • The program can not check large graph due to the memory restriction
  • May be need more conditions to decide the probability of HC exists
  • We can solve large problem using parallel computing