1 / 32

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. Exhaustive Routes.

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. Exhaustive Routes In this section we will finally answer some of the routing problems raised at thebeginning of the chapter. Their common thread is the need to find optimalexhaustive routes in a connected graph.How is this done? Let’s first refresh ourmemories of what this means. We will use the term exhaustive route to describe aroute that travels along the edges of a graph and passes through each and everyedge of the graph at least once.

  3. Exhaustive Routes Such a route could be an Euler circuit (if the graphhas no odd vertices) or an Euler path (if the graph has two odd vertices), but forgraphs with more than two odd vertices, an exhaustive route will have to recrosssome of the edges. This follows from Euler’s theorems. We are interested in finding exhaustive routes that recross the fewest numberof edges. Why?

  4. Exhaustive Routes In many applications, each edge represents a unit of cost. Themore edges along the route, the higher the cost of the route. In an exhaustiveroute, the first pass along an edge is a necessary expense, part of the requirementsof the job. Any additional pass along that edge represents a wasted expense(these extra passes are often described as deadhead travel). Thus, an exhaustiveroute that minimizes cost (optimal exhaustive route) is one with the fewest number of deadhead edges.

  5. Eulerizing Graphs We are now going to see how the theory developed in the preceding sectionswill help us design optimal exhaustive routes for graphs with many (more thantwo) odd vertices. The key idea is that we can turn odd vertices into even verticesby adding “duplicate” edges in strategic places. This process is called eulerizingthe graph.

  6. Example 5.22 Covering a 3 by 3 Street Grid The graph represents a 3 block by 3 block streetgrid consisting of 24 blocks. How can we findan optimal route that covers all the edges of the graph and ends back at the starting vertex? Our first step is to identify the odd vertices. This graph has eight oddvertices (B,C,E,F,H,I,K, and L), shown in red.

  7. Example 5.22 Covering a 3 by 3 Street Grid When we add a duplicatecopy of edges BC,EF,HI, and KL, we get this graph. This is aeulerized version of the original graph–its vertices are all even, so we know ithas an Euler circuit. Moreover, it’s clear we couldn’t have done this with fewerthan four duplicate edges

  8. Example 5.22 Covering a 3 by 3 Street Grid This figure shows one of the many possible Euler circuits, with the edges numbered in the order they are traveled. The Eulercircuit represents an exhaustive closed route along the edges of the original graph, with the four duplicate edges(BC,EF,HI, and KL) indicating the deadhead blocks where a second pass isrequired.

  9. Example 5.22 Covering a 3 by 3 Street Grid The total length of this route is 28 blocks (24 blocks in the grid plus4 deadhead blocks), and this route is optimal–no matter how clever you areor how hard you try, if you want to travel along each block of the grid and startand end at the same vertex, you will have to pass through a minimum of28 blocks!

  10. Example 5.23 Covering a 4 by 4 Street Grid The graph in the figure represents a 4 block by 4 block street grid consistingof 40 blocks. The 12 odd vertices in the graph are shown in red. We want toeulerize the graph by adding the least number of edges.

  11. Example 5.23 Covering a 4 by 4 Street Grid This figure showshow not to do it! This graph violates the cardinal rule of eulerization–you canonly duplicate edges that are part of the original graph. Edges DF and NL arenew edges, not duplicates, so this figure is out!

  12. Example 5.23 Covering a 4 by 4 Street Grid This figure shows a legaleulerization, but it is not optimal, as it is obvious that we could have accomplished the same thing by adding fewer duplicate edges.

  13. Example 5.23 Covering a 4 by 4 Street Grid This figure showsan optimal eulerization of the original graph–one of several possible. Once wehave an optimal eulerization, we have the blueprint for an optimal exhaustive closed route on the original graph. Regardless of the specific details, we nowknow that the route will travel along 48 blocks–the 40 original blocks in thegrid plus 8 deadhead blocks.

  14. Open Route 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. Inthese cases we want to leave two odd vertices on the graph unchanged andchange the other odd vertices into even vertices by duplicating appropriate edgesof the graph.

  15. Semi-eulerization This process is called a semi-eulerization of the graph. When westrategically choose how to do this so that the number of duplicate edges is assmall as possible, we can obtain an optimal exhaustive open route. In this case theroute will start at one of the two odd vertices and end at the other one.

  16. Example 5.24 Parade Route Let’s consider once again the 4 by 4 street grid. Imagine thatyour job is to design a good route for a Fourth of July parade that must passthrough each of the 40 blocks of the street grid. The key is that when routing a parade, you do not want theparade to start and end in the same place. In fact, for traffic control it is usuallydesirable to keep the starting and ending points of a parade as far from eachother as possible.

  17. Example 5.24 Parade Route The fire department has added one additional requirement tothe parade route: The parade has to start at B. Your task, then, is to find a semi-eulerization of the graph that leaves B and one more odd vertex unchanged (preferably a vertex far from B) and that changes all the other odd vertices intoeven vertices.

  18. Example 5.24 Parade Route This semi-eulerization is optimalbecause it required only six duplicate edges, and this is asgood as one can do. The optimal parade route could be found by finding an Eulerpath. The only bad thing about this route is that theparade would end at P, a point a bit too close to the starting point, and the trafficcontrol people are unhappy about that.

  19. Example 5.24 Parade Route A different semi-eulerization is shown here. The parade route inthis case would not be optimal (it has seven deadhead blocks), but because itends at K, it better satisfies the requirement that the starting and ending pointsbe far apart. The traffic control folks are happy now.

  20. Example 5.25 The Bridges of Madison County: Part 2 This is the conclusion of the routing problem first introduced in Example 5.4. Aphotographer needs to take photos of each of the 11 bridges in Madison County.

  21. Example 5.25 The Bridges of Madison County: Part 2 A graph model of the layout (vertices represent land masses, edges represent bridges) is shown.

  22. Example 5.25 The Bridges of Madison County: Part 2 The graph has four odd vertices (R, L,B, and D), so some bridges are definitely going to have to be recrossed.

  23. Example 5.25 The Bridges of Madison County: Part 2 Howmany and which ones depends on the other parameters of the problem. (Recallthat it costs $25 in toll fees to cross a bridge, so the baseline cost for crossing the11 bridges is $275. Each recrossing is at an additional cost of $25.)The following are a few of the possible scenarios one might have to consider.Each one requires a different eulerization and will result in a different route.

  24. Example 5.25 The Bridges of Madison County: Part 2 The photographer needs to start and end his trip in the same place. This scenariorequires an optimal eulerization of the graph. This is not hard todo, and an optimal route can be found for a cost of $325.

  25. Example 5.25 The Bridges of Madison County: Part 2 The photographer has the freedom to choose any starting and ending pointsfor his trip. In this case we can find an optimal semi- eulerization of the graph,requiring only one duplicate edge. Now an optimal route is possible at a costof $300.

  26. Example 5.25 The Bridges of Madison County: Part 2 The photographer has to start his trip at B and end the trip at L.In this casewe must find a semi-eulerization of the graph where B and L remain as oddvertices and R and D become even vertices. It is possible to do this with justtwo duplicate edges and thus find an optimal route that will cost $325.

  27. Example 5.26 The Exhausted Patrol and the Grateful No Deadhead This example brings us full circle to the first couple of examples of this chapter. InExample 5.1 we raised the question of finding an optimal exhaustive closed routefor a security guard hired to patrol the streets of the Sunnyside subdivision and we created the graph model for this problem.

  28. Example 5.26 The Exhausted Patrol and the Grateful No Deadhead The graph has 18 odd vertices, shown in red. We now know that the name of thegame is to find an optimal eulerization of this graph. In this case the odd verticespair up beautifully, and the optimal eulerization requires only nine duplicateedges, shown here.

  29. Example 5.26 The Exhausted Patrol and the Grateful No Deadhead All the answers to the security guards questions cannow be answered: An optimal route will require nine deadhead blocks. The actualroute can be found using trial and error or Fleury’s algorithm.

  30. Example 5.26 The Exhausted Patrol and the Grateful No Deadhead A slightly different problem is the one facing the mail carrier delivering mailalong the streets of the Sunnyside subdivision. Much to the mail carrier’s pleasantsurprise, in the graph that models her situation all the vertices areeven.

  31. Example 5.26 The Exhausted Patrol and the Grateful No Deadhead This means that the optimal route isan Euler circuit, which can be found once again using Fleury’s algorithm (or trial and error if you prefer). Thanks to the lessons of this chapter, this mail carrier willnot have to deadhead, for which she is extremely grateful!

More Related