5 The Mathematics of Getting Around

Slides:



Advertisements
Similar presentations
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.
Advertisements

BY: MIKE BASHAM, Math in Scheduling. The Bridges of Konigsberg.
Euler Circuits and Paths
E ULERIZING G RAPHS Notes 25 - Section 5.7. E SSENTIAL L EARNINGS Students will understand and be able to use Eulerization to find optimal exhaustive.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
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.
Euler Circuit Chapter 5. Fleury’s Algorithm Euler’s theorems are very useful to find if a graph has an Euler circuit or an Euler path when the graph is.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Math for Liberal Studies.  Here is a map of the parking meters in a small neighborhood  Our goal is to start at an intersection, check the meters, and.
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.
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 7 The Mathematics of Networks 7.1Trees 7.2Spanning Trees 7.3 Kruskal’s.
 Jim has six children.  Chris fights with Bob,Faye, and Eve all the time; Eve fights (besides with Chris) with Al and Di all the time; and Al and Bob.
Programming for Geographical Information Analysis: Advanced Skills Online mini-lecture: Introduction to Networks Dr Andy Evans.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
Spring 2015 Mathematics in Management Science Euler’s Theorems Euler Circuits & Paths ECT & EPT Burning Bridges Fleury’s Algorithm.
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
Euler Paths & Euler Circuits
The Mathematics of Getting Around
Spring 2015 Mathematics in Management Science Chinese Postman Problem What is CPP? CPP & ECs & EPs Fleury’s Algorithm Eulerization.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 6 The Mathematics of Touring 6.1Hamilton Paths and Hamilton Circuits.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
Graphs, Puzzles, & Map Coloring
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.
Copyright © 2014, 2010, 2007 Pearson Education, Inc. Section 4.1, Slide 1 4 Graph Theory (Networks) The Mathematics of Relationships 4.
Aim: What is an Euler Path and Circuit?
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
Mathematics in Management Science
AND.
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.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 14.2 Euler Paths, and Euler Circuits.
Chapter 6: Graphs 6.1 Euler Circuits
Excursions in Modern Mathematics, 7e: Copyright © 2010 Pearson Education, Inc. 5 The Mathematics of Getting Around 5.1Euler Circuit Problems 5.2What.
Walks, Paths and Circuits. A graph is a connected graph if it is possible to travel from one vertex to any other vertex by moving along successive edges.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Fleury's Algorithm Euler Circuit Algorithm
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,
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics Sixth Edition
Excursions in Modern Mathematics Sixth Edition
FLOWCHARTS Part 1.
CSNB 143 Discrete Mathematical Structures
Çizge Algoritmaları.
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
5 The Mathematics of Getting Around
Can you draw this picture without lifting up your pen/pencil?
Euler Circuits and Paths
This unit is all about Puzzles Games Strategy.
Euler Paths & Euler Circuits
Excursions in Modern Mathematics Sixth Edition
5 The Mathematics of Getting Around
Konigsberg- in days past.
Presented By: David Miller
Euler Circuits and Paths
5 The Mathematics of Getting Around
Discrete Mathematics Lecture 13_14: Graph Theory and Tree
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Hamilton Paths and Hamilton Circuits
Warm Up – 3/19 - Wednesday Give the vertex set. Give the edge set.
A Survey of Mathematics with Applications
5 The Mathematics of Getting Around
7 The Mathematics of Networks
5 The Mathematics of Getting Around
Presentation transcript:

5 The Mathematics of Getting Around 5.1 Euler Circuit Problems 5.2 What Is a Graph? 5.3 Graph Concepts and Terminology 5.4 Graph Models 5.5 Euler’s Theorems 5.6 Fleury’s Algorithm 5.7 Eulerizing Graphs

Algorithms When the graph has an Euler circuit or path, how do we find it? For small graphs, simple trial-and-error usually works fine, but real-life applications sometimes involve graphs with hundreds, or even thousands, of vertices. In these cases a trial-and-error approach is out of the question, and what is needed is a systematic strategy that tells us how to create an Euler circuit or path. In other words, we need an algorithm.

Algorithms There are many types of problems that can be solved by simply following a set of procedural rules–very specific rules like when you get to this point, do this, ... after you finish this, do that, and so on. Given a specific problem X, an algorithm for solving X is a set of procedural rules that, when followed, always lead to some sort of “solution” to X. X need not be a mathematics problem–algorithms are used, sometimes unwittingly, in all walks of life:

Algorithms directions to find someone’s house, the instructions for assembling a new bike, or a recipe for baking an apple pie are all examples of real-life algorithms. A useful analogy is to think of the problem as a dish we want to prepare and the algorithm as a recipe for preparing that dish. In mathematics, algorithms are either formula driven (you just apply the formula or formulas to the appropriate inputs) or directive driven (you must follow a specific set of directives).

Fleury’s Algorithm We will now turn our attention to an algorithm that finds an Euler circuit or an Euler path in a connected graph. Technically speaking, these are two separate algorithms, but in essence they are identical, so they can be described as one. The idea behind Fleury’s algorithm can be paraphrased by that old piece of folk wisdom: Don’t burn your bridges behind you.

Fleury’s Algorithm In graph theory the word bridge has a very specific meaning–it is the only edge connecting two separate sections (call them A and B) of a graph, as illustrated in Fig. 5-18.

Fleury’s Algorithm Thus, Fleury’s algorithm is based on a simple principle: To find an Euler circuit or an Euler path, bridges are the last edges you want to cross. Our concerns lie only on how we are going to get around the yet-to-be-traveled part of the graph. Thus, when we talk about bridges that we want to leave as a last resort,we are really referring to bridges of the to-be-traveled part of the graph.

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 just two odd vertices (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.]

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. ■ 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.]

Fleury’s Algorithm Bookkeeping In implementing Fleury’s algorithm it is critical to separate the past (the part of the graph that has already been traveled) from the future (the part of the graph that still needs to be traveled). While there are many different ways to accomplish this (you are certainly encouraged to come up with one of your own), a fairly reliable way goes like this: Start with two copies of the graph. Copy 1 is to keep track of the “future”; copy 2 is to keep track of the “past.”

Fleury’s Algorithm Bookkeeping Every time you travel along an edge, erase the edge from copy 1, but mark it (say in red) and label it with the appropriate number on copy 2. As you move forward, copy 1 gets smaller and copy 2 gets redder. At the end, copy 1 has disappeared; copy 2 shows the actual Euler circuit or path.

Example 5.20 Implementing Fleury’s Algorithm The graph in Fig. 5-19(a) is a very simple graph – it would be easier to find an Euler circuit just by trial-and-error than by using Fleury’s algorithm. Nonetheless, we will do it using Fleury’s algorithm. The real purpose of the example is to see the algorithm at work.Each step of the algorithm is explained in Figs. 5-19(b) through (h).

Example 5.20 Implementing Fleury’s Algorithm Start: We can pick any starting point we want. Let’s say we start at F.

Example 5.20 Implementing Fleury’s Algorithm Step 1: Travel from F to C. (Could have also gone from F to D.)

Example 5.20 Implementing Fleury’s Algorithm Step 2: Travel from C to D. (Could have also gone to A or to E.)

Example 5.20 Implementing Fleury’s Algorithm Step 3: Travel from D to A. (Could have also gone to B but not to F – DF is a bridge!)

Example 5.20 Implementing Fleury’s Algorithm Step 4: Travel from A to C. (Could have also gone to E but not to B – AB is a bridge!)

Example 5.20 Implementing Fleury’s Algorithm Step 5: Travel from C to E. (There is no choice!)

Example 5.20 Implementing Fleury’s Algorithm Steps 6, 7, 8, and 9: Only one way to go at each step.

Example 5.21 Fleury’s Algorithm for Euler Paths We will apply Fleury’s algorithm to the graph in Fig. 5-20.

Example 5.21 Fleury’s Algorithm for Euler Paths Since it would be a little impractical to show each step of the algorithm with a separate picture as we did in Example 5.20, you are going to have to do some of the work. Start by making two copies of the graph. ■ Start. This graph has two odd vertices, E and J. We can pick either one as the starting vertex. Let’s start at J.

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 1. From J we have five choices, all of which are OK. We’ll randomly pick K. (Erase JK on copy 1, and mark and label JK with a 1 on copy 2.) ■ Step 2. From K we have three choices (B, L, or H). Any of these choices is OK. Say we choose B. (Now erase KB from copy 1 and mark and label KB with a 2 on copy 2.)

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 3. From B we have three choices (A, C, or J). Any of these choices is OK. Say we choose C. (Now erase BC from copy 1 and mark and label BC with a 3 on copy 2.) ■ Step 4. From C we have three choices (D, E, or L). Any of these choices is OK. Say we choose L. (EML–that’s shorthand for erase, mark, and label.)

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 5. From L we have three choices (E, G, or K). Any of these choices is OK. Say we choose K. (EML.) ■ Step 6. From K we have only one choice– to H. We choose H. (EML.)

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 7. From H we have three choices (G, I, or J). We should not choose G, as HG is a bridge of the yet-to-be-traveled part of the graph (see Fig. 5-21).

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 7. Either of the other two choices is OK. Say we choose J. (EML.)

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 8. From J we have three choices (A, B, or I), but we should not choose I, as JI has just become a bridge. Either of the other two choices is OK. Say we choose B. (EML) ■ Step 9 through 13. Each time we have only one choice. From B we have to go to A, then to J, I, H, and G.

Example 5.21 Fleury’s Algorithm for Euler Paths ■ Step 14 through 21. Not to belabor the point, let’s just cut to the chase. The rest of the path is given by G, F, E, D, C, E, G, L, E. There are many possible endings, and you should find a different one by yourself. The completed Euler path (one of hundreds of possible ones) is shown in Fig. 5-22.

Example 5.21 Fleury’s Algorithm for Euler Paths