Tutorial 5 of CSCI2110 Eulerian Path & Hamiltonian Cycle Tutor: Zhou Hong ( 周宏 )

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

CS 336 March 19, 2012 Tandy Warnow.
Great Theoretical Ideas in Computer Science
§5 Minimum Spanning Tree 【 Definition 】 A spanning tree of a graph G is a tree which consists of V( G ) and a subset of E( G ) 〖 Example 〗 A complete.
CS 253: Algorithms Chapter 22 Graphs Credit: Dr. George Bebis.
Chapter 8 Topics in Graph Theory
Graphs CSE 331 Section 2 James Daly. Reminders Homework 4 is out Due Thursday in class Project 3 is out Covers graphs (discussed today and Thursday) Due.
MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Introduction to Graphs
Great Theoretical Ideas in Computer Science for Some.
Introduction to Graph Theory Lecture 11: Eulerian and Hamiltonian Graphs.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Tutorial 6 of CSCI2110 Bipartite Matching Tutor: Zhou Hong ( 周宏 )
Combinatorial Algorithms
1 Discrete Structures & Algorithms Graphs and Trees: IV EECE 320.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
Section 2.1 Euler Cycles Vocabulary CYCLE – a sequence of consecutively linked edges (x 1,x2),(x2,x3),…,(x n-1,x n ) whose starting vertex is the ending.
What is the first line of the proof? a). Assume G has an Eulerian circuit. b). Assume every vertex has even degree. c). Let v be any vertex in G. d). Let.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Definition Hamiltonian graph: A graph with a spanning cycle (also called a Hamiltonian cycle). Hamiltonian graph Hamiltonian cycle.
An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began.
CSE 421 Algorithms Richard Anderson Lecture 2. Announcements Office Hours –Richard Anderson, CSE 582 Monday, 10:00 – 11:00 Friday, 11:00 – 12:00 –Yiannis.
1 CIS /204—Spring 2008 Recitation 10 Friday, April 4, 2008.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
1 Bipartite Matching Polytope, Stable Matching Polytope x1 x2 x3 Lecture 10: Feb 15.
4/17/2017 Section 8.5 Euler & Hamilton Paths ch8.5.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
What is the first line of the backwards direction of this proof? 1.Assume G is a block. 2.Assume every pair of vertices lie on a common cycle. 3.Assume.
Eulerian Graphs CSE 331 Section 2 James Daly. Reminders Project 3 is out Covers graphs Due Friday.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Constructing Hamiltonian Circuits When all nodes have degree of at least n/2 (Also: an implementation in C++ using Boost) Presented by Alan SUnMaRC,
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Adapted from a presentation by Stephen Rudich.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Presentation by Shuchi Chawla with some modifications.
Great Theoretical Ideas in Computer Science.
Stable Matching Lecture 7: Oct 3. Matching A B C DE Boys Girls Today’s goal: to “match” the boys and the girls in a “good” way.
Stable Marriages (Lecture modified from Carnegie Mellon University course Great Theoretical Ideas in Computer Science)
Bipartite Matching. Unweighted Bipartite Matching.
Great Theoretical Ideas in Computer Science for Some.
Shortest Path Based Sufficiency Condition for Hamiltonian Graphs
Matching Lecture 19: Nov 23.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Eulerian Paths and Cycles. What is a Eulerian Path Given an graph. Find a path which uses every edge exactly once. This path is called an Eulerian Path.
1.Quiz 5 due tomorrow afternoon in E309 from 1pm to 4pm. 2.Homework grades will be based on ten graded homework assignments (dropping the lowest one).
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Review Euler Graph Theory: DEFINITION: A NETWORK IS A FIGURE MADE UP OF POINTS (VERTICES) CONNECTED BY NON-INTERSECTING CURVES (ARCS). DEFINITION: A VERTEX.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 5.
NPC.
Introduction to Graph Theory
CSE 421 Algorithms Richard Anderson Autumn 2015 Lecture 5.
Graph Theory Def: A graph is a set of vertices and edges G={V,E} Ex. V = {a,b,c,d,e} E = {ab,bd,ad,ed,ce,cd} Note: above is a purely mathematical definition.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Great Theoretical Ideas in Computer Science
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
The Mathematics Of 1950’s Dating: Who wins The Battle of The Sexes?
Discrete Math II Howon Kim
Richard Anderson Autumn 2016 Lecture 5
Euler and Hamilton Paths
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,
Applied Combinatorics, 4th Ed. Alan Tucker
Richard Anderson Winter 2019 Lecture 5
Presentation transcript:

Tutorial 5 of CSCI2110 Eulerian Path & Hamiltonian Cycle Tutor: Zhou Hong ( 周宏 )

About Me Name: Zhou Hong ( 周宏 ) Office: SHB117 Office Hour: Friday 10:00 am – 12:00 noon or by appointment Topics Responsibility: Graph Theory

Outline Eulerian Path Hamiltonian Cycle Stable Matching

Eulerian Path & Eulerian Cycle Eulerian Path: a path that visits every edge exactly once Eulerian Cycle: a cycle that visits every edge exactly once

Exercise: T/F Questions A Simple Path is a Path A Simple Cycle is a Cycle A Simple Cycle is a Simple Path A Path is a Cycle A Eulerian Cycle is a Eulerian Path

Euler’s theorem: A connected graph has an Eulerian cycle if and only if every vertex is of even degree. Eulerian Cycle Necessary Condition for Eulerian Cycle: If a connected graph G has an Eulerian cycle, then every vertex in G is of even degree. Example: An Eulerian Cycle: Check that every vertex is of even degree

Euler’s theorem: A connected graph has an Eulerian cycle if and only if every vertex is of even degree. Eulerian Cycle

Euler’s theorem: A connected graph has an Eulerian path (but not cycle) if and only if there are two vertices with odd degrees. Necessary Condition for Eulerian Path: If a connected graph G has an Eulerian path (but not cycle), then exactly two vertices in G are of odd degrees. Example: An Eulerian Path: Check that only are of odd degrees. Eulerian Path

Euler’s theorem: A connected graph has an Eulerian path (but not cycle) if and only if there are two vertices with odd degrees. Eulerian Path

Euler’s theorem: A connected graph has an Eulerian path (but not cycle) if and only if there are two vertices with odd degrees. Sufficient Condition for Eulerian Path: In a connected graph G, if there are exactly two vertices have odd degrees, then G has an Eulerian Path (but not cycle). Exercise: Prove the above Sufficient Condition. (Hint: reduce to Eulerian Cycle) Eulerian Path

Proof of Sufficient Condition: Let the two odd degree vertices in G be u,v. Add an edge e between u,v to form a new connected graph G’. Now, every vertex in G’ has even degree. We have reduced to Eulerian cycle problem, therefore, G’ has an Eulerian cycle. Remove e from the cycle, we get a Eulerian path of G. (u,v are starting and ending points of the path) G u v G’ Eulerian Path

Hamiltonian Path & Hamiltonian Cycle Hamiltonian Path: a path that visits every vertex exactly once. Hamiltonian Cycle: a cycle that visits every vertex exactly once (except for the vertex that is both the start and end). A Hamiltonian Cycle in a dodecahedron

Hamiltonian Path in Homework 3 Tips: the following example is similar to Q3 of HW3, but not the same.

Hamiltonian Cycle in Undirected Graph Do we need to specify that G is connected? NO Exercise: Prove that minimum degree of G is at least n/2 implies G is connected Key Observation: Any pair of vertices share at least one common neighbor.

Proof Idea Start with a longest simple path P=v 1 v 2...v k. We can find a simple cycle C among v 1 to v k in graph G. If k < n, since G is connected, there must exists a vertex adjacent to some vertex in the cycle C. – Which implies we can get a longer simple path through C. vkvk v1v1 P…P… v2v2 v3v3 v4v4 v k-1 v k-2 v

Find a Simple Cycle vkvk v1v1 P…P… v2v2 v k-1 v k-2 vivi v i+1 Now, what we need to do is just finding a cycle among v 1 to v k. But how? If there exists a pair of vertices v i and v i+1, such that v i+1 is adjacent to v 1 and v i is adjacent to v k, then we can find a cycle C = v i+1 v i+2 …v k v i v i-1 …v 2 v 1 v i+1.

Existence of Such Vertex Pair v i and v i+1 vkvk v1v1 P…P… v2v2 v3v3 v4v4 v k-1 v k-2

Stable Matching

Morning: boys propose to their favorite girl on list. If a boy has an empty list already, he stays home and does his CSC2110 homework. Afternoon: girls accept their favorite suitor and reject the rest (possibly breaking up with her current boyfriend) Evening: boys who got rejected write off the top girl from their lists The Marrying Procedure This procedure is then repeated until all boys propose to a different girl

Boys Optimal & Girls Pessimal Algorithm All boys get the best partner simultaneously! All girls get the worst partner simultaneously! Can a girl do better by lying? That is, among all possible stable matching, boys get the best possible partners simultaneously. YES!

Girls with True Preference (Day 1) Boys A:213 B:123 C:231 1:ABC 2:BAC 3:CBA Girls

Girls with True Preference (Day 2) Boys A:213 B:123 C:231 1:ABC 2:BAC 3:CBA Girls OKAY, marriage day! Girl 2 gets her second best choice

Girl 2 Tells a Lie (Day 1) Boys A:213 B:123 C:231 1:ABC 2:BCA 3:CBA Girls

Girl 2 Tells a Lie (Day 2) Boys A:213 B:123 C:231 1:ABC 2:BCA 3:CBA Girls

Girl 2 Tells a Lie (Day 3) Boys A:213 B:123 C:231 1:ABC 2:BCA 3:CBA Girls

Girl 2 Tells a Lie (Day 4) Boys A:213 B:123 C:231 1:ABC 2:BCA 3:CBA Girls OKAY, marriage day! Girl 2 gets her best choice

Thank You! Q & A ?