Presentation is loading. Please wait.

Presentation is loading. Please wait.

Excursions in Modern Mathematics Sixth Edition

Similar presentations


Presentation on theme: "Excursions in Modern Mathematics Sixth Edition"— Presentation transcript:

1 Excursions in Modern Mathematics Sixth Edition
Peter Tannenbaum

2 Chapter 5 Euler Circuits
The Circuit Comes to Town

3 Euler Circuits Outline/learning Objectives
To identify and model Euler circuit and Euler path problems. To understand the meaning of basic graph terminology. To classify which graphs have Euler circuits or paths using Euler’s circuit theorems. To implement Fleury’s algorithm to find an Euler circuit or path when it exists. To eulerize or semi-eulerize graphs when necessary. To recognize an optimal eulerization (semi-eulerization) of a graph.

4 5.1 Euler Circuit Problems
Euler Circuits 5.1 Euler Circuit Problems

5 Euler Circuit Problems

6 Euler Circuit Problems
Who is Euler? Leonhard Euler ( ) A Swiss mathematician and physicist. Introduced many mathematical theories and notations. Most familiar with Graph Theory and the Konigsberg Bridge problem.

7 Euler Circuit Problems
What is a routing problem? Existence question Is an actual route possible? Optimization question Of all the possible routes, which one is the optimal route?

8 Euler Circuit Problems
We will answer both the existence and optimization questions for a special class of routing problems known as Euler circuit problems. The common thread is what we call the exhaustion requirement.

9 Euler Circuit Problems
Examples of services using exhaustive routes: Mail Police patrols Garbage collectors Street sweepers Snow removals

10 Euler Circuit Problems
A security officer is hired to take an exhaustive patrol, on foot, through the neighborhood. Is it possible? What is optimal? Walking the Hood

11 Euler Circuit Problems
The Seven Bridges of Konigsberg Cross all seven bridges. Only cross the bridges once. Euler’s 1735 paper on how to solve this problem is on moodle.

12 Euler Circuit Problems
The name of the game is to trace each drawing without lifting the pencil or retracing any of the lines. These kinds of tracings are called unicursal tracings.

13 Euler Circuit Problems
When we end in the same place we started, we call it a closed unicursal tracing; when we start and end in different places, we call it an open unicursal tracing.

14 Euler Circuits 5.2 What is a Graph?

15 What is a Graph? Graphs A graph is a structure that defines pairwise relationships within a set to objects. The objects are the vertices, and the pairwise relationships are the edges: X is related to Y if and only if XY is an edge.

16 What is a Graph? A graph is a picture consisting of: Vertices- dots
Edges- lines The edges do not have to be straight lines. But they have to connect two vertices. Loop- an edge connecting a vertex back with itself

17 What is a Graph? This graph has six vertices A, B, C, D, E, and F and eight edges. The edges can be described by giving the two vertices that are connected by the edge. Thus the edges are AB, AD, BB, BC, BE, CD, CD, and DE

18 What is a Graph? First, note that the point where edges BE and AD cross is not a vertex– it is just the crossing point of two edges. Second, that vertex F is not connected to any other vertex. Such a vertex is called an isolated vertex.

19 What is a Graph? Third, note that this graph has a loop, namely the edge BB. Finally, note that it is permissible to have two edges connecting the same two vertices, as in the case with C and D. When a graph has more than one edge connecting the same pair of vertices, it is said to have multiple edges.

20 What is a Graph? Relationship graph This graph is considered a single graph, even though it consists of two separate, disconnected pieces. Such graphs are called disconnected graph, and the individual pieces are called the components of the graph..

21 What is a Graph? A Graph with No Edges? Yes, its possible. Without edges, every vertex of the graph is an isolated vertex.

22 What is a Graph? Consider the graph with V = {K, R, S, T, W} and E = { RS, RT, TT, TS, SW, WW, WS}. Draw a picture of the graph.

23 5.3 Graph Concepts and Terminology
Euler Circuits 5.3 Graph Concepts and Terminology

24 Graph Concepts and Terminology
Adjacent vertices. Two vertices are said to be adjacent if there is an edge joining them. Vertices B and E are adjacent; C and D are not. Also because of the loop at E, we can say that Vertex E is adjacent to itself.

25 Graph Concepts and Terminology
Adjacent edges. Two edges are adjacent if they share a common vertex. AB and AD are adjacent; edges AB and DE are not.

26 Graph Concepts and Terminology
Degree of a vertex. The degree of a vertex is the number of edges at that vertex. When there is a loop at the vertex, the loop contributes twice. The deg(A) = 3, deg(B) = 5, deg(C) = 3, deg(D) = 2, deg(E) = 4, etc.

27 Graph Concepts and Terminology
Odd and even vertices. An odd vertex is a vertex of odd degree; an even vertex is a vertex of even degree. The graph has two even vertices (D and E) and six odd vertices (all the others).

28 Graph Concepts and Terminology
Paths. A path is a sequence of vertices with the property that each vertex in the sequence is adjacent to the next one. The key requirement in a path is that an edge can be part of a path only once.

29 Graph Concepts and Terminology
Paths (continued). The number of edges in the path is called the length of the path. A, B, E, D. This is a path from vertex A to D, consisting of the edges AB, BE, and ED. The length of this path is 3.

30 Graph Concepts and Terminology
Circuits. A circuit has the same definition as a path, but has the additional requirement that the trip starts and ends at the same vertex.

31 Graph Concepts and Terminology
Connected graphs. A graph is connected, if given any two vertices, there is a path joining them. A graph that is not connected is said to be disconnected. A disconnected graph is made up of separate components.

32 Graph Concepts and Terminology
Bridges. Sometimes in a connected graph there is an edge such that if we were to erase it, the graph would become disconnected— such an edge is called a bridge. BF, FG, and FH are bridges.

33 Graph Concepts and Terminology
Euler paths. An Euler path is a path that passes through every edge of a graph once and only once. The graph shown in (a) does not have an Euler path; the graph in (b) has several Euler paths. One of them is L,A,R,D,A,R,D,L,A.

34 Graph Concepts and Terminology
Euler circuits. An Euler circuit is a circuit that passes through every edge of a graph and returns to the starting point. One of them is L,A,R,D,A,R,D,L,A,L. Note an Euler circuit has an Euler path but an Euler path isn’t necessarily a circuit.

35 Euler Circuits 5.4 Graph Models

36 Graph Models The notion of using a mathematical concept to describe and solve a real-life problem is called modeling. Below is an example of how we can use graphs to model a problem.

37 Graph Models The only thing that truly matters to the solution of this
problem is the relationship between land masses (islands and banks) and bridges. Which land masses are connected to each other and by how many bridges?

38 Graph Models This information is captured by the red edges in (b). We
end up with the graph model shown in (c). The four vertices of the graph represent each of the four land masses; the edges represent the seven bridges.

39 Graph Models How many odd vertices? How many edges?
What is the degree of the vertex at A? What are the multiple edges?

40 Graph Models How many odd vertices? How many edges?
What is the degree of the vertex at P?

41 Euler Circuits 5.5 Euler’s Theorems

42 Euler’s Theorem Euler’s Circuit Theorem
If a graph is connected, and every vertex is even, then it has an Euler circuit (at least one, usually more). If a graph has any odd vertices, then it does not have an Euler circuit.

43 Euler’s Theorem The graph in (a ) cannot have an Euler circuit because it is disconnected. The graph in (b) has odd vertices (C is one of them, there are others). The graph in (c) is connected and all the vertices are even. The graph does have Euler circuits.

44 Euler’s Theorem Euler’s Path Theorem
If a graph is connected, and has exactly two odd vertices, then it has an Euler path (at least one, usually more). Any such path must start at one of the odd vertices and end at the other one. If a graph has more than two odd vertices, then it cannot have an Euler path.

45 Euler’s Theorem Euler’s Sum of Degrees Theorem
The sum of the degrees of all the vertices of a graph equals twice the number of edges (and therefore is an even number). A graph always has an even number of odd vertices.

46 Euler Circuits 5.6 Fleury’s Algorithm

47 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Preliminaries. Make sure that the graph is connected and either (1) has no odd vertices (circuit), or (2) has two odd vertices (path).

48 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Start. Choose a starting vertex. [ In case (1) this can be any vertex; in case (2) it must be one of the two odd vertices.]

49 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Intermediate steps. At each step, if you have a choice, don’t choose a bridge of the yet-to-be- traveled part of the graph. However, if you have only one choice, take it.

50 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Intermediate steps. At each step, if you have a choice, don’t choose a bridge of the yet-to-be- traveled part of the graph. However, if you have only one choice, take it.

51 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Intermediate steps. At each step, if you have a choice, don’t choose a bridge of the yet-to-be- traveled part of the graph. However, if you have only one choice, take it.

52 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Intermediate steps. At each step, if you have a choice, don’t choose a bridge of the yet-to-be- traveled part of the graph. However, if you have only one choice, take it.

53 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) Intermediate steps. At each step, if you have a choice, don’t choose a bridge of the yet-to-be- traveled part of the graph. However, if you have only one choice, take it.

54 Fleury’s Algorithm Fleury’s Algorithm for Finding an Euler Circuit (Path) End. When you can’t travel any more, the circuit (path) is complete. [In case (1) you will be back at the starting vertex; in case (2) you will end at the other odd vertex.]

55 Practice How many vertices and edges? What is the degree of vertex A?
Is an Euler Circuit possible? Is an Euler Path possible?

56 Practice How many vertices and edges? What is the degree of vertex A?
Is an Euler Circuit possible? Is an Euler Path possible?

57 Practice Euler Path, Circuit or None?
In an Euler Circuit start with A. In an Euler Path start with an odd vertex.

58 Practice Euler Path, Circuit or None?
In an Euler Circuit start with A. In an Euler Path start with an odd vertex.

59 Practice Euler Path, Circuit or None?
In an Euler Circuit start with A. In an Euler Path start with an odd vertex.

60 Practice Euler Path, Circuit or None?
In an Euler Circuit start with A. In an Euler Path start with an odd vertex.

61 Euler Circuits 5.7 Eulerizing Graphs

62 Eulerizing Graphs Now we will try to find exhaustive routes.
Goal: Find a route that recrosses the fewest number of edges. (deadhead) Eulerizing is the process of adding edges in strategic places leaving 0 odd vertexes. New edges must be duplicate of existing edges. Semi-Eulerizing leaves 2 odd vertexes in the graph. (Parade - Sometimes you want odd)

63 Eulerizing Graphs Eulerizing Graphs Our first step is to identify the odd vertices. This graph has eight odd vertices (B,C,E,F,H,I,K,and L), shown in red.

64 Eulerizing Graphs Eulerizing Graphs When we add a duplicate copy of edges BC,EF,HI, and KL, we get this graph. This is the eulerized version of the original graph.

65 Eulerizing Graphs Eulerizing Graphs This graph shows the many possible Euler circuits,with the edges numbered in the order they are traveled..

66 Eulerizing Graphs Eulerizing Graphs With the four duplicate edges (BC,EF,HI,and KL) indicating the deadhead blocks where a second pass is required. The total length of this route is 28 blocks (24 blocks in the grid plus 4 deadhead blocks).

67 Eulerizing Graphs Eulerizing Graphs In some situations we need to find an exhaustive route, but there is no requirement that it be closed—the route may start and end at different points.

68 Eulerizing Graphs Eulerizing Graphs In these cases, we want to leave two odd vertices on the graph unchanged, and change the other odd vertices into even vertices.

69 Eulerizing Graphs Eulerizing Graphs This process is called a semi-eulerization of the graph. In this case the route will start at one of the two odd vertices and end at the other one.

70 Euler Circuits Conclusion
Concept of a graph This idea can be traced back to Euler some 270 years ago. Concept of a graph model. We used graphs and mathematical theory of graphs to solve certain types of routing problems. Concept of an algorithm A set of procedural rules that helps us find Euler circuits or Euler path in a graph


Download ppt "Excursions in Modern Mathematics Sixth Edition"

Similar presentations


Ads by Google