Eulerian Graphs CSE 331 Section 2 James Daly. Reminders Project 3 is out Covers graphs Due Friday.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

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.
Graph algorithms Prof. Noah Snavely CS1114
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
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.
Introduction to Graphs
Graph Theory: Euler Circuits Christina Mende Math 480 April 15, 2013.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
BY: MIKE BASHAM, Math in Scheduling. The Bridges of Konigsberg.
Euler Circuits and Paths
The Seven Bridges Of Konigsberg.
Koenigsberg bridge problem It is the Pregel River divided Koenigsberg into four distinct sections. Seven bridges connected the four portions of Koenigsberg.
Decision Maths Graphs Wiltshire Graphs A graph is just a diagram made up of “dots” and “lines”. These are all graphs. The dots are called “nodes” or.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 14 Strongly connected components Definition and motivation Algorithm Chapter 22.5.
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.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
Chapter 11 Graphs and Trees This handout: Terminology of Graphs Eulerian Cycles.
Graphs and Trees This handout: Terminology of Graphs Applications of Graphs.
Graphs and Euler cycles Let Maths take you Further…
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.
GRAPH Learning Outcomes Students should be able to:
Chapter 2 Graph Algorithms.
7.1 Introduction to Graph Theory
Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we can find a path that goes over all.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
CISC 235: Topic 9 Introduction to Graphs. CISC 235 Topic 92 Outline Graph Definition Terminology Representations Traversals.
Introduction to Graph Theory
Lecture 10: Graph-Path-Circuit
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
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.
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).
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Lecture 11: 9.4 Connectivity Paths in Undirected & Directed Graphs Graph Isomorphisms Counting Paths between Vertices 9.5 Euler and Hamilton Paths Euler.
Chapter 6: Graphs 6.1 Euler Circuits
Review Euler Graph Theory: DEFINITION: A NETWORK IS A FIGURE MADE UP OF POINTS (VERTICES) CONNECTED BY NON-INTERSECTING CURVES (ARCS). DEFINITION: A VERTEX.
Introduction to Graph Theory
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.1 Graphs, Paths, and Circuits.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
1 Euler and Hamilton paths Jorge A. Cobb The University of Texas at Dallas.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
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
Week 10 - Wednesday.  What did we talk about last time?  Counting practice  Pigeonhole principle.
STARTER: CAN YOU FIND A WAY OF CROSSING ALL THE BRIDGES EXACTLY ONCE? Here’s what this question would look like drawn as a graph.
Data Structures Graphs - Terminology
Euler Paths and Circuits
Graph theory Definitions Trees, cycles, directed graphs.
Graphs Chapter 13.
Genome Assembly.
Decision Maths Graphs.
Euler and Hamilton Paths
Graphs G = (V, E) V are the vertices; E are the edges.
Section 14.1 Graphs, Paths, and Circuits
Applied Combinatorics, 4th Ed. Alan Tucker
Graphs, Paths, and Circuits
Chapter 10 Graphs and Trees
Presentation transcript:

Eulerian Graphs CSE 331 Section 2 James Daly

Reminders Project 3 is out Covers graphs Due Friday

Review: Graphs G = (V, E) G is a graph V is a set of vertices / nodes E is a set of edges between vertices A vertex u is adjacent to vertex v if and only if the edge uv is in E

Graph Example V2V2 V1V1 V3V3 V5V5 V4V4 V1 is connected to V3 but not to V4

Review: Paths A path is a sequence of vertices v 1, v 2, …, v n such that v i v i+1 is in E for 1 ≤ i < n A simple path is a path where all vertices are distinct (except maybe the first and last) A cycle is a path that starts and ends at the same vertex

Seven Bridges of Konigsberg In Konigsberg (now Kaliningrad), can you cross each of the bridges exactly once? Image source: Wikipedia

Seven Bridges of Konigsberg The townsmen, after spending several hours drinking in the inn on the center island would try to walk the bridges Some would return after their success None could repeat it during the day

Proof Theorem: It is impossible to walk the bridges of Konigsburg Proof: After entering one of the banks by one bridge, you must leave by another. Thus you traverse an even number of bridges from each bank. The exception is where you start and end (which have an odd number) Since all four locales have an odd number of bridges, you cannot use all of the bridges

Eulerian Graphs An Eulerian path is a path which visits each edge exactly once An Eulerian cycle is a cycle which visits each edge exactly once A graph is Eulerian if it contains an Eulerian cycle A graph is semi-Eulerian if it contains an Eulerian path but not an Eulerian cycle

Eulerian Graphs Theorem: A graph is Eulerian iff it is connected and every vertex has even degree Proof: Since you must leave every vertex that you enter, each intermediate vertex must have edges in pairs, so they must have even degree. The exception is the first and last vertices. Since they are the same, they cancel out, leaving it with even degree. Corollary: A semi-Eulerian graph has exactly two vertices of odd degree.

Bridges of Kaliningrad Two of the bridges were destroyed during WW2 Two of the bridge were replaced Five bridges total A path exists, but it starts and ends on the islands Image Source: Wikipedia

Finding an Eulerian Path / Tour If all vertices have even degree Start anywhere and get an Eulerian Tour If exactly two have odd degree Start at one of them and get an Eulerian Path Otherwise no path exists Same algorithm works for both cases Works by a depth-first search

EulerianPath(V, E, v 0 ) C ← (v 0 ) // Linked list Ptr = C.Tail // Space after v 0 While (Ptr != C.Head) v ← Ptr.Prev If (deg(v) > 0) Pick u from Neighbors(v) E -= vu Ptr.InsertBefore(u) Else Ptr-- Return C