Lesson 4.4. Euler Circuits and Paths. Explore This

Similar documents
COMP108 Algorithmic Foundations

Lecture 8: Graph-theoretic problems (again)

12/9/14. CS151 Fall 20124Lecture (almost there) 12/6. Graphs. Seven Bridges of Königsberg. Leonard Euler

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

CMPUT101 Introduction to Computing - Summer 2002

10.2 Graph Terminology and Special Types of Graphs

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Greedy Algorithm. Algorithm Fall Semester

Honors Thesis: Investigating the Algebraic Properties of Cayley Digraphs

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

Introduction to Algebra

Final Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms

CS 241 Week 4 Tutorial Solutions

Lecture 13: Graphs I: Breadth First Search

Chapter 4 Fuzzy Graph and Relation

Can Pythagoras Swim?

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

What are suffix trees?

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)

CS553 Lecture Introduction to Data-flow Analysis 1

Calculus Differentiation

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

MATH 25 CLASS 5 NOTES, SEP

CS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string.

Graph theory Route problems

COMP 423 lecture 11 Jan. 28, 2008

10.5 Graphing Quadratic Functions

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2: Solutions. Please write your name in the upper corner of each page.

Distance vector protocol

Adjacency. Adjacency Two vertices u and v are adjacent if there is an edge connecting them. This is sometimes written as u v.

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Line The set of points extending in two directions without end uniquely determined by two points. The set of points on a line between two points

Duality in linear interval equations

Graphs with at most two trees in a forest building process

[SYLWAN., 158(6)]. ISI

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

Troubleshooting. Verify the Cisco Prime Collaboration Provisioning Installation (for Advanced or Standard Mode), page

Typing with Weird Keyboards Notes

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

Tight triangulations: a link between combinatorics and topology

Outline. Motivation Background ARCH. Experiment Additional usages for Input-Depth. Regular Expression Matching DPI over Compressed HTTP

MITSUBISHI ELECTRIC RESEARCH LABORATORIES Cambridge, Massachusetts. Introduction to Matroids and Applications. Srikumar Ramalingam

Section 10.4 Hyperbolas

MTH 146 Conics Supplement

Chapter44. Polygons and solids. Contents: A Polygons B Triangles C Quadrilaterals D Solids E Constructing solids

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

UNCORRECTED SAMPLE PAGES. Angle relationships and properties of 6geometrical figures 1. Online resources. What you will learn

Measurement and geometry

CS201 Discussion 10 DRAWTREE + TRIES

Definition of Regular Expression

Pattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions

Answer Key Lesson 6: Workshop: Angles and Lines

COMBINATORIAL PATTERN MATCHING

Midterm 2 Sample solution

Fig.25: the Role of LEX

LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION

Lesson6: Modeling the Web as a graph Unit5: Linear Algebra for graphs

CS453 INTRODUCTION TO DATAFLOW ANALYSIS

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap

Problem Final Exam Set 2 Solutions

The Fundamental Theorem of Calculus

Journal of Combinatorial Theory, Series A

Width and Bounding Box of Imprecise Points

COMMON FRACTIONS. or a / b = a b. , a is called the numerator, and b is called the denominator.

5 ANGLES AND POLYGONS

The Math Learning Center PO Box 12929, Salem, Oregon Math Learning Center

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

Introduction. Example

Lecture 12 : Topological Spaces

Today. CS 188: Artificial Intelligence Fall Recap: Search. Example: Pancake Problem. Example: Pancake Problem. General Tree Search.

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

the machine and check the components AC Power Cord Carrier Sheet/ Plastic Card Carrier Sheet DVD-ROM

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence

McAfee Web Gateway

Intermediate Information Structures

Suffix Tries. Slides adapted from the course by Ben Langmead

Announcements. CS 188: Artificial Intelligence Fall Recap: Search. Today. Example: Pancake Problem. Example: Pancake Problem

Error Numbers of the Standard Function Block

Package Contents. Wireless-G USB Network Adapter with SpeedBooster USB Cable Setup CD-ROM with User Guide (English only) Quick Installation

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

Convex Hull Algorithms. Convex hull: basic facts

Angle Properties in Polygons. Part 1 Interior Angles

Math 227 Problem Set V Solutions. f ds =

GENG2140 Modelling and Computer Analysis for Engineers

Notes for Graph Theory

Stained Glass Design. Teaching Goals:

To access your mailbox from inside your organization. For assistance, call:

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

Single-Layer Trunk Routing Using 45-Degree Lines within Critical Areas for PCB Routing

Agilent Mass Hunter Software

WORKSHOP 9 HEX MESH USING SWEEP VECTOR

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)

Dynamic Programming. Andreas Klappenecker. [partially based on slides by Prof. Welch] Monday, September 24, 2012

Suffix trees, suffix arrays, BWT

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011

Transcription:

Lesson 4.4 Euler Ciruits nd Pths Now tht you re fmilir with some of the onepts of grphs nd the wy grphs onvey onnetions nd reltionships, it s time to egin exploring how they n e used to model mny different types of situtions. Explore This Consider the grph in Figure 4.7. Try to drw this figure without lifting your penil from the pper nd without tring ny of the lines more thn one. Is this possile? Figure 4.7. Grph. The grph in Figure 4.7 represents n eighteenth-entury prolem tht intrigued the fmous Swiss mthemtiin Leonhrd Euler (pronouned oiler ). The prolem ws one tht hd een posed y the residents of Königserg, ity in wht ws then Prussi ut is now the

Old Pregel River Lesson 4.4 Euler Ciruits nd Pths 191 Russin ity of Kliningrd. In the 1700s, seven ridges onneted two islnds in the Pregel River to the rest of the ity (see Figure 4.8). The people of Königserg wondered whether it would e possile to wlk through the ity y rossing eh ridge extly one nd return to the originl strting point. Mthemtiin of Note Leonhrd Euler (1707 1783) Euler ws n extrordinry mthemtiin who pulished over 500 works during his lifetime. Even totl lindness for the lst 17 yers of his life did not stop his effetiveness nd genius. He is often referred to s the fther of grph theory. Upper nk of town Shopkeepers ridge Blksmith ridge Wooden ridge New Pregel River Pregel River Kneiphof Islnd Honey ridge Other islnd Green ridge Guts Gilets ridge Lower nk of town High ridge Figure 4.8. Representtion of the seven ridges of Königserg. Using grph like the one in Figure 4.7, in whih the verties represented the lndmsses of the ity nd the edges represented the ridges, Euler found tht it ws not possile to mke the desired wlk through the ity. In so doing, he lso disovered solution to prolems of this generl type. Wht did Euler find? Try to reprodue the grphs in Figure 4.9 on the next pge without lifting your penil or tring the lines more thn one.

192 Chpter 4 Grphs nd Their Applitions 1. When n you drw the figure without retring ny edges nd still end up t your strting point? 2. When n you drw the figure without retring nd end up t point other thn the one from whih you egn? 3. When n you not drw the figure without retring?... Figure 4.9. Grphs to tre. Euler found tht the key to the solution ws relted to the degrees of the verties. Rell tht the degree of vertex of grph is the numer of edges tht hve tht vertex s n endpoint. Find the degree of eh vertex of the grphs in Figure 4.9. Do you see wht Euler notied? Euler hypothesized nd lter proved tht in order to e le to trverse eh edge of onneted grph extly one nd to end t the strting vertex, the degree of eh vertex of the grph must e even. See Figure 4.9. In honor of Leonhrd Euler, pth tht uses eh edge of grph extly one nd ends t the strting vertex is lled n Euler iruit. Euler lso notied tht if onneted grph hd extly two odd verties, it ws possile to use eh edge of the grph extly one ut to end t vertex different from the strting vertex. Suh pth is lled n Euler pth. Figure 4.9 is n exmple of grph tht hs n Euler pth. Figure 4.9 hs four odd verties. So it nnot e tred without lifting your penil. It hs neither n Euler iruit nor n Euler pth. An Euler iruit for reltively smll grph usully n e found y tril nd error. However, s the numer of verties nd edges inreses, systemti wy of finding the iruit eomes neessry. The following lgorithm gives proedure for finding n Euler iruit for onneted grph with ll verties of even degree.

Lesson 4.4 Euler Ciruits nd Pths 193 Exmple Use the Euler iruit lgorithm to find n Euler iruit for the following grph. i h Apply step 1 of the lgorithm. Choose vertex, nd lel it S. Let C e the iruit S,, d, e,, S. Ciruit C does not ontin ll edges of the grph, so proeed to step 4 of the lgorithm. Choose vertex d. Let C e the iruit d, g, h, S, d. e g f Comine C nd C y repling vertex d in the iruit C with the iruit C. Let C now e the iruit S,, d, g, h, S, d, e,, S. Go to step 3 of the lgorithm. Ciruit C does not ontin ll edges of the grph, so gin proeed to step 4. Choose vertex g. Let C e the iruit g, f, e, i, h, e, g. Comine C nd C y repling vertex g in the iruit C with the iruit C. Let C now e the iruit S,, d, g, f, e, i, h, e, g, h, S, d, e,, S. Ciruit C now ontins ll edges of the grph, so go to step 8 of the lgorithm nd stop. C is n Euler iruit for the grph. d Euler Ciruit Algorithm 1. Pik ny vertex, nd lel it S. 2. Construt iruit, C, tht egins nd ends t S. 3. If C is iruit tht inludes ll edges of the grph, go to step 8. 4. Choose vertex, V, tht is in C nd hs n edge tht is not in C. 5. Construt iruit C tht strts nd ends t V using edges not in C. 6. Comine C nd C to form new iruit. Cll this new iruit C. 7. Go to step 3. 8. Stop. C is n Euler iruit for the grph.

194 Chpter 4 Grphs nd Their Applitions Edges with Diretion Mny pplitions of grphs require tht the edges hve diretion. A ity with one-wy streets is one suh exmple. A grph tht hs direted edges, edges tht n e trversed in only one diretion, is known s digrph (see Figure 4.10). The numer of edges oming into vertex is known s the indegree of the vertex, nd the numer of edges going out of vertex is known s the outdegree. Exmine Figure 4.10. This digrph n e desried y Verties = {A, B, C, D} Ordered edges = {AB, BA, BC, CA, DB, AD}. A B D C Figure 4.10. Digrph. If you follow the indited diretion of eh edge, is it possile to strt t some vertex, drw the digrph, nd end up t the vertex from whih you strted? Tht is, does this digrph hve direted Euler iruit? Chek the indegree nd outdegree of eh vertex. You will find tht onneted digrph hs n Euler iruit if the indegree nd outdegree of eh vertex re equl.

Lesson 4.4 Euler Ciruits nd Pths 195 Exerises 1. Stte whether eh grph hs n Euler iruit, n Euler pth, or neither. Explin why.... d. 2. Drw grph with six verties nd eight edges so tht the grph hs n Euler iruit. 3. Slly egn using the Euler iruit lgorithm to find the Euler iruit for the following grph. She strted t vertex d nd leled it S. The first iruit she found ws S, e, f,,,, S. Using Slly s strt, ontinue the lgorithm nd find n Euler iruit for the grph. g e f d S

196 Chpter 4 Grphs nd Their Applitions 4. Use the Euler iruit lgorithm to find the Euler iruit for the following grph. d h e g f 5. The text sttes tht to pply the Euler iruit lgorithm, the grph must e onneted with ll verties of even degree.. Why is it neessry to stte tht the grph must e onneted?. Give n exmple of grph with ll verties of even degree tht does not hve n Euler iruit.. Drw grph with extly two verties of odd degree tht does not hve n Euler pth. 6. Will omplete grph with 2 verties hve n Euler iruit? With 3 verties? With 4 verties? With 5 verties? With n verties? 7. Suppose tht the people of Königserg uilt two more ridges ross the river. If one ridge ws dded to onnet the two nks on the river, A to B in the following figure, nd nother one ws dded to link the lnd to one of the islnds, B to D, would it then e possile to mke the fmous wlk nd return to the strting point? Explin your resoning. A C D B Königserg s originl seven ridges.

Lesson 4.4 Euler Ciruits nd Pths 197 8. The street network of ity n e modeled with grph in whih the verties represent the street orners, nd the edges represent the streets. Suppose you re the ity street inspetor nd it is desirle to minimize time nd ost y not inspeting the sme street more thn one. d e j f i G h. In this grph of the ity, is it possile to egin t the grge (G) nd inspet eh street only one? Will you e k t the grge t the end of the inspetion?. Find route tht inspets ll streets, repets the lest numer of edges possile, nd returns to the grge. 9. Construt the following digrphs.. V = {A, B, C, D, E}. V = {W, X, Y, Z} E = {AB, CB, CE, DE, DA} E = {WX, XZ, ZY, YW, XY, YX} 10.. Write list of the set of verties nd the set of ordered edges tht n e used to desrie the following digrph.. Does the digrph hve n Euler iruit? Explin. K L P N M

198 Chpter 4 Grphs nd Their Applitions 11. Determine whether the digrph hs direted Euler iruit.... d. 12.. Does the following digrph hve direted Euler iruit? Explin why or why not.. Does it hve direted Euler pth? If it does, whih verties n e the strting vertex?. Write generl sttement explining when digrph hs direted Euler pth. f g d e

Lesson 4.4 Euler Ciruits nd Pths 199 13. A digrph n e represented y n djeny mtrix. If there is direted edge from vertex to vertex, then 1 is pled in row, olumn of the mtrix; otherwise 0 is entered. Mtrix M is the djeny mtrix for the following grph. M = 0 1 0 0 0 1 0 0 0 Find the djeny mtrix for eh of the following digrphs... A B e d D C. d. s W t X x w v Z Y 14. Use the following djeny mtrix to onstrut digrph. A B C D A B C D 0 1 1 0 1 0 0 1 0 1 0 0 0 0 1 0

200 Chpter 4 Grphs nd Their Applitions 15.. Construt digrph for the following djeny mtrix. 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 1 0. Is there symmetry long the min digonl of the djeny mtrix? Explin why or why not.. Find the sum of the numers in the seond row. Wht does tht totl indite? d. Find the sum of the numers in the seond olumn. Wht does tht totl indite? Computer/Clultor Explortions 16. Crete omputer or lultor progrm tht prompts the user to enter the djeny mtrix for onneted grph. Then the progrm should tell the user whether or not the grph hs n Euler iruit. Projets 17. Leonhrd Euler ws known for mny omplishments in ddition to his disoveries relted to grph theory. After reserhing Euler s hievements, rete iogrphi poster tht illustrtes the importnt milestones of his life. 18. Reserh nd report on lgorithms tht determine Euler iruits for grphs tht hve them.