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 Paths and Circuits.
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
Our story begins in the 1700s in the medieval town of Königsberg, in Eastern Europe. At the time, Königsberg was divided by a river into four separate sections, which were connected to one another by seven bridges. The old map of Königsberg shown on the next slide gives the layout of the city in 1735, the year a brilliant young mathematician named Leonhard Euler came passing through.
While visiting Königsberg, Euler was told of an innocent little puzzle of disarming simplicity: Is it possible for a person to take a walk around town in such a way thateach of the seven bridges is crossed once, but only once? Euler, perhaps sensing that something important lay behindthe frivolity of the puzzle, proceeded to solve it by demonstrating that indeed such a walk was impossible. But he actually didmuch more!
Euler laid the foundations for what was at the time a totally newtype of geometry, which he called geometris situs (“the geometryof location”). From these modest beginnings, the basic ideas setforth by Euler eventually developed and matured into one of themost important and practical branches of modern mathematics,now known as graph theory.
The theme of this chapter is the question of how to create efficient routesfor the delivery of goods and services–such as mail delivery, garbage collection, police patrols, newspaper deliveries, and, most important, late-night pizzadeliveries–along the streets of a city, town, or neighborhood. These types ofmanagement science problems are known as Euler circuit problems.
What is arouting problem? To put it in the most general way, routing problems are concernedwith finding ways to route the delivery of goods and/or services to an assortment ofdestinations. The goods or services in question could be packages, mail, newspapers,pizzas, garbage collection, bus service, and so on. The delivery destinations could behomes, warehouses, distribution centers, terminals, and the like.
The existence question is simple: Is an actual route possible? For most routingproblems, the existence question is easy to answer, and the answer takes theform of a simple yes or no. When the answer to the existence question is yes,then a second question–the optimization question–comes into play. Of all thepossible routes, which one is the optimal route? Optimal here means “the best”when measured against some predetermined variable such as cost,distance, ortime.
The common thread in all Euler circuit problems is what we might call,for lack of a better term, the exhaustion requirement–the requirementthat the route must wind its way through . . .everywhere. Thus, in anEuler circuit problem, by definition every single one of the streets (orbridges, or lanes, or highways) within a defined area (be it a town, anarea of town, or a subdivision) must be covered by the route. We willrefer to these types of routes as exhaustive routes.
After a rash of burglaries, a private security guard is hired to patrol the streets ofthe Sunnyside neighborhood shown next. The security guard’s assignment isto make an exhaustive patrol, on foot, through the entire neighborhood. Obviously, he doesn’t want to walk any more than what is necessary. His starting pointis the southeast corner across from the school (S)–that’s where heparks his car.
(This is relevant because at the end of his patrol he needs to comeback toS to pick up his car.)
Being a practical person, the security guard wouldlike the answers to two questions. (1) Is it possible to start and end at S, coverevery block of the neighborhood, and pass through each block just once? (2) Ifsome of the blocks will have to be covered more than once, what is an optimalroute that covers the entire neighborhood? (Optimal here means “with the minimalamount of walking.”)
A mail carrier has to deliver mail in the same Sunnyside neighborhood. The difference between the mail carrier’s route andthe security guard’s route is that the mail carrier must make twopasses through blocks with houses on both sides of the street andonly one pass through blocks with houses on only one side of thestreet; and where there are no homes on either side of the street, themail carrier does not have to walk at all.
In addition, the mail carrierhas no choice as to her starting and ending points–she has to start andend her route at the local post office (P). Much like the securityguard, the mail carrier wants to find the optimal route that would allow her tocover the neighborhood with the least amount of walking. (Put yourself in hershoes and you would do the same–good weather or bad, she walks this route300 days a year!)
Figure 5-2(a) shows an old map of the city of Königsberg and its seven bridges;Fig.5-2(b) shows a modernized version of the very same layout. We opened thechapter with this question: Can a walker take a stroll and cross each of the sevenbridges of Königsberg without crossing any of them more than once?
This is a more modern version of Example 5.3. Madison County is a quaint oldplace, famous for its quaint old bridges. A beautiful river runs through the county,and there are four islands (A,B,C, and D) and 11 bridges joining the islands toboth banks of the river (R and L) and one another (Fig.5-3). A famous photographer is hired to take pictures of each of the 11 bridges for a national magazine.
The photographer needs to drive across each bridge once for the photo shoot.Moreover, since there is a $25 toll (the locals call it a “maintenance tax”) everytime an out-of-town visitor drives across a bridge, the photographer wants tominimize the total cost of his trip and to recross bridges only if it is absolutelynecessary. What is the optimal (cheapest) route for him to follow?
Figure 5-4 shows a few simple line drawings. The name of the game is to traceeach drawing without lifting the pencil or retracing any of the lines. These kinds oftracings are called unicursal tracings. (When we end in the same placewe started, we call it a closed unicursal tracing; when we start and endin different places, we call it an open unicursal tracing.) Which of thedrawings in Fig. 5-4 can be traced with closed unicursal tracings?Which with only open ones?
Which can’t be traced (without cheating)? How can we tellif a unicursal tracing (open or closed) is possible? Good question. We will answerit in Section 5.5.