Euler Circuits and Paths

Slides:



Advertisements
Similar presentations
The Chinese Postman Problem Route Planning Map Colouring
Advertisements

Hamiltonian Circuits and Paths
Chapter 7 Graph Theory 7.1 Modeling with graphs and finding Euler circuits. Learning Objectives: Know how to use graphs as models and how to determine.
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.
AMDM UNIT 7: Networks and Graphs
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.
Homework collection Thursday 3/29 Read Pages 160 – 174 Page 185: 1, 3, 6, 7, 8, 9, 12 a-f, 15 – 20.
Euler and Hamilton Paths
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.
Discrete Math Round, Round, Get Around… I Get Around Mathematics of Getting Around.
The Bridge Obsession Problem By Vamshi Krishna Vedam.
Copyright © Cengage Learning. All rights reserved.
Can you find a way to cross every bridge only once?
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
1 Starter of the day 23 x 27 = x 47 = x 87 = x 55 = x 58 = ???? 54 x 56 = ???? Can you spot the trick for this group of.
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
Euler and Hamilton Paths
It's a world-wide webby wonderland.. Graphs are often used to represent real-world information and real-world structures. Graph Theory was even invented.
5.4 Graph Models (part I – simple graphs). Graph is the tool for describing real-life situation. The process of using mathematical concept to solve real-life.
Lecture 14: Graph Theory I Discrete Mathematical Structures: Theory and Applications.
Aim: What is an Euler Path and Circuit?
© Jalal Kawash 2010 Graphs Peeking into Computer Science.
Lecture 10: Graph-Path-Circuit
Vertex-Edge Graphs Euler Paths Euler Circuits. The Seven Bridges of Konigsberg.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
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.
© 2010 Pearson Prentice Hall. All rights reserved. CHAPTER 15 Graph Theory.
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
Aim: Graph Theory – Paths & Circuits Course: Math Literacy Do Now: Aim: What are Circuits and Paths? Can you draw this figure without retracing any of.
1) Find and label the degree of each vertex in the graph.
Graph Theory Euler Paths and Euler Circuits. Euler Paths & Circuits Euler Paths and Euler Circuits (Euler is pronounced the same as Oiler) An Euler path.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.1 Graphs, Paths, and Circuits.
Fleury's Algorithm Euler Circuit Algorithm
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics Sixth Edition
Çizge Algoritmaları.
Euler and Hamiltonian Graphs
Data Structures Graphs - Terminology
Euler and Hamiltonian Graphs
Euler Paths and Circuits
Konigsberg’s Seven Bridges
Euler Paths and Circuits
Graph Theory.
Introduction to Vertex-Edge graphs (2 days)
Excursions in Modern Mathematics Sixth Edition
Konigsberg- in days past.
Hamiltonian Circuits and Paths
Decision Maths Graphs.
Route Inspection Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we introduce a vertex.
Euler Circuits and Paths
Euler and Hamilton Paths
Euler and Hamiltonian Graphs
Chapter 1: Urban Services Management Science
Section 14.1 Graphs, Paths, and Circuits
Euler Paths and Euler Circuits
Graph Theory Relations, graphs
CHAPTER 15 Graph Theory.
Graphs, Paths, and Circuits
Warm Up – 3/19 - Wednesday Give the vertex set. Give the edge set.
Warm Up – 3/17 - Monday A) List the set of vertices.
Chapter 1: Urban Services Lesson Plan
A Survey of Mathematics with Applications
5 The Mathematics of Getting Around
Presentation transcript:

Euler Circuits and Paths

Exploration Is it possible to draw this figure without lifting your pencil from the paper and without tracing any of the lines more than once?

Leonard Euler This problem is an 18th century problem that intrigued Swiss mathematician Leonard Euler (1707-1783). This problem was posed by the residents of Königsberg, a city in what was then Prussia but is now Kaliningrad.

Königsberg Bridges In the 1700s, seven bridges connected two islands on the Pregel River to the rest of the city. The people wondered whether it would be possible to walk through the city by crossing each bridge exactly once and return to the original starting point.

Euler’s Solution Using a graph like the picture where the vertices represent the landmasses of the city and the edges represent the bridges, Euler was able to find that the desired walk throughout the city was not possible. In doing so, he also discovered a solution to problems of this general type.

Euler’s Solution (cont’d) Try to transverse the graph without lifting your pencil of tracing the lines more than once. When can you draw figures without retracing any of the edges and still end up at your starting point? When can you draw the figure without retracing and end up at a point other than the one from which you began? When can you not draw the figure without retracing?

Euler’s Solution (cont’d) Euler found that the key to the solution was related to the degrees of the vertices. Recall that the degree of a vertex is the number of the edges that have the vertex as an endpoint. Find the degree of each vertex of the graphs on the next slide. Do you see what Euler noticed?

Degree of the Vertex

Euler’s Solution Euler found that in order to be able to transverse each edge of a connected graph exactly once and to end at the starting vertex, the degree of each vertex of the graph must be even. (As only in the second graph)

Euler Circuits and Paths In his honor, a path that uses each edge of a graph exactly once and ends at the starting vertex is called an Euler circuit. Euler also noticed that if a connected graph had exactly two odd vertices, it was possible to use each edge of the graph exactly once but to end at a vertex different from the starting vertex. Such a path is called an Euler path.

Euler Circuits and Paths (cont’d) Notice that the first graph is an example of an Euler path. The last graph, however, has four odd vertices and so it cannot be traced without lifting the pencil. It is neither an Euler path nor an Euler circuit.

Finding Euler Circuits Finding an Euler circuit in a small graph can usually be found relatively easily by trial and error. However, as the number of vertices and edges increases, a systematic way of finding the circuit becomes necessary. The following algorithm gives one way of finding and Euler circuit for a connected graph with all vertices of even degree.

Euler Circuit Algorithm Pick any vertex and label it S. Construct a circuit, C, that begins and ends at S. If C is a circuit that includes all edges of the graph, go to Step 8. Choose a vertex, V, that is in C and has an edge that is not in C. Construct a circuit C’ that starts and ends at V using edges not in C.

Euler Circuit Algorithm (cont’d) Combine C and C’ to form a new circuit. Call this New circuit C. Go to Step 3. Stop. C is an Euler circuit for the graph.

Example Use the Euler circuit algorithm to find an Euler circuit for the graph below. c d a b e i f h g

Using the Algorithm Apply Step 1 of the algorithm. Choose vertex b, and label it S. Let C be the circuit S, c, d, e, a, S. C does not contain all edges of the graph, so go to Step 4 of the algorithm. Choose vertex d. Let C’ be the circuit d, g, f, e, g, h, e, I, h, b, d.

Algorithm (cont’d) Combine C and C’ by replacing vertex d in the circuit C with the circuit C’. Let C now be the circuit S, c, d, g, f, e, g, h, e, I, h, s, d, e, a, S. Go to Step 3 of the algorithm. C now contains all edges of the graph, so go to Step 8 of the algorithm and stop. C is an Euler circuit for the graph.

Directionality in Graphs Sometimes a graph application requires that edges have directionality. An example of this can be seen in a city that has one-way streets. A graph that has directed edges, edges that can be traversed in only one direction, is known as a digraph. The number of edges going into a vertex is known as the indegree of the vertex and the number of edges coming out of a vertex is known as the outdegree.

Ordered Edges= {AB, BA, BC, CA, DB, AD} An Example of a Digraph The digraph on the next slide can be described by the following set of vertices and set of ordered edges: Vertices={A, B, C, D} Ordered Edges= {AB, BA, BC, CA, DB, AD} If you follow the indicated direction of each edge, is it possible to draw this digraph and end up at the vertex where you started? That is, does the digraph have a directed circuit?

Digraph Check the indegree and outdegree of each vertex. A connected diagraph has a Euler circuit if the indegree and outdegree of each vertex are equal. B A C D

Practice Problems State whether the graph has an Euler circuit, an Euler path, or neither. Explain why. a. c. d. ` b.

Practice Problems (cont’d) 2. Sally began using the Euler circuit algorithm to find the Euler circuit for the graph below. She started at vertex d and labeled it S. The first circuit she found was S, e, f, a, b, c, S. Using Sally’s start, continue the algorithm, and find the Euler circuit for the graph. a b e g c d S f

Practice Problems (cont’d) 3. Use the Euler circuit algorithm to find an Euler circuit for the following graph: c d b e a h g f

Practice Problems (cont’d) The Euler circuit algorithm is to be used for “connected graphs with all vertices of even degree.” Why is it necessary to state that the graph must be connected? Give an example of a graph with all vertices of even degree that does not have an Euler circuit. Will a complete graph with two vertices have an Euler circuit? Three vertices? Four vertices? Five vertices, or n vertices?

Practice Problems (cont’d) 6. The present-day Königsberg has two more bridges than it did in Euler’s time. One more bridge was added to connect the two banks of the river, A to B, in the figure below. Another one was added to link the land to one of the islands, B to D. Is it now possible to make the famous walk and return to the starting point? A C D B

Practice Problems (cont’d) The streets of a city can be described by a graph in which the vertices represent the street corners and the edges represent the streets. Suppose you are the city street inspector and it is desirable to minimize time and cost by not inspecting the same street more than once.

Practice Problems (cont’d) Is it possible to begin at the garage (g) and inspect each street only once? Will you be back at the garage at the end of the inspection? Find a route that inspects all streets, repeats the number of edges and returns to the garage.

Practice Problems (cont’d) Diagram: a c b d e j f h i G

Practice Problems (cont’d) Construct the following digraphs: a. V={A, B, C, D, E} E={AB, CB, CE, DE, DA} b. V={W, X, Y, Z} E={WX, XZ, ZY, YW, XY, YX}

Practice Problems (cont’d) Determine whether the digraph has a directed Euler circuit. a. b. c.

Practice Problems (cont’d) Does the following digraph have a directed Euler circuit? Why or why not? Does it have a directed Euler path? If it does, which vertex must be the starting vertex? When does a digraph have an Euler path? f b c g d a e