1 / 24

5 The Mathematics of Getting Around

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. Euler’s Theroems.

ada
Download Presentation

5 The Mathematics of Getting Around

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. Euler’s Theroems In this section we are going to develop the basic theory that will allow us to determine if a graph has an Euler circuit, an Euler path, or neither. This is importantbecause, as we saw in the previous section, what are Euler circuit or Euler pathquestions in theory are real-life routing questions in practice. The three theoremswe are going to see next (all thanks to Euler) are surprisingly simple and yet tremendously useful.

  3. 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.

  4. How to Use the Theorem Here ishow we can use Euler’s circuit theorem. First we make sure the graph is connected.(If it isn’t, then no matter what else, an Euler circuit is impossible.) If the graph isconnected, then we start checking the degrees of the vertices, one by one. As soonas we hit an odd vertex, we know that an Euler circuit is out of the question. Ifthere are no odd vertices, then we know that the answer is yes–the graph doeshave an Euler circuit!

  5. Illustration using the Theorem Figure 5-15 illustrates the three possible scenarios. The graph in Fig.5-15(a) cannot have an Euler circuit for the simple reason that it is disconnected.

  6. Illustration using the Theorem The graph in Fig. 5-15(b) is connected, but we can quickly spot odd vertices (C isone of them; there are others). This graph has no Euler circuits.

  7. Illustration using the Theorem But thegraph in Fig. 5-15(c) is connected and all the vertices are even. This graph doeshave Euler circuits.

  8. Summary of the Theorem The basic idea behind Euler’s circuit theorem is that as we travel along anEuler circuit, every time we go through a vertex we use up two different edges atthat vertex–one to come in and one to go out. We can keep doing this as long asthe vertices are even. A single odd vertex means that at some point we are goingto come into it and not be able to get out.

  9. EULER’S PATH THEOREM ■If a graph is connected and has exactly two odd vertices, then it has an Eulerpath (at least one, usually more). Any such path must start at one of theodd vertices and end at the other one. ■If a graph has more than two odd vertices, then it cannot have an Euler path.

  10. Example 5.18 The Seven Bridges of Königsberg: Part 3 Back to the Königsberg bridges problem. In Example 5.15 we saw that the layoutof the bridges in the old city can be modeled by the graph in Fig. 5-16(a). Thisgraph has four odd vertices; thus, neither an Euler circuit nor an Euler path canexist.

  11. Example 5.18 The Seven Bridges of Königsberg: Part 3 We now have an unequivocal answer to the puzzle: There is no possible wayanyone can walk across all the bridges without having to recross some of them! How many bridges will need to be recrossed? It depends. If we want to start andend in the same place, we must recross at least two of the bridges.

  12. Example 5.18 The Seven Bridges of Königsberg: Part 3 One of themany possible routes is shown in Fig. 5-16(b). In this route the bridge connectingL and D is crossed twice, and so is one of the two bridges connecting A and R.

  13. Example 5.18 The Seven Bridges of Königsberg: Part 3 Ifwe are allowed to start and end in different places, we can do it by recrossing justone of the bridges. One possible route starting at A, crossing bridge LD twice,and ending at R is shown in Fig.5-16(c).

  14. Example 5.19 Child’s Play: Part 2 the vertices are all even. By Euler’scircuit theorem we know that the graph has an Euler circuit, which implies thatthe original line drawing has a closed unicursal tracing. The graph in Fig. 5-17(a) is connected, and

  15. Example 5.19 Child’s Play: Part 2 has exactly two odd vertices (C and D).By Euler’s path theorem,the graph has an Euler path (open unicursal tracing). Moreover, we now know that the path has to start at C and end at D, orvice versa. The graph in Fig. 5-17(b) is connected and

  16. Example 5.19 Child’s Play: Part 2 vertices (A, B, C, and D), so it has neitheran Euler path nor an Euler circuit. The graph in Fig. 5-17(c) has four odd

  17. Example 5.19 Child’s Play: Part 2 The graph in Fig. 5-17(d) is not extremely big, but we can no longer“eyeball” an Euler circuit or path. The full power of Euler’s theorems is best appreciated when the graphs getbigger.

  18. Example 5.19 Child’s Play: Part 2 On the other hand, a quick check of thedegrees of the vertices shows that K and I are odd vertices and all the rest are even. We are now in business–an open unicursal tracing is possible as long as we start itat K or I (and end it at the other one). Starting anyplace else will lead to a dead end.Good to know!

  19. Euler’s Third Theorem Euler’s circuit theorem deals with graphs with zero odd vertices, whereasEuler’s Path Theorem deals with graphs with two or more odd vertices. The onlyscenario not covered by the two theorems is that of graphs with just one oddvertex. Euler’s third theorem rules out this possibility–a graph cannot have justone odd vertex. In fact, Euler’s third theorem says much more.

  20. EULER’S SUM OF DEGREES THEOREM ■The sum of the degrees of all the vertices of a graph equals twice the numberof edges (and therefore is an even number). ■A graph always has an even number of odd vertices.

  21. Euler’s Sum of Degrees Theorem Euler’s sum of degrees theorem is based on the following basic observation:Take any edge–let’s call it XY. The edge contributes once to the degree of vertexX and once to the degree of vertex Y, so, in all, thatedge makes a total contribution of 2 to the sum of thedegrees. Thus, when the degrees of all the vertices ofa graph are added, the total is twice the number ofedges.

  22. Euler’s Sum of Degrees Theorem Since the total sum is an even number, it isimpossible to have just one odd vertex, or three oddvertices, or five odd vertices, and so on. To put it in aslightly different way,the odd vertices of a graphalways come in twos. Table 5-1is a summary of Euler’s three theorems. It shows the relationship between the numberof odd vertices in a connected graph G and the existence of Euler paths or Euler circuits.

  23. Euler’s Sum of Degrees Theorem

More Related