Euler Paths and Euler Circuits

Transcription

1 Euler Paths and Euler Circuits An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler path starts and ends at different vertices. An Euler circuit starts and ends at the same vertex.

6 Euler Paths and Euler Circuits Is it possible to determine whether a graph has an Euler path or an Euler circuit, without necessarily having to find one explicitly?

7 The Criterion for Euler Paths Suppose that a graph has an Euler path P.

8 The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting and ending vertices, the path P enters v the same number of times that it leaves v (say s times).

9 The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting and ending vertices, the path P enters v the same number of times that it leaves v (say s times). Therefore, there are 2s edges having v as an endpoint.

10 The Criterion for Euler Paths Suppose that a graph has an Euler path P. For every vertex v other than the starting and ending vertices, the path P enters v the same number of times that it leaves v (say s times). Therefore, there are 2s edges having v as an endpoint. Therefore, all vertices other than the two endpoints of P must be even vertices.

11 The Criterion for Euler Paths Suppose the Euler path P starts at vertex x and ends at y.

12 The Criterion for Euler Paths Suppose the Euler path P starts at vertex x and ends at y. Then P leaves x one more time than it enters, and leaves y one fewer time than it enters.

13 The Criterion for Euler Paths Suppose the Euler path P starts at vertex x and ends at y. Then P leaves x one more time than it enters, and leaves y one fewer time than it enters. Therefore, the two endpoints of P must be odd vertices.

14 The Criterion for Euler Paths The inescapable conclusion ( based on reason alone! ): If a graph G has an Euler path, then it must have exactly two odd vertices. Or, to put it another way, If the number of odd vertices in G is anything other than 2, then G cannot have an Euler path.

15 The Criterion for Euler Circuits Suppose that a graph G has an Euler circuit C.

16 The Criterion for Euler Circuits Suppose that a graph G has an Euler circuit C. For every vertex v in G, each edge having v as an endpoint shows up exactly once in C.

17 The Criterion for Euler Circuits Suppose that a graph G has an Euler circuit C. For every vertex v in G, each edge having v as an endpoint shows up exactly once in C. The circuit C enters v the same number of times that it leaves v (say s times), so v has degree 2s.

18 The Criterion for Euler Circuits Suppose that a graph G has an Euler circuit C. For every vertex v in G, each edge having v as an endpoint shows up exactly once in C. The circuit C enters v the same number of times that it leaves v (say s times), so v has degree 2s. That is, v must be an even vertex.

19 The Criterion for Euler Circuits The inescapable conclusion ( based on reason alone ): If a graph G has an Euler circuit, then all of its vertices must be even vertices. Or, to put it another way, If the number of odd vertices in G is anything other than 0, then G cannot have an Euler circuit.

20 Things You Should Be Wondering Does every graph with zero odd vertices have an Euler circuit? Does every graph with two odd vertices have an Euler path? Is it possible for a graph have just one odd vertex?

25 The Handshaking Theorem Why Handshaking? If n people shake hands, and the i th person shakes hands d i times, then the total number of handshakes that take place is d 1 + d d n 1 + d n. 2 (How come? Each handshake involves two people, so the number d 1 + d d n 1 + d n counts every handshake twice.)

26 The Number of Odd Vertices The number of edges in a graph is which must be an integer. d 1 + d d n 2

27 The Number of Odd Vertices The number of edges in a graph is which must be an integer. d 1 + d d n 2 Therefore, d 1 + d d n must be an even number.

28 The Number of Odd Vertices The number of edges in a graph is which must be an integer. d 1 + d d n 2 Therefore, d 1 + d d n must be an even number. Therefore, the numbers d 1, d 2,, d n must include an even number of odd numbers.

29 The Number of Odd Vertices The number of edges in a graph is which must be an integer. d 1 + d d n 2 Therefore, d 1 + d d n must be an even number. Therefore, the numbers d 1, d 2,, d n must include an even number of odd numbers. Every graph has an even number of odd vertices!

30 Back to Euler Paths and Circuits Here s what we know so far: # odd vertices Euler path? Euler circuit? 0 No Maybe 2 Maybe No 4, 6, 8,... No No 1, 3, 5,... No such graphs exist! Can we give a better answer than maybe?

32 Euler Paths and Circuits The Last Word Here is the answer Euler gave: # odd vertices Euler path? Euler circuit? 0 No Yes* 2 Yes* No 4, 6, 8,... No No 1, 3, 5, No such graphs exist * Provided the graph is connected. Next question: If an Euler path or circuit exists, how do you find it?

33 Bridges Removing a single edge from a connected graph can make it disconnected. Such an edge is called a bridge.

34 Bridges Removing a single edge from a connected graph can make it disconnected. Such an edge is called a bridge.

35 Bridges Removing a single edge from a connected graph can make it disconnected. Such an edge is called a bridge.

36 Bridges Loops cannot be bridges, because removing a loop from a graph cannot make it disconnected. e delete loop e

37 Bridges If two or more edges share both endpoints, then removing any one of them cannot make the graph disconnected. Therefore, none of those edges is a bridge. A B C delete multiple edges D

38 Bridges If two or more edges share both endpoints, then removing any one of them cannot make the graph disconnected. Therefore, none of those edges is a bridge. A B C delete multiple edges D

41 Finding Euler Circuits and Paths There are two odd vertices, A and F. Let s start at F. B A C D E F

42 Finding Euler Circuits and Paths Start walking at F. When you use an edge, delete it. B A C D E F

43 Finding Euler Circuits and Paths Path so far: FE A B C D E F

44 Finding Euler Circuits and Paths Path so far: FEA A B C D E F

45 Finding Euler Circuits and Paths Path so far: FEAC A B C D E F

46 Finding Euler Circuits and Paths Path so far: FEACB A B C D E F

47 Finding Euler Circuits and Paths Up until this point, the choices didn t matter.

48 Finding Euler Circuits and Paths Up until this point, the choices didn t matter. But now, crossing the edge BA would be a mistake, because we would be stuck there.

49 Finding Euler Circuits and Paths Up until this point, the choices didn t matter. But now, crossing the edge BA would be a mistake, because we would be stuck there. The reason is that BA is a bridge. We don t want to cross ( burn?) a bridge unless it is the only edge available.

61 Fleury s Algorithm To find an Euler path or an Euler circuit: 1. Make sure the graph has either 0 or 2 odd vertices.

62 Fleury s Algorithm To find an Euler path or an Euler circuit: 1. Make sure the graph has either 0 or 2 odd vertices. 2. If there are 0 odd vertices, start anywhere. If there are 2 odd vertices, start at one of them.

63 Fleury s Algorithm To find an Euler path or an Euler circuit: 1. Make sure the graph has either 0 or 2 odd vertices. 2. If there are 0 odd vertices, start anywhere. If there are 2 odd vertices, start at one of them. 3. Follow edges one at a time. If you have a choice between a bridge and a non-bridge, always choose the non-bridge.

64 Fleury s Algorithm To find an Euler path or an Euler circuit: 1. Make sure the graph has either 0 or 2 odd vertices. 2. If there are 0 odd vertices, start anywhere. If there are 2 odd vertices, start at one of them. 3. Follow edges one at a time. If you have a choice between a bridge and a non-bridge, always choose the non-bridge. 4. Stop when you run out of edges.

65 Fleury s Algorithm To find an Euler path or an Euler circuit: 1. Make sure the graph has either 0 or 2 odd vertices. 2. If there are 0 odd vertices, start anywhere. If there are 2 odd vertices, start at one of them. 3. Follow edges one at a time. If you have a choice between a bridge and a non-bridge, always choose the non-bridge. 4. Stop when you run out of edges. This is called Fleury s algorithm, and it always works!

Class One: Degree Sequences For our purposes a graph is a just a bunch of points, called vertices, together with lines or curves, called edges, joining certain pairs of vertices. Three small examples of

136 TER 4. INDUCTION, GRHS ND TREES 4.3 Graphs In this chapter we introduce a fundamental structural idea of discrete mathematics, that of a graph. Many situations in the applications of discrete mathematics

Graph Theory Origin and Seven Bridges of Königsberg -Rhishikesh Graph Theory: Graph theory can be defined as the study of graphs; Graphs are mathematical structures used to model pair-wise relations between

Sum of Degrees of Vertices Theorem Theorem (Sum of Degrees of Vertices Theorem) Suppose a graph has n vertices with degrees d 1, d 2, d 3,...,d n. Add together all degrees to get a new number d 1 + d 2

Chapter 11 Graph Theory The origins of graph theory are humble, even frivolous. Biggs, E. K. Lloyd, and R. J. Wilson) (N. Let us start with a formal definition of what is a graph. Definition 72. A graph

ICS 6D Due: Wednesday, February 25, 2015 Instructor: Sandy Irani Notes on Matrix Multiplication and the Transitive Closure An n m matrix over a set S is an array of elements from S with n rows and m columns.

Basic Notions on Graphs Planar Graphs and Vertex Colourings Presented by Joe Ryan School of Electrical Engineering and Computer Science University of Newcastle, Australia Planar graphs Graphs may be drawn

Determining If Two Graphs Are Isomorphic 1 Given two graphs, it is often really hard to tell if they ARE isomorphic, but usually easier to see if they ARE NOT isomorphic. Here is our first idea to help

raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

1 Digraphs Definition 1 Adigraphordirected graphgisatriplecomprisedofavertex set V(G), edge set E(G), and a function assigning each edge an ordered pair of vertices (tail, head); these vertices together

Max Flow, Min Cut, and Matchings (Solution) 1. The figure below shows a flow network on which an s-t flow is shown. The capacity of each edge appears as a label next to the edge, and the numbers in boxes

Discrete Mathematics Lent 2009 MA210 Solutions to Exercises 8 (1) Suppose that G is a graph in which every vertex has degree at least k, where k 1, and in which every cycle contains at least 4 vertices.

Chapter 6: Graph Theory Graph theory deals with routing and network problems and if it is possible to find a best route, whether that means the least expensive, least amount of time or the least distance.

Bridgewater State University Virtual Commons - Bridgewater State University Honors Program Theses and Projects Undergraduate Honors Program 5-2-2016 (Knight) 3 : A Graphical Perspective of the Knight's

CS311H Prof: Department of Computer Science The University of Texas at Austin Good Morning, Colleagues Good Morning, Colleagues Are there any questions? Logistics Class survey Logistics Class survey Homework

1. GRAPHS AND COLORINGS Definition. A graph is a collection of vertices, and edges between them. They are often represented by a drawing: 3 vertices 3 edges 4 vertices 4 edges 4 vertices 6 edges A graph

Notes on polyhedra and 3-dimensional geometry Judith Roitman / Jeremy Martin April 23, 2013 1 Polyhedra Three-dimensional geometry is a very rich field; this is just a little taste of it. Our main protagonist

page 1 of Section 2.1 HPTR 2 GRPHS STION 1 INTROUTION basic terminology graph is a set of finitely many points called vertices which may be connected by edges. igs 1 3 show three assorted graphs. v1 v2

Math 104, Graph Theory February 19, 2013 Measure of connectivity How connected are each of these graphs? > increasing connectivity > I G 1 is a tree, so it is a connected graph w/minimum # of edges. Every

COLORED GRAPHS AND THEIR PROPERTIES BEN STEVENS 1. Introduction This paper is concerned with the upper bound on the chromatic number for graphs of maximum vertex degree under three different sets of coloring

Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

Zachary Monaco Georgia College Olympic Coloring: Go For The Gold Coloring the vertices or edges of a graph leads to a variety of interesting applications in graph theory These applications include various

Chapter 4 Trees 4.1 Basics A tree is a connected graph with no cycles. A forest is a collection of trees. A vertex of degree one, particularly in a tree, is called a leaf. Trees arise in a variety of applications.

Section 6.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of ordered pairs to R to obtain property P. In

1. (Chapter 1 supplementary, problem 7): There are 12 men at a dance. (a) In how many ways can eight of them be selected to form a cleanup crew? (b) How many ways are there to pair off eight women at the

4 Graph Theory Throughout these notes, a graph G is a pair (V, E) where V is a set and E is a set of unordered pairs of elements of V. The elements of V are called vertices and the elements of E are called

Homework MA 725 Spring, 2012 C. Huneke SELECTED ANSWERS 1.1.25 Prove that the Petersen graph has no cycle of length 7. Solution: There are 10 vertices in the Petersen graph G. Assume there is a cycle C

PROBLEM ONE (Trees) Homework 15 Solutions 1. Recall the definition of a tree: a tree is a connected, undirected graph which has no cycles. Which of the following definitions are equivalent to this definition

CME 305: Discrete Mathematics and Algorithms 1 Basic Definitions and Concepts in Graph Theory A graph G(V, E) is a set V of vertices and a set E of edges. In an undirected graph, an edge is an unordered

49 6. ROUTING PROBLEMS 6.1. VEHICLE ROUTING PROBLEMS Vehicle Routing Problem, VRP: Customers i=1,...,n with demands of a product must be served using a fleet of vehicles for the deliveries. The vehicles,

CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

Math 443/543 Graph Theory Notes 4: Connector Problems David Glickenstein September 19, 2012 1 Trees and the Minimal Connector Problem Here is the problem: Suppose we have a collection of cities which we

Triangle deletion Ernie Croot February 3, 2010 1 Introduction The purpose of this note is to give an intuitive outline of the triangle deletion theorem of Ruzsa and Szemerédi, which says that if G = (V,

HOMEWORK #3 SOLUTIONS - MATH 3260 ASSIGNED: FEBRUARY 26, 2003 DUE: MARCH 12, 2003 AT 2:30PM (1) Show either that each of the following graphs are planar by drawing them in a way that the vertices do not

Graph A graph G consist of 1. Set of vertices V (called nodes), (V = {v1, v2, v3, v4...}) and 2. Set of edges E (i.e., E {e1, e2, e3...cm} A graph can be represents as G = (V, E), where V is a finite and

Shuffling, Cycles, and Matrices Warm up problem. Eight people stand in a line. From left to right their positions are numbered,,,... 8. The eight people then change places according to THE RULE which directs

Introduction to Graph Theory Instructor: Padraic Bartlett Lecture 4: The Chromatic Number Week 1 Mathcamp 2011 In our discussion of bipartite graphs, we mentioned that one way to classify bipartite graphs

7 Basic Properties 24 TREES 7 Basic Properties Definition 7.1: A connected graph G is called a tree if the removal of any of its edges makes G disconnected. A tree can be defined in a variety of ways as

arxiv:1205.5492v1 [math.co] 24 May 2012 Partitioning edge-coloured complete graphs into monochromatic cycles and paths Alexey Pokrovskiy Departement of Mathematics, London School of Economics and Political

6. GRPH ND MP COLOURING 6.1. Graph Colouring Imagine the task of designing a school timetable. If we ignore the complications of having to find rooms and teachers for the classes we could propose the following

Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes.

Graph theory and network analysis Devika Subramanian Comp 140 Fall 2008 1 The bridges of Konigsburg Source: Wikipedia The city of Königsberg in Prussia was set on both sides of the Pregel River, and included

Finding and counting given length cycles Noga Alon Raphael Yuster Uri Zwick Abstract We present an assortment of methods for finding and counting simple cycles of a given length in directed and undirected

UPPER BOUNDS ON THE L(2, 1)-LABELING NUMBER OF GRAPHS WITH MAXIMUM DEGREE ANDREW LUM ADVISOR: DAVID GUICHARD ABSTRACT. L(2,1)-labeling was first defined by Jerrold Griggs [Gr, 1992] as a way to use graphs

Planar Graphs Complement to Chapter 2, The Villas of the Bellevue In the chapter The Villas of the Bellevue, Manori gives Courtel the following definition. Definition A graph is planar if it can be drawn

9 Properties of Trees. Definitions: Chapter 4: Trees forest - a graph that contains no cycles tree - a connected forest. Theorem: Let T be a graph with n vertices. Then the following statements are equivalent:

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one