Comparing Graphs A flat map represents the surface of Earth in two dimensions. (credit: modification of work "World Map" by Scratchinghead/Wikimedia Commons, Public Domain) A globe represents the surface of Earth in three dimensions. (credit: "Globe" by Wendy Cope/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Identify the characteristics used to compare graphs. Determine when two graphs represent the same relationships Explore real-world examples of graph isomorphisms Find the complement of a graph Maps of the same region may not always look the same. For example, a map of Earth on a flat surface looks distorted at the poles. When the same regions are mapped on a spherical globe, the countries that are closer to the polls appear smaller without the distortion. Despite these differences, the two maps still communicate the same relationships between nations such as shared boundaries, and relative position on the earth. In essence, they are the same map. This means that for every point on one map, there is a corresponding point on the other map in the same relative location. In this section, we will determine exactly what characteristics need to be the shared by two graphs in order for us to consider them “the same.” When Are Two Graphs Really the Same Graph? In arithmetic, when two numbers have the same value, we say they are equal, like ½ = 0.5. Although ½ and 0.5 look different, they have the same value, because they are assigned the same position on the real number line. When do we say that two graphs are equal? shows Graphs A and F , which are identical except for the labels. Graphs are visual representations of connections. As long as two graphs indicate the same pattern of connections, like Graph A and Graph F , they are considered to be equal, or in graph theory terms, isomorphic . Identical Graphs with Different Labels Two graphs are isomorphic if either one of these conditions holds: One graph can be transformed into the other without breaking existing connections or adding new ones. There is a correspondence between their vertices in such a way that any adjacent pair in one graph corresponds to an adjacent pair in the other graph. It is important to note that if either one of the isomorphic conditions holds, then both of them do. When we need to decide if two graphs are isomorphic, we will need to make sure that one of them holds. For example, shows how Graph T can be bent and flipped to look like Graph Z , which means that Graphs T and Z satisfy condition 1 and are isomorphic. Graph T Transformed Into Graph Z Also, notice that the vertices that were adjacent in the first graph are still adjacent in the transformed graph as shown in . For example, vertex 3 is still adjacent to vertex 4, which means they are still neighboring vertices joined by a single edge. Adjacent Vertices Are Still Adjacent When Are Two Graphs Really Different? Verifying that two graphs are isomorphic can be a challenging process, especially for larger graphs. It makes sense to check for any obvious ways in which the graphs might differ so that we don’t spend time trying to verify that graphs are isomorphic when they are not. If two graphs have any of the differences shown in , then they cannot be isomorphic. Unequal number of vertices Unequal number of edges Unequal number of vertices of a particular degree Different cyclic subgraphs Characteristics of Graphs That Are Not Isomorphic Recognizing Isomorphic Graphs Isomorphic graphs that represent the same pattern of connections can look very different despite having the same underlying structure. The edges can be stretched and twisted. The graph can be rotated or flipped. For example, in , each of the diagrams represents the same pattern of connections. Four Representations of the Same Graph Looking at , how can we know that these graphs are isomorphic? We will start by checking for any obvious differences. Each of the graphs in has four vertices and five edges; so, there are no differences there. Next, we will focus on the degrees of the vertices, which have been labeled in . Graphs with Vertices of the Same Degrees As shown in , each graph has two vertices of degree 2 and two vertices of degree 3; so, there are no differences there. Now, let’s check for cyclic subgraphs. These are highlighted in . Graphs with the Same Cyclic Subgraphs As shown in , each graph has two triangles and one quadrilateral; so, no differences there either. It is beginning to look likely that these graphs are isomorphic, but we will have to look further to be sure. To know with certainty that these graphs are isomorphic, we need to confirm one of the two conditions from the definition of isomorphic graphs. With smaller graphs, you may be able to visualize how to stretch and twist one graph to get the other to see if condition 1 holds. Imagine the edges are stretchy and picture how to pull and twist one graph to form the other. If you can do this without breaking or adding any connections, then the graphs are really the same. demonstrates how to change graph A 4 to get A 3 , graph A 3 to get A 2 , and graph A 2 to get A 1 . Transforming Graphs Now that we have used visual analysis to see that condition 1 holds for graphs A 1 , A 2 , A 3 , and A 4 in , we know that they are isomorphic. In , one of the edges of graph A 4 crossed another edge of the graph. By transforming it into graph A 3 , we have “untangled” it. Graphs that can be untangled are called planar graphs. The complete graph with five vertices is an example of a nonplanar graph-that means that, no matter how hard you try, you can’t untangle it. But, when you try to figure out if two graphs are the same, it can be helpful to untangle them as much as possible to make the similarities and differences more obvious. Identifying Isomorphic Graphs Which of the three graphs in are isomorphic, if any? Justify your answer. Three Similar Graphs Step 1: Check for differences in number of vertices, number of edges, degrees of vertices, and types of cycles to see if an isomorphism is possible. Vertices: They all have the same number of vertices, 4. Edges: They all have the same number of edges, 4. Degrees: Graph B 1 and Graph B 2 each have a vertex of degree 3, while Graph B 3 does not. So, Graph B 3 is not isomorphic to either of the other two graphs, but Graph B 1 and Graph B 2 could possibly be isomorphic. Cycles: Focus on any cycles in Graph B 1 and Graph B 2 . Each graph has a triangle as shown in . Cycles of Graph B 1 and Graph B 2 Step 2: If no differences were found and an isomorphism is possible, verify one of the conditions in the definition of isomorphic. Since we were able to determine that Graph B 1 and Graph B 2 have no obvious differences, and they are relatively small graphs, we will attempt to transform one graph into the other, which would verify condition 1. Graph B 1 can be transformed into Graph B 2 without breaking or adding connections as shown in . Begin by untangling graph B 1 . Then rotate or flip as needed to see that the graphs match. Transformation of Graph B 1 So, Graph B 1 and Graph B 2 have the same structure and are isomorphic. Have you ever noticed that many popular board games may look different but are really the same game? A good example is the many variations of the board game Monopoly ®, which was submitted to the U.S. Patent Office in 1935. Although the rules have been revised a bit, a very similar game board is still in use today. There have been many versions of Monopoly over the years. Many have been stylized to reflect a popular theme, such as a show or sports team, while retaining the same game board structure. If we were to represent these different versions of the game using a graph, we would find that the graphs are isomorphic. . Let's analyze some game boards using graph theory to determine if they have the same structure despite having different appearances. Two Game Boards Deciding If Graphs are Isomorphic A teacher uses games to teach her students about colors and numbers as shown in . In the Colors Game, shown in Figure A , each player begins in the space marked START and proceeds in a counterclockwise direction. On each turn, the player spins a spinner marked 1 and 2 and moves forward the number of spaces shown on the spinner. If the player lands on a space marked with any color other than white, the player must move forward or back to the other space of the same color. The first player to land in or pass the space marked END wins. In the Clock Game, shown in Figure B , each player begins in the space marked START and proceeds in a clockwise direction. On each turn, the player spins a spinner marked 1 and 2 and moves forward the number of spaces shown on the spinner. In the same turn, the player must read the number in the space and move forward the number of spaces indicated by a positive value or backward the number of spaces indicated by a negative value. Then the turn ends. The first player to land in or pass the space marked END wins. Draw a graph or multigraph to represent each game in which the vertices are the spaces and the edges represent the ability of a player to move between the spaces either by a spin or as dictated by a marked color or number. (We will ignore the direction of motion for simplicity.) Transform one of the graphs to show that it is isomorphic to the other and explain what this tells you about the games. The graph representing the Clock Game can be transformed as shown in so that we can see that the graphs are isomorphic. There is a correspondence between their vertices in such a way that any adjacent pair in one graph corresponds to an adjacent pair in the other graph. Graphs for Clock Game and Colors Game This tells us that the games are essentially the same game with the same moves even though the games appear to be different. Elizabeth Magie Game designer, engineer, comedian, and political activist, Elizabeth Magie designed a game called “Landlord’s Game” to educate fellow citizens about the dangers of monopolies and the benefits of wealth redistribution through a land tax. Magie, whose father had campaigned with Abraham Lincoln, was a proponent of a land tax, an idea popularized by Henry George’s 1879 book, Progress and Poverty . She designed the game to be played by two sets of rules for comparison. In one version, the goal was to dominate opponents by creating monopolies, leaving one wealthy player standing in the end. In the other version, all the players were rewarded when a monopoly was created through a simulated land tax. She patented this game for the first time in 1904. Does the game board in look familiar? Landlord’s Game Patent (credit: "Landlord's Game Patent" Wikimedia Commons, Public Domain) That’s right! A modified version of the game was obtained from friends by a man named Charles Darrow who renamed it Monopoly and sold to Parker Brothers. Parker Brothers later paid Magie $500 for the right to her patent on it. The property tax version was left behind, and the modern game of Monopoly was born. (Mary Pilon, Monopoly’s Lost Female Inventor , September 1, 2018, National Women’s History Museum, “Monopoly’s Lost Female Inventor,” Identifying and Naming Isomorphisms When two graphs are isomorphic, meaning they have the same structure, there is a correspondence between their vertices, which can be named by listing corresponding pairs of vertices. This list of corresponding pairs of vertices in such a way that any adjacent pair in one graph corresponds to an adjacent pair in the other graph is called an isomorphism . Consider the isomorphic graphs in . In , we could replace the labels Graph F with the labels from Graph A and have an identical graph, as in . Identical Graphs with Different Labels Corresponding Vertices So, we can identify an isomorphism between Graph A and Graph F by listing the corresponding pairs of vertices: b-g , c-h , d-i , and e-j . Notice that b is adjacent to c and g is adjacent to h . This must be the case since b corresponds to g and c corresponds to h . The same is true for other pairs of adjacent vertices. An isomorphism between graphs is not necessarily unique. There can be more than one isomorphism between two graphs. We can see how to form a different isomorphism between Graph A and Graph F from by rotating Graph F clockwise and comparing the rotated version of F to Graph A as in YOUR TURN 12.13 . Now, we can see that a second isomorphism exists, which has the correspondence: b-j , d-h , c-i , and e-g as shown in . Transforming Graph F into Graph A When you name isomorphisms, one way to check that your answer is reasonable is to make sure that the degrees of corresponding vertices are equal. Determine If Two Graphs Are Isomorphic and Identify the Isomorphism Identifying Isomorphisms In , we showed that the Graphs B 1 and B 2 in are isomorphic. In , labels have been assigned to the vertices of Graphs B 1 and B 2 . Identify an isomorphism between them by listing corresponding pairs of vertices. Two Isomorphic Graphs showed how to transform Graph B 1 to get Graph B 2 . In , we will do the same, but this time we will include the labels. Transform Graph B 1 into Graph B 2 From YOUR TURN 12.13 , we can see the corresponding vertices: a-q , d-p , c-r , and b-s , which is an isomorphism of the two graphs. Recognizing an Isomorphism Determine whether Graphs G and S in are isomorphic. If not, explain how they are different. If so, name the isomorphism. Graph G and Graph S Step 1: Check for any differences. Vertices: Graphs G and S each have six vertices. Edges: Graphs G and S each have six edges. Degrees: Each graph also has two vertices of degree 1, two vertices of degree 2, and two vertices of degree 3. Cycles: From , we can see that Graph G contains a quadrilateral cycle ( b , f , d , c ) but Graph S has no quadrilaterals. Also, Graph S contains a triangle cycle ( m , r , o ) but Graph G has no triangles. This means that the graphs are not isomorphic. Comparing Subgraphs Step 2: This step is not necessary because we now know Graphs G and S are not isomorphic. Complementary Graphs Suppose that you are a camp counselor at Camp Woebegone and you are holding a camp Olympics with four events. The campers have signed up for the events. You drew a graph in to help you visualize which events have campers in common. Graph of Events with Campers in Common Graph E in shows that some of the same campers will be in events a and b , as well as b and d , c and d , and a and c . What do you think the graph would look like that represented the events that do not have campers in common? It would have the same vertices, but any pair of adjacent edges in Graph E , would not be adjacent in the new graph, and vice versa. This is called a complementary graph, as shown in . Two graphs are complementary if they have the same set of vertices, but any vertices that are adjacent in one, are not adjacent in the other. In this case, we can say that one graph is the complement of the other. Graphs of Camp Olympics One way to find the complement of a graph is to draw the complete graph with the same number of vertices and remove all the edges that were in the original graph. Let’s say you wanted to find the complement of Graph E from , and you didn’t already know it was Graph F . You could start with the complete graph with four vertices and remove the edges that are in Graph E as shown in . Use Complete Graph to Find Complement Finding a Complement A particular high school has end-of-course exams in (E3) English 3, (E4) English 4, (M) Advanced Math, (C) Calculus, (W) World History, (U) U.S. History, (B) Biology, and (P) Physics. No English 3 students are taking English 4, World History, or Biology; no English 4 students are also in Calculus, Advanced Math, U.S. History, or Physics; no Physics students are also taking Advanced Math; No World History students are also taking U.S. History; and no Advanced Math students are also taking Calculus. Create a graph in which the vertices represent the exams, and an edge between a pair of vertices indicates that there are no students taking both exams. Find the complement of the graph in part 1. Explain what the graph in part 2 represents. In , we have drawn a vertex for each exam and edges between any vertices that have no students in common. Graph of Exams with No Students in Common One way to get the complement of the graph in is to draw a complete graph with the same number of vertices and remove the edges they have in common as shown in . Remove Unwanted Edges from Complete Graph The final graph of the complement is in . Graph of Exams with Students in Common In the graph in , the vertices are still the exams, and a pair of adjacent vertices represents a pair of exams that have students in common. When two graphs are really the same graph, they have the same missing edges. So, when two graphs have a lot of edges, it may actually be easier to determine if they are isomorphic by looking at which edges are missing rather than which edges are included. In other words, we can determine if two graphs are isomorphic by checking if their complements are isomorphic. Using a Complement to Find an Isomorphism Use to answer each question. Graph K Find the complement of Graph K . Identify an isomorphism between the complement of Graph K from part 1, and the complement of Graph H in YOUR TURN 12.17 . Confirm that the correspondence between the vertices you found in part 2 also gives an isomorphism between Graph H from YOUR TURN 12.17 , and Graph K from . The complement of Graph K can be found by removing the edges of Graph K from a complete graph with the same vertices as shown in . Find Complement of Graph K An isomorphism between the complement of Graph K and the complement of Graph H is A-M , C-L , E-N , B-O , and D-P , which is confirmed by transforming the complement of Graph K in . Isomorphism between Complements of K and H shows how Graph K can be transformed into Graph H to confirm that the correspondence is A-M , C-L , E-N , B-O , and D-P also gives an isomorphism between Graph K and Graph H . Isomorphism between K and H This means we now have three conditions that guarantee two graphs are isomorphic. First Way: One graph can be transformed into the other without breaking existing connections or adding new ones. Second Way: There is a correspondence between their vertices in such a way that any adjacent pair in one graph corresponds to an adjacent pair in the other graph. Third Way: Their complements are isomorphic. If any one of these statements is true, then they are all true. If any one of these statements is false, then they are all false. Here is an activity you can do with a few of your classmates that will build your graph comparison skills. Step 1: Draw a planar graph with the following characteristics: exactly five vertices, one vertex of degree four, at least two vertices of degree three, and exactly eight edges. Give names to the vertices. Make sure you do not use the same letters or numbers to label your vertices as your classmates do. Step 2: Analyze your graph. What is the degree of each vertex? Does your graph have any cyclic subgraphs? If so, list them and indicate their sizes. Step 3: Draw and analyze the complement of your graph. How many edges and vertices does it have? What is the degree of each vertex? Does the complementary graph have any cyclic subgraphs? If so, list them and indicate their sizes. Step 4: Compare your graphs to each of your classmates’ graphs. Does your graph have the same number of edges and vertices as the graph of your classmate? Does your graph have the same size cyclic subgraphs as the graph of your classmate? How does the complement of your graph compare to the complement of the graph of your classmate? Determine if your graph is isomorphic to your classmates’ graph. If so, give a correspondence that demonstrates the isomorphism. If not, explain how you know. Check Your Understanding Key Terms isomorphic isomorphism planar nonplanar complement complementary Key Concepts Two graphs are isomorphic if they have the same structure. When graphs are relatively small, we can use visual inspection to identify an isomorphism by transforming one graph into another without breaking connections or adding new ones. An isomorphism between two graphs preserves adjacency. If two graphs differ in number of vertices, number of edges, degrees of vertices, or types of subgraphs, they cannot be isomorphic. When the complements of two graphs are isomorphic, so are the graphs themselves. Videos Determine If Two Graphs Are Isomorphic and Identify the Isomorphism

Math


Navigating Graphs Visitors navigate a garden maze. (credit: “Longleat Maze” by Niki Odolphie/Wikimedia, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Describe and identify walks, trails, paths, and circuits. Solve application problems using walks, trails, paths, and circuits. Identify the chromatic number of a graph. Describe the Four-Color Problem. Solve applications using graph colorings. Now that we know the basic parts of graphs and we can distinguish one graph from another, it is time to really put our graphs to work for us. Many applications of graph theory involve navigating through a graph very much like you would navigate through a maze. Imagine that you are at the entrance to a maze. Your goal is to get from one point to another as efficiently as possible. Maybe there are treasures hidden along the way that make straying from the shortest path worthwhile, or maybe you just need to get to the end fast. Either way, you definitely want to avoid any wrong turns that would cause unnecessary backtracking. Luckily, graph theory is here to help! Walks Suppose is a maze you want to solve. You want to get from the start to the end. Your Maze You can approach this task any way you want. The only rule is that you can’t climb over the wall. To put this in the context of graph theory, let’s imagine that at every intersection and every turn, there is a vertex. The edges that join the vertices must stay within the walls. The graph within the maze would look like . The Graph in Your Maze One approach to solving a maze is to just start walking. It is not the most efficient approach. You might cross through the same intersection twice. You might backtrack a bit. It’s okay. We are just out for a walk. It might look something like the black sequence of vertices and edges in . The Walk Through the Graph in Your Maze This type of sequence of adjacent vertices and edges is actually called a walk (or directed walk ) in graph theory too! A walk can be identified by naming the sequence of its vertices (or by naming the sequence of its edges if those are labeled). Let’s take the graph out of the context of the maze and give each vertex a name and each edge of the walk a direction as in . The Graph without Your Maze The name of this walk from p to r is p → q → o → n → i → j → c → d → c → j → k → s → r . When a particular edge on our graph was traveled in both directions, it had arrows in both directions and the letters of vertices that were visited more than once had to be repeated in the name of the walk. Not every list of vertices or list of edges makes a path. The order must take into account the way in which the edges and vertices are connected. The list must be a sequence, which means they are in order. No edges or vertices can be skipped and you cannot go off the graph. A Walk or Not a Walk? The highlighted edges Graph Y in represent a walk between f and b . The highlighted edges in Graph X do not represent a walk between f and b , because there is a turn at a point that is not a vertex. This is like climbing over a wall when you are walking through a maze. Another way of saying this is that b → d → f is not a walk, because there is no edge between b and d . A point on a graph where two edges cross is not a vertex. Naming a Walk Through A House shows the floor plan of a house. Use the floor plan to answer each question. Floor Plan of a House Draw a graph to represent the floor plan in which each vertex represents a different room (or hallway) and edges represent doorways between rooms. Name a walk through the house that begins in the living room, ends in the garage and visits each room (or hallway) at least once. Step 1: We will need a vertex for each room and it is convenient to label them according to the names of the rooms. Visualize the scenario in your head as shown in . You don’t have to write this step on your paper. Assigning Vertices to Rooms Step 2: Draw a graph to represent the scenario. Start with the vertices. Then connect those vertices that share a doorway in the floorplan as shown in . Graph of the Floor plan Step 1: Draw a path that begins at vertex L , representing the living room, and ending at vertex G , representing the garage making sure to visit every room at least once. There are many ways this can be done. You may want to number the edges to keep track of their order. One example is shown in . Draw the Path from L to G Step 2: Name the path that you followed by listing the vertices in the order you visited them. L → R → L → K → L → H → B → H → M → H → G Paths and Trails A walk is the most basic way of navigating a graph because it has no restrictions except staying on the graph. When there are restrictions on which vertices or edges we can visit, we will call the walk by a different name. For example, if we want to find a walk that avoids travelling the same edge twice, we will say we want to find a trail (or directed trail ). If we want to find a walk that avoids visiting the same vertex twice, we will say, we want to find a path (or directed path ). Walks, trails, and paths are all related. All paths are trails, but trails that visit the same vertex twice are not paths. All trails are walks, but walks in which an edge is visited twice would not be trails. We can visualize the relationship as in . Walks, Trails, and Paths Let’s practice identifying walks, trails, and paths using the graphs in . Graphs A and K Identifying Walks, Paths, and Trails Consider each sequence of vertices from Graph A in . Determine if it is only a walk, both a walk and a path, both a walk and a trail, all three, or none of these. b → c → d → e → f c → b → d → b → e c → f → e → d → b → c b → e → f → c → b → d First, check to see if the sequence of vertices is a walk by making sure that the vertices are consecutive. As you can see in , there is no edge between vertex c and vertex d . This means that the sequence is not a walk. If it is not a walk, then it can’t be a path and it cannot be a trail, so, it is none of these. First, check to see if the sequence is a walk. As you can see in , the vertices are consecutive. This means that the sequence is a walk. Since the vertex b is visited twice, this walk is not a path. Since edge bd is traveled twice, this walk is not a trail. So, the sequence is only a walk. First, check to see if the sequence is a walk. We can see in that the vertices are consecutive, which means it is a walk. Next, check to see if any vertex is visited twice. Remember, we do not consider beginning and ending at the same vertex to be visiting a vertex twice. So, no vertex was visited twice. This means we have a walk that is also a path. Next check to see if any edge was visited twice; none were. So, the sequence is a walk, a path, and a trail. First, check to see if the sequence is a walk. We can see in that the vertices are consecutive, which means it is a walk. Next check to see if any vertex is visited twice. Since vertex b is visited twice, this is not a path. Finally, check to see if any edges are traveled twice. Since no edges are traveled twice, this is a trail. So, the sequence of vertices is a walk and a trail. Walks, Trails, and Paths in Graph Theory Circuits In many applications of graph theory, such as creating efficient delivery routes, beginning and ending at the same location is a requirement. When a walk, path, or trail end at the same location or vertex they began, we call it closed . Otherwise, we call it open (does not begin and end at the same location or vertex). Some examples of closed walks, closed trails, and closed paths are given in in the following table. DESCRIPTION EXAMPLE CHARACTERISTICS A closed walk is a walk that begins and ends at the same vertex. d → f → b → c → f → d Alternating sequence of vertices and edges Begins and ends at the same vertex A closed trail is a trail that begins and ends at the same vertex. It is commonly called a circuit . d → f → b → c → f → e → d No repeated edges Begins and ends at the same vertex A closed path is a path that begins and ends at the same vertex. It is also referred to as a directed cycle because it travels through a cyclic subgraph. d → f → b → c → d No repeated edges or vertices Begins and ends at the same vertex Closed Walks, Trails, and Paths Since walks, trails, and paths are all related, closed walks, circuits, and directed cycles are related too. All circuits are closed walks, but closed walks that visit the same edge twice are not circuits. All directed cycles are circuits, but circuits in which a vertex is visited twice are not directed cycles. We can visualize the relationship as in . Closed Walks, Circuits, and Directed Cycles The same circuit can be named using any of its vertices as a starting point. For example, the circuit d → f → b → c → d can also be referred to in the following ways. a → b → c → d → a is the same as { b → c → d → a → b c → d → a → b → c d → a → b → c → d Let’s practice working with closed walks, circuits (closed trails), and directed cycles (closed paths). In the graph in , the vertices are major central and south Florida airports. The edges are direct flights between them. Major Central and South Florida Airports Determining a Closed Walk, Circuit, or Directed Cycle Suppose that you need to travel by air from Miami (MIA) to Orlando (MCO) and you were restricted to flights represented on the graph. For the trip to Orlando, you decide to purchase tickets with a layover in Key West (EYW) as shown in , but you still have to decide on the return trip. Determine if your roundtrip itinerary is a closed walk, a circuit, and/or a directed cycle, based on the return trip described in each part. MIA to EYW to MCO You returned to Miami (MIA) by reversing your route. Your direct flight back left Orlando (MCO) but was diverted to Fort Lauderdale (FLL)! From there you flew to Tampa (TPA) before returning to Miami (MIA). The whole trip was MIA → EYW → MCO → EYW → MIA . This is a closed walk, because it is a walk that begins and ends at the same vertex. It is not a circuit, because it repeats edges. If it is not a circuit, then it cannot be a directed cycle. The whole trip was MIA → EYW → MCO → FLL → TPA → MIA . This is a closed walk, because it is a walk that begins and ends at the same vertex. It is a circuit because no edges were repeated. It is also a directed cycle because no vertices were repeated either. So, it is all three! Closed Walks, Closed Trails (Circuits), and Closed Paths (Directed Cycles) in Graph Theory Graph Colorings In this section so far, we have looked at how to navigate graphs by proceeding from one vertex to another in a sequence that does not skip any vertices, but in some applications we may want to skip vertices. Remember the camp Olympics at Camp Woebegone in Comparing Graphs ? You were planning a camp Olympics with four events. The campers signed up for the events. You drew a graph to help you visualize which events have campers in common. The vertices of Graph E in represent the events and adjacent vertices indicate that there are campers who are participating in both. Graphs of Camp Olympics In this case, we do NOT want events represented by two adjacent vertices to occur in the same timeslot, because that would prevent the campers who wanted to participate in both from doing so. We can use the graph in to count the timeslots we need so there are no conflicts. Let’s assign each timeslot a different color. We could categorize events that happen at 1 pm as Red; 2 pm, Purple; 3 pm, Blue; and 4 pm, Green. Then assign different colors to any pair of adjacent vertices to ensure that the events they represent do not end up in the same timeslot. shows several of the ways to do this while obeying the rule that no pair of adjacent vertices can be the same color. Graph Colorings In , the graphs with vertices colored so that no adjacent vertices are the same color are called graph colorings . Notice that Graph 3 has the fewest colors, which means it shows us how to have the fewest number of timeslots. The events marked in red, a and d , can be held at the same time because they are not adjacent and do not have conflicts. Also, the events marked in purple, b and c , can be held at the same time. We would not need green or blue timeslots at all! A graph that uses n colors is called an n -coloring . The smallest number of colors needed to color a particular graph is called its chromatic number . Graph colorings can be used in many applications like the scheduling scenario at camp Woebegone. Let's look at how they work in more detail. shows two different colorings of a particular graph. Coloring A is called a four-coloring, because it uses four colors, red (R), green (G), blue (B), and purple (P). Coloring B is called a three-coloring because it uses three. The colors allow us to visually subdivide the graphs into groups. The only rule is that adjacent vertices are different colors so that they are in different groups. Two Colorings of the Same Graph It turns out that a three-coloring is the best we can do with the graph in . No matter how many different patterns you try with only two colors, you will never find one in which the adjacent vertices are always different colors. In other words, the graph has a chromatic number of three. For large graphs, computer assistance is usually required to find the chromatic numbers. There is no formula for finding the chromatic number of a graph, but there are some facts that are helpful in . Fact Example Recall that planar graphs are untangled; that is, they can be drawn on a flat surface so that no two edges are crossing. If a graph is planar, it can be colored with four colors or possibly fewer. Each vertex in a complete graph is adjacent to every other vertex forcing us to color them all different colors. The chromatic number of a complete graph is the same as the number of vertices. If a graph has a clique, a complete subgraph, then each vertex in the clique must have a different color and the vertices outside the clique may or may not have even more colors. The chromatic number of a graph is at least the number of vertices in its biggest clique. Facts about Graph Colorings Creating Colorings to Solve Problems Let’s see how these facts can help us color the graph in . Since the graph is planar, the chromatic number is no more than four. The graph is not complete, but it has complete subgraphs of three vertices. In other words, it has triangles like the one shown with blue vertices in . This means that the chromatic number is at least three. A Graph with Triangles We know we can color this graph in three or four colors. It is usually best to start by coloring the vertex of highest degree as shown in . In this case, we used red (R). The color is not important. Color Highest Degree Vertex First We want to color as many of the vertices the same color as possible; so, we look at all the vertices that are not adjacent to the red vertex and begin to color them, red starting with the one among them of highest degree. Since the only vertices that are not adjacent are both degree 2, choose either one and color it red as shown in . Color More Red from Highest to Lowest Degree Now, there is only one vertex left that is not adjacent to a red; so, color it red. Of the remaining vertices, the highest degree is four; so, color one of the vertices of degree four in a different color. These two steps are shown in . Complete the Reds and Start Another Color Repeat the same procedure. There are three remaining vertices that are not adjacent to a blue. Color as many blue as possible, with priority going to vertices of higher degree as shown in . Repeat Procedure for Color Blue All the remaining vertices are adjacent to blue. So, it is time to repeat the procedure with another color as shown in . Repeat Procedure for Color Purple All the vertices are now colored with a three-coloring so we know the chromatic number is at most three, but we knew the chromatic number was at least three because the graph has a triangle. So, we are now certain it is exactly three. Coloring Graphs Part 1: Coloring and Identifying Chromatic Number Suppose the vertices of the graph in represented the nine events in the Camp Woebegone Olympics, and edges join any events that have campers in common, but nonadjacent vertices do not. Coloring for Nine Event Camp Woebegone Olympics Any vertices of the same color are nonadjacent; so, they have no conflicts. Since this graph is a three-coloring, all nine events could be scheduled in just three timeslots! Understanding Chromatic Numbers In , we discussed a high school, which holds end-of-course exams in (E3) English 3, (E4) English 4, (M) Advanced Math, (C) Calculus, (W) World History, (U) U.S. History, (B) Biology, and (P) Physics. We were given a list of courses that had no students in common. We used that information to find the graph in , which shows edges between exams with students in common. Use the graph we found in to answer each question. Graph of Exams with Students in Common The graph contains a clique of size 4 formed by the vertices P, E3, C, and U. What does this tell you about the chromatic number? The graph is not planar, meaning that you cannot untangle it. What does this tell you about the chromatic number? Create a coloring by coloring vertex of highest degree first, coloring as many other vertices as possible each color from highest to lowest degree, then repeating this process for the remaining vertices. Do you know what the minimum number of timeslots is? If so, what is it and how do you know? If not, what are the possibilities? We would need four different colors just for the clique with four vertices; so, the chromatic number is at least four. It is possible for the chromatic number to be greater than four. The process is shown in . This is the original graph. Vertex B has highest degree. Color vertex B. Vertex E3 is the only remaining vertex that is NOT adjacent to B. Color vertex E3 the same color. Vertices P, U, W, and C are the remaining vertices with highest degree. Pick one to color. Color vertex P a new color. Vertices E4 and M are NOT adjacent to P, and M has higher degree. Color vertex M the same color. Vertex E4 is the only remaining vertex NOT adjacent to P or M. Color vertex E4 the same color. Vertices U, W, and C are the remaining vertices with highest degree. Pick one to color. Color U a new color. Vertex W is the only remaining vertex NOT adjacent to U. Color vertex W the same color. Vertex C is the only remaining vertex that has NOT been colored. Color vertex C a new color. The coloring is final. We used four colors. Coloring the Graph The last graph in is the final coloring. Yes, the minimum number of times slots is the chromatic number. We knew the chromatic number had to be at least four because there was a clique with four vertices. Now we have found a four-coloring of the graph which tells us that the chromatic number is at most four. So, we know four must be the chromatic number. The procedure used in Example 22 to color the graph is not guaranteed to result in a graph that has the minimum number of colors possible, but it is usually results in a coloring that is close to the chromatic number. The Four Color Problem Using only four colors, no two adjacent regions have the same color. The idea of coloring graphs to solve problems was inspired by one of the most famous problems in mathematics, the “four color problem.” The idea was that, no matter how complicated a map might be, only four colors were needed to color the map so that no two regions that shared a boundary would be the same color. For many years, everyone suspected this to be true, because no one could create a map that needed more than four colors, but they couldn’t prove it was true in general. Finally, graphs were used to solve the problem! The Four Color Map Theorem – Numberphile We saw how maps can be represented as graphs in Graph Basics . from shows a map of the midwestern region of the United States. Map of Midwestern States shows how this map can be associated with a graph in which each vertex represents a state and each edge indicates the states that share a common boundary. shows the final graph. Edge Assigned to Each Pair of Midwestern States with Common Border Final Graph Representing Common Boundaries between Midwestern States Notice that the graph representing the common boundaries between midwestern states is planar, meaning that it can be drawn on a flat surface without edges crossing. As we have seen, any planar graph has a chromatic number of four or less. This very well-known fact is called the Four-Color Theorem , or Four-Color Map Theorem . Coloring Graphs Part 2: Coloring Maps and the Four Color Problem Four-Color Theorem In the 19th century, Francis Guthrie was coloring a map of British counties and noticed that he could color so that no two adjacent counties were the same color using only four colors. This seemed to be the case for other maps as well, but he could not figure out why. He shared this with his brother, Frederick, who subsequently took the problem to his professor, August De Morgan, one of the most famous mathematicians of all time. De Morgan never was able to solve the problem, but he shared it with his colleagues. The problem continued to intrigue and perplex mathematicians for over a hundred years, inspiring discoveries in several areas of mathematics. It was finally proven by Kenneth Appel and Wolfgang Haken from the University of Illinois in 1976 using a combination of computer-aided calculations and graph theory. This was the first time in history that a mathematical theorem was proven using a computer! (Jesus Najera, “The Four-Color Theorem,” Cantor’s Paradise , a Medium publication, October 22, 2019) Using Four Colors or Fewer to Color a Graph Find a coloring of the graph in , which uses four colors or fewer. Use the resulting coloring as a guide to recolor the map in . How many colors did you use? Does this support the conclusion of the Four-Color Theorem? If so, how? The steps to color the graph are shown in . Step 1: Graph with degrees of vertices labeled. Vertex IA has highest degree. Step 2: Color vertex IA any color. Vertices ND, KS, MI, OH, and IN are NOT adjacent to IA. MI and IN have highest degree, 3. Step 3: Color either MI or IN the same color as IA. Vertex ND and KS are the only remaining vertices not adjacent to a red vertex. They both have degree 2. Step 4: Since KS and ND are not adjacent to each other, we can save a step and color both red. The highest degree of remaining vertices is four. Step 5: Choose one of the vertices of degree 4, SD, to color with a new color, blue. The vertices WI, IL, MO, IN,and OH are NOT adjacent to blue. WI, IL, and MO have the highest degree. Step 6: Choose one of WI, IL, or MO to color. We color WI blue. MO, IN and OH are NOT adjacent to blue. MO has the highest degree of these. Step 7: Color MO blue. All remaining vertices are adjacent to blue. Choose a new color. Four vertices remain, MN, NE, IL, and OH. MN, NE, and IL have the highest degree. Step 8: Since MN, IL, and NE are not adjacent, save steps and color all three the new color, purple. Vertex OH is the only remaining vertex that has NOT been colored. Step 9: Since vertex OH is not adjacent to purple, color it purple. This is the final graph. We used three colors. Steps to Color Graph of Midwestern States The final graph in shows how we would color the map. In we have colored the map to correspond to the colors on the graph. Midwestern States in Three Colors We used three colors to color the graph. This supports the Four-Color Theorem, because the graph is planar and its chromatic number is less than four. Coloring A Möbius Strip Have you ever heard of a möbius strip? It is a flat object with only one side. This might sound theoretical, but you can make one for yourself. Take a narrow strip of paper, make a half twist in it, and tape the ends together. To prove to yourself that it has only one side, pick a point anywhere on the paper and start drawing a line. You can draw the line continuously without lifting your pen from the paper and eventually, you will get back to the point at which you started. Since you never had to flip over the paper, you have just proved it has one side! Now, you might be wondering what this has to do with Graph Theory. It turns out that a map drawn on a möbius strip cannot necessarily be drawn using four colors. This doesn’t contradict the Four-Color Theorem, which only applies to graphs that are planar. A möbius strip does not live on a “plane,” or flat surface, which means the maps are not always planar like those drawn on a flat piece of paper. In the case of a möbius strip, it is the Six-Color Map Theorem! is an example of a möbius strip with a map that requires five colors. A Five-Coloring on a Möbius Strip Neil deGrasse Tyson Explains the Möbius Strip Check Your Understanding Key Terms walk (directed walk) trail (directed trail) path (directed path) closed open closed walk circuit (closed trail) directed cycle (closed path) coloring (graph coloring) n -coloring chromatic number Key Concepts Walks, trails, and paths are ways to navigate through a graph using a sequence of connected vertices and edges. Closed walks, circuits, and directed cycles are ways to navigate from a vertex on a graph and return to the same vertex. Colorings are a way to organize the vertices of a graph into groups so that no two members of a group are adjacent. Maps can be represented with planar graphs, which can always be colored using four colors or fewer. Videos Walks, Trails, and Paths in Graph Theory Closed Walks, Closed Trails (Circuits), and Closed Paths (Directed Cycles) in Graph Theory Coloring Graphs Part 1: Coloring and Identifying Chromatic Number The Four Color Map Theorem – Numberphile Coloring Graphs Part 2: Coloring Maps and the Four Color Problem Neil deGrasse Tyson Explains the Möbius Strip

Math


Euler Circuits Delivery trucks move goods from place to place. (credit: “Mack Midliner” by Jason Lawrence/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Determine if a graph is connected. State the Chinese postman problem. Describe and identify Euler Circuits. Apply the Euler Circuits Theorem. Eulerize graphs in real-world applications. The delivery of goods is a huge part of our daily lives. From the factory to the distribution center, to the local vendor, or to your front door, nearly every product that you buy has been shipped multiple times to get to you. If the cost and time of that delivery is too great, you will not be able to afford the product. Delivery personnel have to leave from one location, deliver the goods to various places, and then return to their original location and do all of this in an organized way without losing money. How do delivery services find the most efficient delivery route? The answer lies in graph theory. Connectedness Before we can talk about finding the best delivery route, we have to make sure there is a route at all. For example, suppose that you were tasked with visiting every airport on the graph in by plane. Could you accomplish that task, only taking direct flight paths between airports listed on this graph? In other words, are all the airports connected by paths? Or are some of the airports disconnected from the others? Major Central and South Florida Airports In , we can see TPA is adjacent to PBI, FLL, MIA, and EYW. Also, there is a path between TPA and MCO through FLL. This indicates there is a path between each pair of vertices. So, it is possible to travel to each of these airports only taking direct flight paths and visiting no other airports. In other words, the graph is connected because there is a path joining every pair of vertices on the graph. Notice that if one vertex is connected to each of the others in a graph, then all the vertices are connected to each other. So, one way to determine if a graph is connected is to focus on a single vertex and determine if there is a path between that vertex and each of the others. If so, the graph is connected. If not, the graph is disconnected, which means at least one pair of vertices in a graph is not joined by a path. Let’s take a closer look at graph X in . Focus on vertex a . There is a path between vertices a and b , but there is no path between vertex a and vertex c . So, Graph X is disconnected. Connected vs. Disconnected When you are working with a planar graph, you can also determine if a graph is connected by untangling it. If you draw it so that so that none of the edges are overlapping, like we did with Graph X in , it is easier to see that the graph is disconnected. Untangling Graph X Versions 2 and 3 of Graph X in each have the same number of vertices, number of edges, degrees of the vertices, and pairs of adjacent vertices as version 1. In other words, each version retains the same structure as the original graph. Since versions 2 and 3 of Graph X , do not have overlapping edges, it is easier to identify pairs of vertices that do not have paths between them, and it is more obvious that Graph X is disconnected. In fact, there are two completely separate, disconnected subgraphs, one with the vertices in { a, b, e }, and the other with the vertices { c, d, f } These sets of vertices together with all of their edges are called components of Graph X . A component of a graph is a subgraph in which there is a path between each pair of vertices in the subgraph, but no edges between any of the vertices in the subgraph and a vertex that is not in the subgraph. Now let’s focus on Graph Y from . As in Graph X , there is a path between vertices a and b , as well as between vertices a and e , but Graph Y is different from Graph X because of vertex g . Not only is there a path between vertices a and g , but vertex g bridges the gap between a and c with the path a → b → g → c . Similarly, there is a path between vertices a and d and vertices a and f : a → b → g → d , a → b → g → d → f . Since there is a path between vertex a and every other vertex, Graph Y is connected. You can also see this a bit more clearly by untangling Graph Y as in . Even when Y is drawn so that the edges do not overlap, the graph cannot be drawn as two separate, unconnected pieces. In other words, Graph Y has only one component with the vertices { a, b, c, d, e, f }. We can give an alternate definition of connected and disconnected using the idea of components. A graph is connected if it has only one component. A graph is disconnected if it has more than one component. These alternate definitions are equivalent to the previous definitions. This means that you can confirm a graph is connected or disconnected either by checking to see if there is a path between each vertex and each other vertex, or by identifying the number of components. A graph is connected if it has only one component. Untangling Graph Y Determining If a Graph Is Connected or Disconnected Use to answer each question. Graph E Find a path between vertex a and every other vertex on the graph, if possible. Identify all the components of Graph E . Determine whether the graph is connected or disconnected and explain how you know. The paths are a → d → b , a → d → c , and a → d . There is only one component in Graph E . It has the vertices { a, b, c, d }. The graph is connected, because there is a path between vertex a and every other vertex. We can also show that Graph E is connected because it has only one component. Connected and Disconnected Graphs in Graph Theory Applying Connectedness The U.S. Interstate Highway System extends throughout the 48 contiguous states. It also has routes in the states of Hawaii and Alaska, and the commonwealth of Puerto Rico. Consider a graph representing the U.S. Interstate Highway System, in which there is a vertex for each of the 50 states and Puerto Rico, and an edge is drawn between any two vertices representing states that are connected by a highway in that system. Would this graph be connected or disconnected? Explain your reasoning. Hawaii, Alaska, and Puerto Rico are geographically separate from the 48 contiguous states, and each from each other. This means that there are vertices on the graph with no path joining them to the other vertices. So the graph is disconnected. Origin of Euler Circuits The city of Konigsberg, modern day Kaliningrad, Russia, has waterways that divide up the city. In the 1700s, the city had seven bridges over the various waterways. The map of those bridges is shown in . The question as to whether it was possible to find a route that crossed each bridge exactly once and return to the starting point was known as the Konigsberg Bridge Problem. In 1735, one of the most influential mathematicians of all time, Leonard Euler, solved the problem using an area of mathematics that he created himself, graph theory! Map of the Bridges of Konigsberg in 1700s (credit: “Konigsberg Bridge” by Merian Erben/Wikimedia Commons, Public Domain) Euler drew a multigraph in which each vertex represented a land mass, and each edge represented a bridge connecting them, as shown in . Remember from Navigating Graphs that a circuit is a trail, so it never repeats an edge, and it is closed, so it begins and ends at the same vertex. Euler pointed out that the Konigsberg Bridge Problem was the same as asking this graph theory question: Is it possible to find a circuit that crosses every edge? Since then, circuits (or closed trails) that visit every edge in a graph exactly once have come to be known as Euler circuits in honor of Leonard Euler. Recognizing Euler Trails and Euler Circuits Euler was able to prove that, in order to have an Euler circuit, the degrees of all the vertices of a graph have to be even. He also proved that any graph with that characteristic must have an Euler circuit. So, saying that a connected graph is Eulerian is the same as saying it has vertices with all even degrees, known as the Eulerian circuit theorem . Graph of Konigsberg Bridges To understand why the Euler circuit theorem is true, think about a vertex of degree 3 on any graph, as shown in . A Vertex of Degree 3 First imagine the vertex of degree 3 shown in is not the starting vertex. At some point, each edge must be traveled. The first time one of the three edges is traveled, the direction will be toward the vertex, and the second time it will be away from the vertex. Then, at some point, the third edge must be traveled coming in toward the vertex again. This is a problem, because the only way to get back to the starting vertex is to then visit one of the three edges a second time. So, this vertex cannot be part of an Euler circuit. Next imagine the vertex of degree 3 shown in is the starting vertex. The first time one of the edges is traveled, the direction is away from the vertex. At some point, the second edge will be traveled coming in toward the vertex, and the third edge will be the way back out, but the starting vertex is also the ending vertex in a circuit. The only way to return to the vertex is now to travel one of the edges a second time. So, again, this vertex cannot be part of an Euler circuit. For the same reason that a vertex of degree 3 can never be part of an Euler circuit, a vertex of any odd degree cannot either. We can use this fact and the graph in to solve the Konigsberg Bridge Problem. Since the degrees of the vertices of the graph in are not even, the graph is not Eulerian and it cannot have an Euler circuit. This means it is not possible to travel through the city of Konigsberg, crossing every bridge exactly once, and returning to your starting position. Degrees of Vertices in Konigsberg Bridge Multigraph Existence of Euler Circuits in Graph Theory Chinese Postman Problem At Camp Woebegone, campers travel the waterways in canoes. As part of the Camp Woebegone Olympics, you will hold a canoeing race. You have placed a checkpoint on each of the 11 different streams. The competition requires each team to travel each stream, pass through the checkpoints in any order, and return to the starting line, as shown in the . Map of Canoe Event Checkpoints Since the teams want to go as fast as possible, they would like to find the shortest route through the course that visits each checkpoint and returns to the starting line. If possible, they would also like to avoid backtracking. Let’s visualize the course as a multigraph in which the vertices represent turns and the edges represent checkpoints as in . Multigraph of Canoe Event The teams would like to find a closed walk that repeats as few edges as possible while still visiting every edge. If they never repeat an edge, then they have found a closed trail, which is a circuit. That circuit must cover all edges; so, it would be an Euler circuit. The task of finding a shortest circuit that visits every edge of a connected graph is often referred to as the Chinese postman problem . The name Chinese postman problem was coined in honor of the Chinese mathematician named Kwan Mei-Ko in 1960 who first studied the problem. If a graph has an Euler circuit, that will always be the best solution to a Chinese postman problem. Let’s determine if the multigraph of the course has an Euler circuit by looking at the degrees of the vertices in . Since the degrees of the vertices are all even, and the graph is connected, the graph is Eulerian. It is possible for a team to complete the canoe course in such a way that they pass through each checkpoint exactly once and return to the starting line. Degrees of Vertices in Graph of Canoe Event Understanding Eulerian Graphs A postal delivery person must deliver mail to every block on every street in a local subdivision. is a map of the subdivision. Use the map to answer each question. Map of Subdivision Draw a graph or multigraph to represent the subdivision in which the vertices represent the intersections, and the edges represent streets. Is your graph connected? Explain how you know. Determine the degrees of the vertices in the graph. Is your graph an Eulerian graph? Is it possible for the postal delivery person to visit each block on each street exactly once? Justify your answer. The graph is in . Graph of Subdivision The graph is connected. It has only one component and there is a path between each pair of vertices. There are four corner vertices of degree 2, there are eight exterior vertices of degree 3, and there are four interior vertices of degree 4. The graph is not Eulerian because it has vertices of odd degree. No. Since the graph is not Eulerian, there is no Euler circuit, which means that there is no route that would pass through every edge exactly once. Identifying Euler Circuits Solving the Chinese postman problem requires finding a shortest circuit through any graph or multigraph that visits every edge. In the case of Eulerian graphs, this means finding an Euler circuit. The method we will use is to find any circuit in the graph, then find a second circuit starting at a vertex from the first circuit that uses only edges that were not in the first circuit, then find a third circuit starting at a vertex from either of the first two circuits that uses only edges that were not in the first two circuits, and then continue this process until all edges have been used. In the end, you will be able to link all the circuits together into one large Euler circuit. Let’s find an Euler circuit in the map of the Camp Woebegone canoe race. In , we have labeled the edges of the multigraph so that the circuits can be named. In a multigraph it is necessary to name circuits using edges and vertices because there can be more than one edge between adjacent vertices. Multigraph of Canoe Race with Vertices and Edges Labeled We will begin with vertex 1 because it represents the starting line in this application. In general, you can start at any vertex you want. Find any circuit beginning and ending with vertex 1. Remember, a circuit is a trail, so it doesn’t pass through any edge more than once. shows one possible circuit that we could use as the first circuit, 1 → A → 2 → B → 3 → C → 4 → G → 5 → J → 1. First Circuit From the edges that remain, we can form two more circuits that each start at one of the vertices along the first circuit. Starting at vertex 3 we can use 3 → H → 5 → I → 1 → K → 3 and starting at vertex 2 we can use 2 → D → 6 → E → 7 → F → 2, as shown in . Second and Third Circuits Now that each of the edges is included in one and only once circuit, we can create one large circuit by inserting the second and third circuits into the first. We will insert them at their starting vertices 2 and 3 1 → A → 2 → B → 3 → C → 4 → G → 5 → J → 1 becomes 1 → A → 2 → D → 6 → E → 7 → F → 2 → B → 3 → H → 5 → I → 1 → K → 3 → C → 4 → G → 5 → J → 1 Finally, we can name the circuit using vertices, 1 → 2 → 6 → 7 → 2 → 3 → 5 → 1 → 3 → 4 → 5 → 1, or edges, A → D → E → F → B → H → I → K → C → G → J . Let's review the steps we used to find this Eulerian Circuit. Steps to Find an Euler Circuit in an Eulerian Graph Step 1 - Find a circuit beginning and ending at any point on the graph. If the circuit crosses every edges of the graph, the circuit you found is an Euler circuit. If not, move on to step 2. Step 2 - Beginning at a vertex on a circuit you already found, find a circuit that only includes edges that have not previously been crossed. If every edge has been crossed by one of the circuits you have found, move on to Step 3. Otherwise, repeat Step 2. Step 3 - Now that you have found circuits that cover all of the edges in the graph, combine them into an Euler circuit. You can do this by inserting any of the circuits into another circuit with a common vertex repeatedly until there is one long circuit. Finding an Euler Circuit Use to answer each question. Graph F Verify the Graph F is Eulerian. Find an Euler circuit that begins and ends at vertex c . The graph is connected because it has only one component. Also, each of the vertices in graph F has even degree as shown in . So, the graph is Eulerian. Degrees of Vertices in Graph F Step 1: Beginning at vertex c , identify circuit c → e → b → c as shown in . Since this circuit does not cover every edge in the graph, move on to Step 2. First Circuit in Graph F Step 2: Find another circuit beginning at one of the vertices in the first circuit, using only edges that have not been used in the first circuit. It is possible to do this using either vertex c or vertex b . In , we have used vertex b as the starting and ending point for a second circuit, b → d → c → a → b . Since all edges have been crossed by one of the two circuits, move on to Step 3. Second Circuit in Graph F Step 3: Combine the two circuits into one. Replace vertex b in the first circuit with the whole second circuit that begins at vertex b . c → e → b → c becomes c → e → b → d → c → a → b → c . An Euler circuit that begins at vertex c is c → e → b → d → c → a → b → c . Eulerization The Chinese postman problem doesn’t only apply to Eulerian graphs. Recall the postal delivery person who needed to deliver mail to every block of every street in a subdivision. We used the map in to create the graph in . Map of Subdivision Graph of Subdivision Since the graph of the subdivision has vertices of odd degree, there is no Euler circuit. This means that there is no route through the subdivision that visits every block of every street without repeating a block. What should our delivery person do? They need to repeat as few blocks as possible. The technique we will use to find a closed walk that repeats as few edges as possible is called eulerization . This method adds duplicate edges to a graph to create vertices of even degree so that the graph will have an Euler circuit. In , the eight vertices of odd degree in the graph of the subdivision are circled in green. We have added duplicate edges between the pairs of vertices, which changes the degrees of the vertices to even degrees so the resulting multigraph has an Euler circuit. In other words, we have eulerized the graph. An Eulerized Graph The duplicate edges in the eulerized graph correspond to blocks that our delivery person would have to travel twice. By keeping these duplicate edges to a minimum, we ensure the shortest possible route. It can be challenging to determine the fewest duplicate edges needed to eulerize a graph, but you can never do better than half the number of odd vertices. In the graph in , we have found a way to fix the eight vertices of odd degree with only four duplicate edges. Since four is half of eight, we will never do better. IMPORTANT! The duplicate edges that we add indicate places where the route will pass twice. An entirely new edge between two vertices that were not previously adjacent would indicate that our postal delivery person created a new road through someone’s property! So, we can duplicate existing edges, but we cannot create new ones . Eulerizing Graphs Use Graph A and multigraphs B , C , D , and E given in to answer the questions. Graph A and Multigraphs B through E Which of the multigraphs are not eulerizations of Graph A ? Explain your answer. Which eulerization of Graph A uses the fewest duplicate edges? How many does it use? Is it possible to eulerize Graph A using fewer duplicate edges than your answer to part 2? If so, give an example. If not, explain why not. Multigraph B is not an eulerization of A because the edge N between vertices c and d is not a duplicate of an existing edge. Multigraph E is not an eulerization of A because vertices b and e have odd degree. Multigraph C uses 3 duplicate edges while multigraph D only uses 2. So, D uses the fewest. Since there were four vertices of odd degree in Graph A , the fewest number of edges that could possibly eulerize the graph is half of four, which is two. So, it is not possible to eulerize Graph A using fewer edges. IMPORTANT! Since only duplicate edges can be added to eulerize a graph, it is not possible to eulerize a disconnected graph. Map of the Magical Land of Oz (credit: “Map of Oz within the surrounding deserts” by L. Frank Baum/Wikimedia Commons, Public Domain) In The Wonderful Wizard of Oz , written by L. Frank Baum and illustrated by W. W. Denslow, the region of the Emerald City lies at the center of the magical land of Oz, with Gillikin Country to the north, Winkie Country to the east, Munchkin Country to the west, and Quadling Country to the south. Munchkin Country and Winkie Country each shares a border with Gillikin Country and Quadling Country. Let’s apply graph theory to Dorothy’s famous journey through Oz. Draw a graph in which each vertex is one of the regions of Oz. Then answer each question: Is there an Euler trail circuit that Dorothy could follow, instead of the yellow brick road, to lead her from the land of the Munchkins, through all the regions of Oz and back, passing over each border exactly once? If not, how could the graph be Eulerized most efficiently? What is the chromatic number of the graph? Find a graph coloring that demonstrates your answer and use it to draw and color a graph of Oz. Check Your Understanding Key Terms connected component disconnected Euler circuit Eulerian graph Chinese postman problem Eulerization Key Concepts A connected graph has only one component. The Euler circuit theorem states that an Euler circuit exists in every connected graph in which all vertices have even degree, but not in disconnected graphs or any graph with one or more vertices of odd degree. The Chinese postman problem asks how to find the shortest closed trail that visits all edges at least once. If an Euler circuit exists, it is always the best solution to the Chinese postman problem. Eulerization is the process of adding duplicate edges to a graph so that the new multigraph has an Euler circuit. The minimum number of duplicated edges needed to eulerize a graph is half the number of odd vertices or more. Videos Connected and Disconnected Graphs in Graph Theory Recognizing Euler Trails and Euler Circuits Existence of Euler Circuits in Graph Theory

Math


Euler Trails The Pony Express mail route spanned from California to Missouri. (credit: “Map of Pony Express” by Nathan Hughes Hamiltonh/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Describe and identify Euler trails. Solve applications using Euler trails theorem. Identify bridges in a graph. Apply Fleury’s algorithm. Evaluate Euler trails in real-world applications. We used Euler circuits to help us solve problems in which we needed a route that started and ended at the same place. In many applications, it is not necessary for the route to end where it began. In other words, we may not be looking at circuits, but trails, like the old Pony Express trail that led from Sacramento, California in the west to St. Joseph, Missouri in the east, never backtracking. Euler Trails If we need a trail that visits every edge in a graph, this would be called an Euler trail . Since trails are walks that do not repeat edges, an Euler trail visits every edge exactly once. Recognizing Euler Trails Use to determine if each series of vertices represents a trail, an Euler trail, both, or neither. Explain your reasoning. Graph H a → b → e → g → f → c → d → e a → b → e → g → f → c → d → e → b → a → d → g g → d → a → b → e → d → c → f → g → e It is a trail only. It is a trail because it is a walk that doesn’t cover any edges twice, but it is not an Euler trail because it didn’t cover edges ad or dg . It is neither. It is not a trail because it visits ab and be twice. Since it is not a trail, it cannot be an Euler trail. It is both. It is a trail because it is a walk that doesn’t cover any edges twice, and it is an Euler trail because it visits all the edges. The Five Rooms Puzzle Just as Euler determined that only graphs with vertices of even degree have Euler circuits, he also realized that the only vertices of odd degree in a graph with an Euler trail are the starting and ending vertices. For example, in , Graph H has exactly two vertices of odd degree, vertex g and vertex e . Notice the Euler trail we saw in Excercise 3 of began at vertex g and ended at vertex e . This is consistent with what we learned about vertices off odd degree when we were studying Euler circuits. We saw that a vertex of odd degree couldn't exist in an Euler circuit as depicted in . If it was a starting vertex, at some point we would leave the vertex and not be able to return without repeating an edge. If it was not a starting vertex, at some point we would return and not be able to leave without repeating an edge. Since the starting and ending vertices in an Euler trail are not the same, the start is a vertex we want to leave without returning, and the end is a vertex we want to return to and never leave. Those two vertices must have odd degree, but the others cannot. A Vertex of Degree 3 Let’s use the Euler trail theorem to solve a puzzle so you can amaze your friends! This puzzle is called the “Five Rooms Puzzle.” Suppose that you were in a house with five rooms and the exterior. There is a doorway in every shared wall between any two rooms and between any room and the exterior as shown in . Could you find a route through the house that passes through each doorway exactly once? Five Rooms Puzzle Let’s represent the puzzle with a graph in which vertices are rooms (or the exterior) and an edge indicates a door between two rooms as shown in . Graph of Five Rooms Puzzle To pass through each doorway exactly once means that we cross every edge in the graph exactly once. Since we have not been asked to start and end at the same position, but to visit each edge exactly once, we are looking for an Euler trail. Let’s check the degrees of the vertices. Degrees of Vertices in Five Rooms Puzzle Since there are more than two vertices of odd degree as shown in , the graph of the five rooms puzzle contains no Euler path. Now you can amaze and astonish your friends! Bridges and Local Bridges Now that we know which graphs have Euler trails, let’s work on a method to find them. The method we will use involves identifying bridges in our graphs. A bridge is an edge which, if removed, increases the number of components in a graph. Bridges are often referred to as cut-edges. In , there are several examples of bridges. Notice that an edge that is not part of a cycle is always a bridge, and an edge that is part of a cycle is never a bridge. Graph with Bridges Edges bf , cg , and dg are “bridges” The graph in is connected, which means it has exactly one component. Each time we remove one of the bridges from the graph the number of components increases by one as shown in . If we remove all three, the resulting graph in has four components. Removing a Bridge Increases Number of Components In sociology, bridges are a key part of social network analysis. Sociologists study two kinds of bridges: local bridges and regular bridges. Regular bridges are defined the same in sociology as in graph theory, but they are unusual when studying a large social network because it is very unlikely a group of individuals in a large social network has only one link to the rest of the network. On the other hand, a local bridge occurs much more frequently. A local bridge is a friendship between two individuals who have no other friends in common. If they lose touch, there is no single individual who can pass information between them. In graph theory, a local bridge is an edge between two vertices, which, when removed, increases the length of the shortest path between its vertices to more than two edges. In , a local bridge between vertices b and e has been removed. As a result, the shortest path between b and e is b → i → j → k → e , which is four edges. On the other hand, if edge ab were removed, then there are still paths between a and b that cover only two edges, like a → i → b . Removing a Local Bridge The significance of a local bridge in sociology is that it is the shortest communication route between two groups of people. If the local bridge is removed, the flow of information from one group to another becomes more difficult. Let’s say that vertex b is Brielle and vertex e is Ella. Now, Brielle is less likely to hear about things like job opportunities that Ella may know about. This is likely to impact Brielle as well as the friends of Brielle. Identifying Bridges and Local Bridges Use the graph of a social network in to answer each question. Graph of a Social Network Identify any bridges. If all bridges were removed, how many components would there be in the resulting graph? Identify one local bridge. For the local bridge you identified in part 3, identify the shortest path between the vertices of the local bridge if the local bridge were removed. The edges ku, gh , and hi are bridges. If the bridges were all removed, there would be four components in the resulting graph, { i }, { h }, { u , v , w , x }, and { a , b , c , d , e , f , g , j , k , m , n , o , p , q , r , s , t } as shown in . Graph of Social Network without Bridges Three local bridges are dn, ef , and qt , among others. If dn were removed, the shortest path between d and n would be d → e → f → j → o → m → n . Bridges and Local Bridges in Graph Theory Finding an Euler Trail with Fleury’s Algorithm Now that we are familiar with bridges, we can use a technique called Fleury’s algorithm , which is a series of steps, or algorithm, used to find an Euler trail in any graph that has exactly two vertices of odd degree. Here are the steps involved in applying Fleury’s algorithm. Step 1: Begin at either of the two vertices of odd degree. Step 2: Remove an edge between the vertex and any adjacent vertex that is NOT a bridge, unless there is no other choice, making a note of the edge you removed. Repeat this step until all edges are removed. Step 3: Write out the Euler trail using the sequence of vertices and edges that you found. For example, if you removed ab, bc, cd, de , and ef , in that order, then the Euler trail is a → b → c → d → e → f . shows the steps to find an Euler trail in a graph using Fleury’s algorithm. Using Fleury’s Algorithm To Find Euler Trail The Euler trail that was found in is t → v → w → u → t → w → y → x → v . Finding an Euler Trail with Fleury’s Algorithm Use Fleury’s Algorithm to find an Euler trail for Graph J in . Graph J Step 1: Choose one of the two vertices of odd degree, c or f , as your starting vertex. We will choose c . Step 2: Remove edge ca, cb , or cd . None of these are cut edges so we can select any of the three. We will choose cb as shown in to be the first edge removed. Graph J with cb Removed Repeat Step 2 The next choice is to remove edge ba, bd , or bf as shown in , but bf is not an option since it is a bridge. We will choose ba as shown in to be the second edge removed. Graph J with cb and ba Removed Repeat Step 2 for the third, fourth, fifth, sixth, and seventh edges. As shown in , until we get to the seventh edge there is only one option each time, ac, cd, db , and bf in that order. For the seventh edge, we must choose between fe and fg . Neither of these are bridges. We choose fe . shows that ac, cd, db, bf, and fe have been removed. Graph J with Seven Edges Removed Repeat Step 2 for the eight, ninth, tenth, and eleventh edges. As shown in , there is only one option for each of these edges, eh, hi, ig , and gf , in that order. Step 3: Write out the Euler trail using the vertices in the sequence that the edges were removed. We removed cb, ba, ac, cd, db, bf, fe, eh, hi, ig , and gf , in that order. The Euler trail is c → b → a → c → d → b → f → e → h → i → g → f . TIP! To avoid errors, count the number of edges in your graph and make sure that your Euler trail represents that number of edges. In the previous section, we found Euler circuits using an algorithm that involved joining circuits together into one large circuit. You can also use Fleury’s algorithm to find Euler circuits in any graph with vertices of all even degree. In that case, you can start at any vertex that you would like to use. Step 1: Begin at any vertex. Step 2: Remove an edge between the vertex and any adjacent vertex that is NOT a bridge, unless there is no other choice, making a note of the edge you removed. Repeat this step until all edges are removed. Step 3: Write out the Euler circuit using the sequence of vertices and edges that you found. For example, if you removed ab, bc, cd, de , and ea , in that order, then the Euler circuit is a → b → c → d → e → a . Fluery's Algorithm to Find an Euler Circuit IMPORTANT! Since a circuit is a closed trail, every Euler circuit is also an Euler trail, but when we say Euler trail in this chapter, we are referring to an open Euler trail that begins and ends at different vertices. Finding an Euler Circuit or Euler Trail Using Fleury’s Algorithm Use Fleury’s algorithm to find either an Euler circuit or Euler trail in Graph G in . Graph G Graph G has all vertices of even degree so it has an Euler circuit. Step 1: Choose any vertex. We will choose vertex j . Step 2: Remove one of the four edges that meet at vertex j . Since jn is a bridge, we must remove either jh, ji , or jk. We remove ji as shown in . Graph G with 1 Edge Removed Repeat Step 2: Since id is a bridge, we can remove either ih or ik next. We remove ih , and then the only option is to remove hj as shown in . Graph G with 3 Edges Removed Repeat Step 2: Since jn is a bridge, the next edge removed must be jk , and then the only option is to remove ki followed by id as shown in . Even though id is a bridge, it can be removed because it is the only option at this point. shows Graph G with these additional edges removed. Graph G with 6 Edges Removed Repeat Step 2: Choose any one of the edges db, dc , or de . We remove dc as shown in . Graph G with 7 Edges Removed Repeat Step 2: Since co is a bridge, choose cb next. We remove cb , then bd , and then de as shown in . Graph G with 10 Edges Removed Repeat Step 2: Next, remove ec and co . Then choose any of op, pn , or om . We remove on as shown in . Graph G with 13 Edges Removed Repeat Step 2: Next, remove either nm , np , or nj , but nj is a So, we remove nm as shown in . Graph G with 14 Edges Removed Repeat Step 2: Next, remove mo, op, pn , and nj . And we are done! Step 3: Notice that the algorithm brought us back to the vertex where we started, forming an Euler circuit. Write out the Euler circuit: j → i → h → j → k → i → d → c → b → d → e → c → o → n → m → o → p → n → j We have discussed a lot of subtle concepts in this section. Let’s make sure we are all on the same page. Work with a partner to explain why each of the following facts about bridges are true. Support your explanations with definitions and graphs. When a bridge is removed from a graph, the number of components increases. A bridge is never part of a circuit. An edge that is part of a triangle is never a local bridge. Check Your Understanding Key Terms algorithm Fleury’s algorithm Euler trail bridge local bridge Key Concepts An Euler trail exists whenever a graph has exactly two vertices of odd degree. When a bridge is removed from a graph, the number of components increases. A bridge is never part of a circuit. When a local bridge is removed from a graph, the distance between vertices increases. An edge that is part of a triangle is never a local bridge. Videos Bridges and Local Bridges in Graph Theory Fluery's Algorithm to Find an Euler Circuit

Math


Hamilton Cycles The symmetries of an icosahedron, with 30 edges, 20 faces, and 12 vertices, can be analyzed using graph theory. (credit: "Really big icosahedron" by Clayton Shonkwiler/Wikimedia, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Describe and identify Hamilton cycles. Compute the number of Hamilton cycles in a complete graph. Apply and evaluate weighted graphs. In Euler Circuits and Euler Trails , we looked for circuits and paths that visited each edge of a graph exactly once. In this section, we will look for circuits that visit each vertex exactly once. Like many concepts in graph theory, the idea of a circuit that visits each vertex once was inspired by games and puzzles. As early as the 9th century, Indian and Islamic intellectuals wondered whether it was possible for a knight to visit every space on a chess board of a given size, which is equivalent to visiting every vertex of a graph that represents the chess board. In 1857, a mathematician named William Rowan Hamilton invented a puzzle in which players were asked to find a route along the edges of a dodecahedron (see ), which visited every vertex exactly once. Let’s explore how graph theory provides insight into these games as well as practical applications such as the Traveling Salesperson Problem. A Dodecahedron Hamilton’s Puzzle Before we look at the solution to Hamilton's puzzle, let’s review some vocabulary we used in . It will be helpful to remember that directed cycle is a type of circuit that doesn’t repeat any edges or vertices. Closed Walks, Circuits, and Directed Cycles The goal of Hamilton's puzzle was to find a route along the edges of the dodecahedron, which visits each vertex exactly once. A dodecahedron is a three-dimensional space figure with faces that are all pentagons as we saw in . Since it is easier to visualize two dimensions rather than three, we will flatten out the dodecahedron and look at the edges and vertices on a flat surface. Graph A in shows a two-dimensional graph of the edges and vertices, and Graph B shows an untangled version of Graph A in which no edges are crossing. Graph B in is very similar to the design of the game board that Hamilton invented for his puzzle. Untangle graph Graph of Edges and Vertices of Dodecahedron We can see that this is a planar graph because it can be “untangled.” In order to solve Hamilton’s puzzle, we need to find a circuit that visits every vertex once. A solution is shown in . In three Dimensions > A Solution to Hamilton’s Puzzle A circuit that doesn’t repeat any vertices, like the one in , is called a directed cycle. So, we can most accurately say that Hamilton’s puzzle asks us to find a directed cycle that visits every vertex in a graph exactly once. Because Hamilton created and solved this puzzle, these special circuits were named Hamilton cycles , or Hamilton circuits . Icosian Game When Hamilton invented his puzzle in the 19th century, it was originally called the Icosian game. This was a reference to an icosahedron, not a dodecahedron. Why? Hamilton was interested in the symmetries of icosahedrons, specifically regular icosahedrons, which have faces that are all equilateral triangles. It turns out that this space figure has a surprising correspondence with the regular dodecahedron, a space figure with faces that are all regular pentagons. This pair of space figures have the same number of edges, while the number of faces and vertices are swapped. The icosahedron has 30 edges, 20 faces, and 12 vertices, while the dodecahedron has 30 edges, 12 faces, and 20 vertices. By relating the vertices of the dodecahedron to the faces of the icosahedron, Hamilton was able to make the mathematical connections necessary to use graph theory and dodecahedrons to make discoveries about the symmetries of icosahedrons. Hamilton Cycles vs. Euler Circuits Let’s practice naming and identifying Hamilton cycles, as well as distinguishing them from Euler circuits. It is important to remember that Euler circuits visit all edges without repetition, while Hamilton cycles visit all vertices without repetition. Hamilton cycles are named by their vertices just like all circuits. An example is given in . Hamilton Cycle in Graph Z Notice that the Hamilton cycle a → b → c → d for Graph Z in is NOT an Euler circuit, because it does not visit edge ac . Some Hamilton cycles are also Euler circuits while some are not, and some Euler circuits are Hamilton cycles while some are not. TIP! Sometimes students confuse Euler circuits with Hamilton cycles. To help you remember, think of the E in Euler as standing for Edge. Differentiating between Hamilton Cycles or Euler Circuits Use to determine whether the given circuit is a Hamilton cycle, an Euler circuit, both, or neither. Graph Q a → b → c → e → h → g → f → d → a g → e → h → g → f → d → a → b → d → g a → b → c → e → h → g → f → d → b → e → g → d → a This circuit is a Hamilton cycle only. It visits each vertex exactly once, so, it is a Hamilton cycle. It is not an Euler circuit because it doesn’t visit all of the edges. This circuit is neither Hamilton cycle nor an Euler circuit. It doesn’t visit vertex c , so, it is not a Hamilton cycle. It also doesn’t visit edges be and ce , so, it is not an Euler circuit. This circuit is an Euler circuit only. It visits several vertices more than once; so, it is not a Hamilton cycle. It visits every edge exactly once, so, it is an Euler circuit. TIP! Euler circuits never skip a vertex, so, they only fail to be Hamilton cycles when they visit a vertex more than once. Hamilton cycles never visit any edges twice, so, they only fail to be Euler circuits when they skip edges. Notice that the graph is a cycle. A cycle will always be Eulerian because all vertices are degree 2. Moreover, any circuit in the graph will always be both an Euler circuit and a Hamilton cycle. It is not always as easy to determine if a graph has a Hamilton cycle as it is to see that it has an Euler circuit, but there is a large group of graphs that we know will always have Hamilton cycles, the complete graphs. Since all vertices in a complete graph are adjacent, we can always find a directed cycle that visits all the vertices. For example, look at the directed six-cycle, n → o → p → q → r → s , in the complete graph with six vertices in . Directed Cycle in Complete Graph That is not the only directed six-cycle in the graph though. We could find another just be reversing the direction, and we could find even more by using different edges. So, how many Hamilton cycles are in a complete graph with n vertices? Before we tackle this problem, let’s look at a shorthand notation that we use in mathematics which will be helpful to us. Factorials In many areas of mathematics, we must calculate products like 7 ⋅ 6 ⋅ 5 ⋅ 4 ⋅ 3 ⋅ 2 ⋅ 1 or 11 ⋅ 10 ⋅ 9 ⋅ 8 ⋅ 7 ⋅ 6 ⋅ 5 ⋅ 4 ⋅ 3 ⋅ 2 ⋅ 1 , products that involve multiplying all the counting numbers from a particular number down to 1. Imagine that the product happened to be all the numbers from 100 down to 1. That’s a lot of writing! Instead of writing all of that out, mathematicians came up with a shorthand notation. For example, instead of 7 ⋅ 6 ⋅ 5 ⋅ 4 ⋅ 3 ⋅ 2 ⋅ 1 , we write 7 ! , which is read “7 factorial .” In other words, the product of all the counting numbers from n down to 1 is called n factorial and it is written n ! Evaluating Factorials Evaluate n ! and ( n − 1 ) ! for n = 4 . n ! = 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 and ( n − 1 ) ! = ( 4 − 1 ) ! = 3 ! = 3 ⋅ 2 ⋅ 1 = 6 A common use for factorials is counting the number of ways to arrange objects. Suppose that there were three students, Aryana, Byron, and Carlos, who wanted to line up in a row. How many arrangements are possible? There are six possibilities: ABC, ACB, BAC, BCA, CAB, or CBA. Notice that there were three students being arranged, and the number of possible arrangements is three. The number of ways to arrange n distinct objects is n ! . Counting Arrangements of Letters Find the number of ways to arrange the letters a, b, c, and d. 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 Counting Hamilton Cycles in Complete Graphs Now, let’s get back to answering the question of how many Hamilton cycles are in a complete graph. In , we have drawn all the four cycles in a complete graph with four vertices. Remember, cycles can be named starting with any vertex in the cycle, but we will name them starting with vertex a . Complete Graph Cycle Cycle Cycle Cycle Name Clockwise (a, b, c, d) (a, b, d, c) (a, c, b, d) Cycle Name Counterclockwise (a, d, c, b) (a, c, d, b) (a, d, b, c) Four-Cycles in Complete Graph with Four Vertices shows that there are three unique four-cycles in a complete graph with four vertices. Notice that there were two ways to name each cycle, one reading the vertices in a clockwise direction and one reading the vertices in a counterclockwise direction. This is important to us because we are interested in Hamilton cycles, which are directed cycles. Although the cycles (a, b, c, d) and (a, d, c, b) are the same cycle, the directed cycles, a → b → c → d → a and a → d → c → b → a , which travel the same route in reverse order are considered different directed cycles, as shown in . Complete Graph Cycle Cycle Cycle Clockwise Hamilton Cycle a → b → c → d → a a → b → d → c → a a → c → b → d → a Counter-clockwise Hamilton Cycle a → d → c → b → a a → c → d → b → a a → d → b → c → a Hamilton Cycles in a Complete Graph with Four Vertices The six directed four-cycles in are the only distinct Hamilton cycles in a complete graph with four vertices. Six is also the number of ways to arrange the three letters b, c, and d. (Do you see why?) The number of ways to arrange three letters is 3 ! = 3 ⋅ 2 ⋅ 1 = 6 . Similarly, the number of Hamilton cycles in a graph with five vertices is the number of ways to arrange four letters, which is 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 . In general, to find the number of Hamilton cycles in a graph, we take one less than the number of vertices and find its factorial. The number of distinct Hamilton cycles in a complete graph with n vertices is ( n − 1 ) ! Counting Hamilton Cycles in a Complete Graph How many Hamilton cycles are in the complete graph in ? Complete Graph L There are five vertices in the graph. Using n = 5 , we have ( n − 1 ) ! = ( 5 − 1 ) ! = 4 ! = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24 Hamilton cycles. Weighted Graphs Suppose that an officer in the U.S. Air Force who is stationed at Vandenberg Air Force base must drive to visit three other California Air Force bases before returning to Vandenberg. The officer needs to visit each base once. The vertices in the graph in represent the four U.S. Air Force bases, Vandenberg, Edwards, Los Angeles, and Beale. The edges are labeled to with the driving distance between each pair of cities. Graph of Four California Air Force Bases The graph in is called a weighted graph , because each edge has been assigned a value or weight. The weights can represent quantities such as time, distance, money, or any quantity associated with the adjacent vertices joined by the edges. The total weight of any walk, trail, or path is the sum of the weights of the edges it visits. Notice that the officer’s trip can be represented as a Hamilton cycle, because each of the four vertices in the graph is visited exactly once. Finding Hamilton Cycles of Lowest Weight Use and the given Hamilton cycles to answer the following questions. V → L → E → B → V V → L → B → E → V V → E → L → B → V V → B → E → L → V Which of the Hamilton cycles (directed cycles) lie on the same cycle (undirected cycle) in the graph? Find the total weight of each cycle. Of the four, which of the Hamilton cycles describes the shortest trip for the officer? Describe the route. V → L → E → B → V and V → B → E → L → V follow the same edges in reverse order. Any Hamilton cycles that lie on the same cycle will have the same edges and the same total weight. V → L → E → B → V and V → B → E → L → V each have total weight 159 + 106 + 410 + 396 = 1071 . V → L → B → E → V has a total weight 159 + 439 + 410 + 207 = 1215 . V → E → L → B → V has a total weight 396 + 439 + 106 + 207 = 1148 . Hamilton cycles V → L → E → B → V and V → B → E → L → V each have the lowest total weight. The officer would take the route from Vandenberg, to Los Angeles, to Edwards, to Beale, and back to Vandenberg, or reverse that route. Check Your Understanding Key Terms Hamilton cycle, or Hamilton circuit n factorial weighted graph total weight Key Concepts A Hamilton cycle is a directed cycle, or circuit, that visits each vertex exactly once. Some Hamilton cycles are also Euler circuits, but some are not. Hamilton cycles that follow the same undirected cycle in the same direction are considered the same cycle even if they begin at a different vertex. The number of unique Hamilton cycles in a complete graph with n vertices is the same as the number of ways to arrange n − 1 distinct objects. Weighted graphs have a value assigned to each edge, which can represent distance, time, money and other quantities. Formulas The number of ways to arrange n distinct objects is n ! . The number of distinct Hamilton cycles in a complete graph with n vertices is ( n − 1 ) ! .

Math