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.

Slides:



Advertisements
Similar presentations
Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Advertisements

Graphs and Finding your way in the wilderness
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
Reduction Techniques Restriction Local Replacement Component Design Examples.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
SubSea: An Efficient Heuristic Algorithm for Subgraph Isomorphism Vladimir Lipets Ben-Gurion University of the Negev Joint work with Prof. Ehud Gudes.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
GRAPH Learning Outcomes Students should be able to:
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
MCS312: NP-completeness and Approximation Algorithms
Graphs Chapter 10.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graphs Rosen, Chapter 8. Isomorphism (Rosen 560 to 563) Are two graphs G1 and G2 of equal form? That is, could I rename the vertices of G1 such that the.
Constructing Hamiltonian Circuits When all nodes have degree of at least n/2 (Also: an implementation in C++ using Boost) Presented by Alan SUnMaRC,
An Improved Degree Based Condition for Hamiltonian Cycles November 22, 2005 November 22, 2005.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CS 200 Algorithms and Data Structures
More Computational Complexity Shirley Moore CS4390/5390 Fall August 29,
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Data Structures & Algorithms Graphs
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
NP-Complete problems.
Graphs. Graphs Similar to the graphs you’ve known since the 5 th grade: line graphs, bar graphs, etc., but more general. Those mathematical graphs are.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Hamiltonian Cycles Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
NPC.
Euler and Hamiltonian Graphs
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Graphs. Graph Definitions A graph G is denoted by G = (V, E) where  V is the set of vertices or nodes of the graph  E is the set of edges or arcs connecting.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
David Stotts Computer Science Department UNC Chapel Hill.
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
The Theory of NP-Completeness
Data Structures Graphs - Terminology
Euler and Hamiltonian Graphs
Graphs Rosen, Chapter 8.
Hamiltonian Cycles and paths
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Discrete Maths 9. Graphs Objective
Hamiltonian Cycles.
Euler and Hamiltonian Graphs
The Theory of NP-Completeness
Euler circuit Theorem 1 If a graph G has an Eulerian path, then it must have exactly two odd vertices. Theorem 2 If a graph G has an Eulerian circuit,
Presentation transcript:

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). A graph is Hamiltonian iff a Hamiltonian cycle (HC) exists.

History 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

History 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

History 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)

History Fraudee, Dould, Jacobsen, Schelp (1989) If G is a 2-connected graph such that for every pair of nonadjacent nodes u and v, |d(u)+d(v)|>=(2n-1)/3 then G is Hamiltonian

Application Hamiltonian cycles in fault random geometric network In a network, if Hamiltonian cycles exist, the fault tolerance is better.

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 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 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 Heuristic algorithm Pósa, UHC, DHC, HAM, etc Backtrack algorithm 595HAM, KTC, MultiPath

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 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 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 Algorithm Advantage: Fast. Linear or low-order polynomial time Disadvantage Maybe can not find the HC

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

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; Else Do cycle extension or rotational transformation; } Check termination condition and change P } }}

Cycle Extention x1x1 xixi x i+1 u xkxk Path P: xixi x1x1 xkxk x i+1 u Path P’:

Rotational transformation x1x1 xixi x i+1 xkxk Path P: xixi x1x1 x i+1 xkxk Path P’:

Results

Problems 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