# Voting and Apportionment

## Apportionment Methods

### Learning Objectives

After completing this section, you should be able to:
1. Describe and interpret the apportionment problem.
2. Apply Hamilton’s Method.
3. Describe and interpret the quota rule.
4. Apply Jefferson’s Method.
5. Apply Adams’s Method.
6. Apply Webster’s Method.
7. Compare and contrast apportionment methods.
8. Identify and contrast flaws in various apportionment methods.

### A Closer Look at the Apportionment Problem

In Standard Divisors, Standard Quotas, and the Apportionment Problem we calculated the standard divisor and the standard quotas in various apportionment scenarios. The results of those calculations routinely led to fractions and decimals of units. However, the seats in the House of Representatives, laptops in a classroom, or a variety of other resources, are indivisible, meaning they cannot be divided up into fractional parts. This leaves a decision to be made. For example, if the standard quota for the number of laptops to be distributed to a classroom is 12.44 units, how do we deal with the fractional part of 0.44? It is unclear if the classroom should receive 12 units, 13 units, or some other value. Let’s try traditional rounding to the nearest whole number value.
 demonstrates that we cannot successfully apportion indivisible resources by rounding off each standard quota using traditional rounding. This leaves us with a problem. What is a fair way to distribute the fractional parts of the standard quotas? We will refer to this as the apportionment problem. Several methods for making this decision will be discussed.

### Hamilton's Method of Apportionment

One of the problems encountered when standard quotas are transformed into whole numbers using traditional rounding is that it is possible for the sum of the values to be greater than the number of seats available. A reasonable way to avoid this is to always round down, even when the first decimal place is five or greater. For example, a standard quota of 12.33 and a standard quota of 12.99 would both round down to 12. This is called the lower quota.
If the standard quotas are all rounded down, their sum will always be less than or equal to the house size. Then, it would only remain to find a fair way to distribute any remaining seats. Alexander Hamilton, who was a general in the American Revolution, author of the Federalist Papers, and the first secretary of the treasury, took this approach to apportionment.

### Steps for Hamilton’s Method of Apportionment

There are five steps we follow when applying Hamilton’s Method of apportionment:
1. Find the standard divisor.
2. Find each state’s standard quota.
3. Give each state the state’s lower quota (with each state receiving at least 1 seat).
4. Give each remaining seat one at a time to the states with the largest fractional parts of their standard quotas until no seats remain.
5. Check the solution by confirming that the sum of the modified quotas equals the house size.

### The Quota Rule

A characteristic of an apportionment that is considered favorable is when the final quota values all either result from rounding down or rounding up from the standard quotas. The value that results from rounding down is called the lower quota, and the value that results from rounding up is called the upper quota.
As we explore more methods of apportionment, we will consider whether they satisfy the quota rule. If a scenario exists in which a particular apportionment allocates a value greater than the upper quota or less than the lower quota, then that apportionment violates the quota rule and the apportionment method that was used violates the quota rule.
It is possible for an apportionment method to satisfy the quota rule in some scenarios but violate it in others. However, because the Hamilton method always begins with the lower quota and either adds one to it or keeps it the same, the final Hamilton quota will always consist of values that are either lower quota values or upper quota values. When an apportionment method has this characteristic, it is said to satisfy the quota rule. So, we can say:
The Hamilton method of apportionment satisfies the quota rule.
Although the Hamilton method of apportionment satisfies the quota rule, it can result in some unexpected outcomes, which has caused it to pass in and out of favor of the U.S. government over the years. There are several apportionment methods that have been popular alternatives, such as Jefferson’s method of apportionment that the founders of Imaginaria should consider.

### Jefferson’s Method of Apportionment

Another approach to dealing with the fractional parts of the standard quotas is to modify the standard divisor so that the total of the resulting modified lower quotas is the necessary number of seats. This is the approach used by Jefferson.
In Jefferson’s method, the change to the standard divisor is made so that the total of the modified lower quotas equals the house size. The change in the standard divisor to get the modified divisor is relatively small. There is not a formula for this. The modified divisor is found by “guess and check.” It is important to remember that increasing the divisor decreases the quotas, but decreasing the divisor increases the quotas. So, if you need a larger quota, try reducing the divisor, and if you need a smaller quota, try increasing the divisor.
When you use Jefferson’s method, you might have to adjust the divisor several times find modified lower quotas that sum to the house size. First, guess what the divisor should be based on the sum of the lower quotas and then increase or decrease it from there based on whether the sum needs to be smaller or larger respectively. If the result still does not produce lower quotas that sum to the house size, adjust again. Keep a record of the values that didn't work to help you narrow your search.

### Steps for Jefferson’s Method of Apportionment

We take four steps to apply Jefferson’s Method of apportionment:
Step 1: Find the standard divisor.
Step 2: Find each state’s quota. This will be the standard quota the first time Step 2 is completed and the standard divisor is used, but Step 2 may be repeated as needed using a modified divisor and resulting in modified quotas.
Step 3: Find the states’ lower quotas (with each state receiving at least one seat), and their sum.
Step 4: If the sum from Step 3 equals the number of seats, the apportionment is complete. If the sum of the lower quotas is less than the number of seats, reduce the standard divisor. If the sum of the lower quotas is greater than the number of seats, increase the standard divisor. Return to Step 2 using the modified divisor.
Notice that, in this apportionment, Mythbury received more than the upper quota. Since this apportionment of representatives to Imaginarian states by Jefferson’s method does not satisfy the quota rule, we say that:
Jefferson’s method violates the quota rule.
We have discussed two apportionment methods: one that satisfies the quota rule and one that does not. Before you decide which method to use in Imaginaria, there are a couple more options to consider.

### Adams’s Method of Apportionment

Adams’s method of apportionment is another method of apportionment that is based on a modified divisor. However, instead of basing the changes on the sum of the lower quotas, as Jefferson did, Adams used the upper quotas.
To apply Adams’s Method of apportionment, there are four steps we follow:
1. Find the standard divisor.
2. Find each state’s quota. This will be the standard quota the first time Step 2 is completed, and the standard divisor is used, but Step 2 may be repeated as needed using a modified divisor and resultingin modified quotas.
3. Find the states’ upper quotas and their sum.
4. If the sum from Step 3 equals the number of seats, the apportionment is complete. If the sum of the upper quotas is less than the number of seats, reduce the standard divisor. If the sum of the upper quotas is greater than the number of seats, increase the standard divisor. Return to Step 2 using the modified divisor.
In this apportionment, Mythbury received less than the state’s lower quota. So, this apportionment is an example of a scenario in which the Adams’s method violates the quota rule.
Adams’s method of apportionment violates the quota rule.
So far, only Hamilton’s method satisfies the quota rule, but there is one more apportionment method you should consider for Imaginaria.

### Webster’s Method of Apportionment

Webster’s method of apportionment is another method of apportionment that is based on a modified divisor. However, instead of basing the changes on the sum of the lower quotas, as Jefferson did or the sum of the upper quotas as Adams did, Webster used traditional rounding.
To apply Webster’s method of apportionment, there are four steps we take:

1. Find the standard divisor.
2. Find each state’s quota. This will be the standard quota the first time Step 2 is completed, and the standard divisor is used, but Step 2 may be repeated as needed using a modified divisor and resulting in modified quotas.
3. Round each state’s quota to the nearest whole number and find the sum of these values.
4. If the sum of the rounded quotas equals the number of seats, the apportionment is complete. If the sum of the rounded quotas is less than the number of seats, reduce the divisor. If the sum of the rounded quotas is greater than the number of seats, increase the divisor. Return to Step 2 using the modified divisor.
When using Webster’s method, just as with Jefferson’s method, the modified divisors you use may be different from what another person chooses, but final apportionment values will be the same.
So far, we know that the Hamilton method satisfies the quota rule, while the Jefferson and Adams methods do not. The apportionments in the Example and Your Turn above
    are both scenarios in which the Webster method satisfies the quota rule. Does it always? We have a little more work to do to find out. However, one thing is clear. Not all apportionment methods have the same results. Before you make such an important decision for Imaginaria, it’s important to think about the differences in the apportionments that result from these four methods. How will the differences affect the citizens of Imaginaria?

### Comparing Apportionment Methods

Recall that the four apportionment methods discussed in this chapter differ in two main ways:
1. Whether or not a modified divisor is used
2. The type of rounding of the quotas that is used
How might these differences affect Imaginarians? In the next two examples, we will compare the results when different apportionment methods are applied to the same scenario.
The Adams method favored the smaller states and the Jefferson method favored the larger states in the previous example, but is this the case in general?
Since the Jefferson method begins with the lower quotas, any adjustment to the quotas will be an increase. As you have seen, this is accomplished by using a modified divisor that is smaller than the standard divisor. The next example compares the impact of a decreasing divisor on the modified quotas of large states to the impact of the same size decrease on small states.
This example demonstrates that the Jefferson method is biased toward states with larger populations because the modified divisor is smaller than the standard divisor. On the other hand, the Adams’s method, which begins with the upper quotas, must increase the standard divisor in order to reduce the quotas. Once again, the effect on the number of seats is greater for the larger states, but this time they are decreased. This means that the Adams’s method favors states with smaller populations.

### Flaws in Apportionment Methods

As we have seen, different apportionment methods can have the same results in some scenarios but different results in others. Citizens of states which receive fewer seats with a particular apportionment method will view the apportionment method as flawed and argue in favor of a different method. This inevitably creates debates regarding the use of one method over another. Methods that favor larger states are likely to be challenged by smaller states, methods that favor smaller states are likely to be challenged by larger states, and methods that violate the quota rule are likely to be challenged by states of any size depending on the circumstances.
Suppose that the State of Hawaii House of Representatives had 51 representatives, each with their own district. Imagine that redistricting were underway, and the representative districts were to be apportioned to each of five counties based on population. The following table shows the apportionment that would result from the use of the Jefferson, Adams, and Webster methods of apportionment.
From the table, you can see that Hawaii, Kalawao, and Maui receive the same number of seats regardless of the method used. However, citizens of Honolulu would likely reject the Adams and Webster methods arguing that they violate the quota rule. Similarly, citizens of Kauai would probably reject the Jefferson method based on the argument that it unfairly favors the larger states. This scenario demonstrates that the Adams and Webster methods violate the quota rule, but the Jefferson method also violates the quota rule at times. The Hamilton method is the only method that satisfies the quota rule in all scenarios. It also consistently favors neither larger nor smaller states. Unfortunately, it can have some strange and results in certain circumstances, which you will see in the next section.

### Check Your Understanding

### Key Terms

1. apportionment problem
2. lower quota
3. upper quota

### Key Concepts

1. Hamilton’s method of apportionment uses the standard divisor and standard lower quotas, and it distributes any remaining seats based on the size of the fractional parts of the standard lower quota. Hamilton’s method satisfies the quota rule and favors neither larger nor smaller states.
2. Jefferson’s method of apportionment uses a modified divisor that is adjusted so that the modified lower quotas sum to the house size. Jefferson’s method violates the quota rule and favors larger states.
3. Adams’s method of apportionment uses a modified divisor that is adjusted so that the modified upper quotas, sum to the house size. Adams’s method violates the quota rule and favors smaller states.
4. Webster’s method of apportionment uses a modified divisor that is adjusted so that the modified state quotas, rounded using traditional rounding, sum to the house size. Webster’s method violates the quota rule but favors neither larger nor smaller states.

### Videos

1. Hamilton Method of Apportionment
2. Jefferson Apportionment Method
3. Adams Method Apportionment Calculator


# Voting and Apportionment

## Fairness in Apportionment Methods

### Learning Objectives

After completing this section, you should be able to:
1. Describe and illustrate the Alabama paradox.
2. Describe and illustrate the population paradox.
3. Describe and illustrate the new-states paradox.
4. Identify ways to promote fairness in apportionment methods.

### Apportionment Paradoxes

The citizens of Imaginaria will want the apportionment method to be as fair as possible. There are certain characteristics that they would reasonably expect from a fair apportionment.
1. If the house size is increased, the state quotas should all increase or remain the same but never decrease.
2. If one state’s population is growing more rapidly than another state’s population, the faster growing state should not lose a seat while a slower growing state maintains or gains a seat.
3. If there is a fixed number of seats, adding a new state should not cause an existing state to gain seats while others lose them.
However, apportionment methods are known to contradict these expectations. Before you decide on the right apportionment for Imaginarians, let’s explore the apportionment paradox, a situation that occurs when an apportionment method produces results that seem to contradict reasonable expectations of fairness.
There is a lot that the founders of Imaginaria can learn from U.S. history. The constitution of the United States requires that the seats in the House of Representatives be apportioned according to the results of the census that occurs every decade, but the number of seats and the apportionment method is not stipulated. Over the years, several different apportionment methods and house sizes have been used and scrutinized for fairness. This scrutiny has led to the discovery of several of these apportionment paradoxes.

### The Alabama Paradox

At the time of the 1880 U.S. Census, the Hamilton method of apportionment had replaced the Jefferson method. The number of seats in the House of Representatives was not fixed. To achieve the fairest apportionment possible, the house sizes were chosen so that the Hamilton and Webster methods would result in the same apportionment. The chief clerk of the Census Bureau calculated the apportionments for house sizes between 275 and 350. There was a surprising result that became known as the Alabama paradox, which is said to occur when an increase in house size reduces a state’s quota. Alabama would receive eight seats with a house size of 299, but only receive seven seats if the house size increased to 300. (Michael J. Caulfield (Gannon University), "Apportioning Representatives in the United States Congress - Paradoxes of Apportionment," Convergence (November 2010), DOI:10.4169/loci003163)
After the 1900 census, the Census Bureau again calculated the apportionment based on various house sizes. It was determined that Colorado would receive three seats with a house size of 356, but only two seats with a house size of 357.

### The Population Paradox

It is important for the founders of Imaginaria to keep in mind that the populations of states change as time passes. Some populations grow and some shrink. Some populations increase by a large amount while others increase by a small amount. These changes may necessitate a reapportionment of seats, or the recalculation of state quotas due to a change in population. It would be reasonable for Imaginarians to expect that the state with a population that has grown more than others will gain a seat before the other states. Once again, this is not always the case with the Hamilton method of apportionment. The population growth rate of a state is the ratio of the change in the population to the original size of the population, often expressed as a percentage. This value is positive if the population is increasing and negative if the population is decreasing. The population paradox occurs when a state with an increasing population loses a seat while a state with a decreasing population either retains or gains seats. More generally, the population paradox occurs when a state with a higher population growth rate loses seats while a state with a lower population growth rate retains or gains seats.
Notice that the population paradox definitions has two parts. If either part applies, then the population paradox has occurred. The first part of the definition only applies when one state has a decreasing population. The second part of the definition applies in all situations, whether there is a state with a decreasing population or not. It will be easier to identify situations that involve a decreasing population. The other situations requires the calculation of a growth rate. The reason that we don't have to calculate a growth rate when one state has a decreasing population and the other has an increasing population is that increasing population has a positive growth rate which is always greater than the negative growth rate of a decreasing population.

### The New-States Paradox

As a founder of Imaginaria, you might also consider the possibility that Imaginaria could annex nearby lands and increase the number of states. This occurred several times in the United States such as when Oklahoma became a state in 1907. The House size was increased from 386 to 391 to accommodate Oklahoma’s quota of five seats. When the seats were reapportioned using Hamilton’s method, New York lost a seat to Maine despite the fact that their populations had not changed. This is an example of the new-state paradox, which occurs when the addition of a new state is accompanied by an increase in seats to maintain the standard ratio of population to seats, but one of the existing states loses a seat in the resulting reapportionment.
When a new state is added, it is necessary to determine the amount that the house size must be increased to retain the original ratio of population to seats, in other words to keep the original standard divisor. To calculate the new house size, divide the new population by the original standard divisor, and round to the nearest whole number.

### The Search for the Perfect Apportionment Method

The ideal apportionment method would simultaneously satisfy the following four fairness criteria.
1. Satisfy the quota rule
2. Avoid the Alabama paradox
3. Avoid the population paradox
4. Avoid the new-states paradox
We have seen that the Hamilton method allows the Alabama paradox, the population paradox, and the new-states paradox in some apportionment scenarios. Let’s explore the results of the other methods of apportionment we have discussed in some of the same scenarios.
We have seen in our examples that neither the population paradox nor the new-states paradox occurred when using the Jefferson, Adams, and Webster methods. It turns out that, although all three of these divisor methods violate the quota rule, none of them ever causes the population paradox, new-states paradox, or even the Alabama paradox. On the other hand, the Hamilton method satisfies the quota rule, but will cause the population paradox, the new-states paradox, and the Alabama paradox in some scenarios.
In 1983, mathematicians Michel Balinski and Peyton Young proved that no method of apportionment can simultaneously satisfy all four fairness criteria.
There are other apportionment methods that satisfy different subsets of these fairness criteria. For example, the mathematicians, Balinski and Young who proved the Balinski-Young Impossibility Theorem created a method that both satisfies the quota rule and is free of the Alabama paradox. (Balinski, Michel L.; Young, H. Peyton (November 1974). “A New Method for Congressional Apportionment.” Proceedings of the National Academy of Sciences. 71 (11): 4602–4606.) However, no method may always follow the quota rule and simultaneously be free of the population paradox. (Balinski, Michel L.; Young, H. Peyton (September 1980). "The Theory of Apportionment" (PDF). Working Papers. International Institute for Applied Systems Analysis. WP-80-131.)
So, as you and your fellow founders of Imaginaria make the important decision about the right apportionment method for Imaginaria, do not look for a perfect apportionment method. Instead, look for an apportionment method that best meets the needs and concerns of Imaginarians.

### Check Your Understanding

### Key Terms

1. apportionment paradox
2. Alabama paradox
3. reapportionment
4. population growth rate
5. population paradox
6. new-state paradox

### Key Concepts

1. Several surprising outcomes can occur when apportioning seats that voters may find unfair: Alabama paradox, population paradox, and new-state paradox.
2. Apportionment methods are susceptible to apportionment paradoxes and may violate the quota rule.
3. The Balinsky-Young Impossibility Theorem indicates that no apportionment can satisfy all fairness criteria.

### Formulas

### Projects

### The First Census: Challenges of Collecting Population Data

As you and your fellow founders write the Imaginarian constitution, you must also design systems to collect accurate information about the population of Imaginaria. Why is this important and what are the challenges you will face? Let’s find out! Research and answer each question. (Questions adapted from “Authorizing the First Census–The Significance of Population Data,” Census.gov, United States Census Bureau)
1. The First Congress laid out a plan for collecting this data in Chapter II, An Act Providing for the Enumeration of the Inhabitants of the United States, which was approved March 1, 1790. What group did Congress select to carry out the first enumeration? Why did they choose this group? What might be the advantages and disadvantages to this approach?
2. Choose at least two challenges faced by the U.S. government during the first enumeration and explain how the information gathered might have helped address them.
3. President James Madison was a U.S. Representative who participated in the census debate in the first congress. What were the main points of his remarks and how were they relevant to the overall debate about the first enumeration?
4. What issues do you think the U.S. Census Bureau encounters today as it continues to collect and process data about the U.S. population that might be significant to you and the other founders of Imaginaria?

### The Party System: How Many Political Parties Are Enough?

The electoral system of Imaginaria will likely involve multiple political parties. The way these parties interact with the system may be determined by the founders of the new democracy. Let’s explore the ways in which political parties interact with the governments of various democracies by researching and answering each of the following questions.
1. What concerns did the founders of the United States have about political parties? Have any of their concerns become a reality? Were political parties addressed in the U.S. Constitution? How did they become such a large part of politics in the U.S.? As a founder of Imaginaria, would you address political parties in your constitution?
2. What is frontloading? Does our current system of frontloading impact fair representation? Why do two small, racially homogeneous states hold their primaries first? Do you think this impacts the final results?
3. How does the interaction political parties and the electoral system in the United States differ from that of other countries? Give at least three specific examples. Of these three, which would you be most likely to use as a model for Imaginaria?

### Technology and Voting: How Has the Digital Age Impacted Elections?

Unlike most other countries, Imaginaria will be founded in the digital age. Let’s explore the impact this might have on how you choose to set up your electoral system. Research and answer each question.
1. Participation in an electoral system if very important. In what ways does the Internet positively affect participation? In what ways does it negatively affect participation. What roll, if any, should government of Imaginaria play in tempering or promoting the Impact of the Internet?
2. Find at least three examples of governments that utilize Internet voting around the world. What concerns have slowed the spread of this technology? What are the advantages and disadvantages of Internet voting? Would you be in favor of Internet voting for Imaginaria? Why or why not?

### Chapter Review

### Voting Methods

### Fairness in Voting Methods

### Standard Divisors, Standard Quotas, and the Apportionment Problem

### Apportionment Methods

### Fairness in Apportionment Methods

### Chapter Test


# Graph Theory

## Introduction

In this chapter, you will learn the fundamental skills needed to work with graphs used in an area of mathematics known as graph theory. You can think of these graphs as a kind of map. Maps have served many purposes over the course of history. You probably use GPS maps to navigate to various destinations. A scientist from ancient Greece named Ptolemy wanted an accurate map of the world to make more accurate astrological predications. In recent years, neurobiologists have mapped the cerebral cortex to better understand the human brain. Social network analysts map online interactions to assist advertisers in reaching target audiences. Like other maps, the graphs you will study in this chapter can serve many purposes, but they do not have a lot of the details you might expect in a map such as size, shape, and distance between objects. All of that is stripped away so that we can focus on one element of maps, the connections between objects.


# Graph Theory

## Graph Basics

### Learning Objectives

After completing this section, you should be able to:
1. Identify parts of a graph.
2. Model applications of graph basics.
When you hear the word, graph, what comes to mind? You might think of the -coordinate system you learned about earlier in this course, or you might think of the line graphs and bar charts that are used to display data in news reports. The graphs we discuss in this chapter are probably very different from what you think of as a graph. They look like a bunch of dots connected by short line segments. The dots represent a group of objects and the line segments represent the connections, or relationships, between them. The objects might be bus stops, computers, Snapchat accounts, family members, or any other objects that have direct connections to each other. The connections can be physical or virtual, formal or casual, scientific or social. Regardless of the kind of connections, the purpose of the graph is to help us visualize the structure of the entire network to better understand the interactions of the objects within it.

### Parts of a Graph

In a graph, the objects are represented with dots and their connections are represented with lines like those in .  displays a simple graph labeled G and a multigraph labeled H. The dots are called vertices; an individual dot is a vertex, which is one object of a set of objects, some of which may be connected. We often label vertices with letters. For example, Graph G has vertices a, b, c, and d, and Multigraph H has vertices, e, f, g, and h. Each line segment or connection joining two vertices is referred to as an edge. H is considered a multigraph because it has a double edge between f and h, and a double edge between h and g. Another reason H is called a multigraph is that it has a loop connecting vertex e to itself; a loop is an edge that joins a vertex to itself. Loops and double edges are not allowed in a simple graph.
To sum up, a simple graph is a collection of vertices and any edges that may connect them, such that every edge connects two vertices with no loops and no two vertices are joined by more than one edge. A multigraph is a graph in which there may be loops or pairs of vertices that are joined by more than one edge. In this chapter, most of our work will be with simple graphs, which we will call graphs for convenience.
It is not necessary for the edges in a graph to be straight. In fact, you can draw an edge any way you want. In graph theory, the focus is on which vertices are connected, not how the connections are drawn (see ). In a graph, each edge can be named by the two letters of the associated vertices. The four edges in Graph X in  are ab, ac, ad, and ae. The order of the letters is not important when you name the edge of a graph. For example, ab refers to the same edge as ba.
Since the purpose of a graph is to represent the connections between objects, it is very important to know if two vertices share a common edge. The two vertices at either end of a given edge are referred to as neighboring, or adjacent. For example, in , vertices x and w are adjacent, but vertices y and w are not.

### Analyzing Geographical Maps with Graphs

When graphs are used to model and analyze real-world applications, the number of edges that meet at a particular vertex is important. For example, a graph may represent the direct flight connections for a particular airport as in . Representing the connections with a graph rather than a map shifts the focus away from the relative positions and toward which airports are connected. In , the vertices are the airports, and the edges are the direct flight paths. The number of flight connections between a particular airport and other South Florida airports is the number of edges meeting at a particular vertex. For example, Key West has direct flights to three of the five airports on the graph. In graph theory terms, we would say that vertex FYW has degree 3. The degree of a vertex is the number of edges that connect to that vertex.
Graphs are also used to analyze regional boundaries. The states of Utah, Colorado, Arizona, and New Mexico all meet at a single point known as the “Four Corners,” which is shown in the map in .

In , each vertex represents one of these states, and each edge represents a shared border. States like Utah and New Mexico that meet at only a single point are not considered to have a shared border. By representing this map as a graph, where the connections are shared borders, we shift our perspective from physical attributes such as shape, size and distance, toward the existence of the relationship of having a shared boundary.

### Graphs of Social Interactions

Geographical maps are just one of many real-world scenarios which graphs can depict. Any scenario in which objects are connected to each other can be represented with a graph, and the connections don’t have to be physical. Just think about all the connections you have to people around the world through social media! Who is in your network of Twitter followers? Whose Snapchat network are you connected to?

### Check Your Understanding

### Key Terms

1. vertex
2. edge
3. loop
4. graph (simple graph)
5. multigraph
6. adjacent (neighboring)
7. degree

### Key Concepts

1. Graphs and multigraphs represent objects as vertices and the relationships between the objects as edges.
2. The degree of a vertex is the number of edges that meet it and the degree can be zero.
3. An edge must have a vertex at each end.
4. Multigraphs may contain loops and double edges, but simple graphs may not.

### Videos

1. Graph Theory: Create a Graph to Represent Common Boundaries on a Map


# Graph Theory

## Graph Structures

### Learning Objectives

After completing this section, you should be able to:
1. Describe and interpret relationships in graphs.
2. Model relationships with graphs.
Graph theory is used in neuroscience to study how different parts of the brain connect. Neurobiologists use functional magnetic resonance imaging (fMRI) to measure levels of blood in different parts of the brain, called nodes. When nodes are active at the same time, it suggests there is a functional connection between them so they form a network. This network can be represented as a graph where the vertices are the nodes and the functional connections are the edges between them. (Mikey Taylor, "Graph Theory & Machine Learning in Neuroscience," Medium.com, June 24, 2020.

### Importance of the Degrees of Vertices

One reason scientists study these networks is to determine how successful the communication within a network continues to be when it experiences failures in nodes and connections. Graphs can be used to study the resilience of these networks. (Mikey Taylor, "Graph Theory & Machine Learning in Neuroscience," Medium.com, June 24, 2020)

### Relating the Number of Edges to the Degrees of Vertices

In the applications of graph theory to neuroscience and sociology in  and YOUR TURN 12.6, there was a correlation between the degrees of vertices and the resilience of a network. Researchers in many fields have also observed a direct relationship between the number of edges in a graph and the degrees of the vertices. To begin to understand this relationship, consider a graph with five vertices and zero edges as in .
Instead of being marked with a name, each vertex in  is marked with its degree. In this case, all of the degrees are 0 so the sum of the degrees is also zero. Suppose that we add an edge between any two existing vertices and indicate the degrees of the vertices. This gives us a graph with five vertices and one edge like the graph in .
Note that the degrees of two vertices increased, each by 1. So, the sum of the degrees is now 2. Suppose that we continue in this way, adding one edge at a time and making note of the number of edges and the sum of the degrees of the vertices as in .
 demonstrates a characteristic that is true of all graphs of any shape or size. When the number of edges is increased by one, the sum of the degrees increases by two. This happens because each edge has two ends and each end increases the degree of one vertex by one unit. As a result, the sum of the degrees of the vertices on any graph is always twice the number of edges. This relationship is known as the Sum of Degrees Theorem.

### Completeness

Suppose that there were five strangers in a room, A, B, C, D, and E, and each one would be introduced to each of the others. How many introductions are necessary? One way to begin to answer this question is to draw a graph with each vertex representing an individual in the room and each edge representing an introduction as in .
Let’s approach the problem by thinking about how many new people Person A would meet, then Person B, and so on, making sure not to repeat any introductions. The first graph in  shows Person A meeting Persons B, C, D, and E, for a total of 4 introductions. The next graph shows that Person B still has to meet Persons C, D, and E, for a total of 3 more introductions. The next graph shows that Person C still has to meet Persons D and E, which is 2 more introductions. The next graph shows that Person D only remains to meet Person E, which is 1 more introduction. The final graph has  edges representing 10 introductions. The last graph is an example of a complete graph because each pair of vertices is joined by an edge. Another way of saying this is that the graph is complete because each vertex is adjacent to every other vertex. shows complete graphs with three, four, five, and six vertices.
Suppose we want to know the number of introductions necessary in a room with six people. This would be represented by a complete graph with six vertices, and the total number of introductions would be , the number of edges in the graph. In fact, you can always find the number of introductions in a room with  people by adding all the whole numbers from 1 to .
Suppose that we want to determine how many introductions are necessary in a room with 500 strangers. In other words, suppose that we want to determine the number of edges in a complete graph with 500 vertices. Adding up all the numbers from 1 to 499 could take a long time! In the next example, we use the Sum of Degrees Theorem to make the problem more manageable.
Now we have a shorter way to calculate the number of introductions in a room with  strangers, and the number of edges on a complete graph with  vertices. Let’s update our formula.

### Subgraphs

Sometimes a graph is a part of a larger graph. For example, the graph of South Florida Airports from  is part of a larger graph that includes Orlando International Airport in Central Florida, which is shown in
The graph in  includes an additional vertex, MCO, and additional edges shown with dashed lines. The graph of direct flights between South Florida airports from  is called a subgraph of the graph that also includes direct flights between Orlando and the same South Florida airports in . In general terms, if Graph B consists entirely of a set of edges and vertices from a larger Graph A, then B is called a subgraph of A.

### Identifying and Naming Cycles

When you think of a cycle in everyday life, you probably think of something that begins and ends the same way. For example, the water cycle () begins with water in a lake or ocean, which evaporates into water vapor, condenses into clouds, and then returns to earth as rain or some other form of precipitation that settles into lakes or oceans. A cycle in graph theory is similar in that it begins and ends in the same way: It is a series of connected edges that begin and end at the same vertex but otherwise never repeat any vertices.
In a cycle, there are always the same number of vertices as edges, and all vertices must be of degree 2. Cycles are often referred to by the number of vertices. For example, a cycle with 5 vertices can be called a 5-cycle. Cycles can also be named after polygons based on the number of edges. For example a 5-cycle is also called a pentagon.  lists these names for cycles of size 3 through size 10.
There are many more polygon names, including a megagon that has a million edges and a googolgon that has  edges, but usually we just say -gon when the number  is past 10. For example, a cycle with 11 edges could be called an 11-gon.
Notice that the 10-cycle, or decagon, appears to cross over itself in . Remember, graphs can be drawn differently but represent the same connections. In , the same decagon is transformed into a graph that does not appear to overlap itself. We have done this without changing any of the connections so both diagrams represent the same relationships, and both diagrams are considered decagons.

### Cyclic Subgraphs and Cliques

When cycles appear as subgraphs within a larger graph, they are called cyclic subgraphs. Cyclic subgraphs are named by listing their vertices sequentially. The vertex where you begin is not important. Graph K in  has two triangle cycles (g, h, j) and (h, i, j), and one quadrilateral cycle (g, h, i, j).
We have seen that sociologists use graphs to study the structures of social networks. In sociology, there is a principle known as Triadic Closure. It says that if two individuals in a social network have a friend in common, then it is more likely those two individuals will become friends too. Sociologists refer to this as an open triad becoming a closed triad. This concept can be visualized as graphs in . (Chakraborty, Dutta, Mondal, and Nath, "Application of Graph Theory in Social Media, International Journal of Computer Sciences and Engineering, 6(10):722-729) In the open triad in , person a and person b each has a friendship with person c. In the closed triad, person a and person a have also developed a friendship. Notice that the graph representing the closed triad is a three-cycle, or a triangle, in graph theory terms.
Another topic of interest to sociologists, as well as computer scientists and scientists in many fields, is the concept of a clique. In a social group, a clique is a subgroup who are all friends. A triad is an example of a clique with three people, but there can be cliques of any size. In graph theory, a clique is a complete subgraph.

### Three-Cycles in Complete Graphs

Just as complete graphs have a predictable number of edges, complete graphs have a predictable number of cyclic subgraphs. Let’s look at the three-cycles within complete graphs with up to six vertices, which are shown in .
Let's list the names of all the triangles in each graph. . There is only one triangle in the complete graph with three vertices, (a, b, c). For the rest of the graphs, it is important that we take an organized approach. Start with the vertex that is first alphabetically, listing any triangles that include that vertex also in alphabetical order. Then, proceed to the next vertex in the alphabet, and list any triangles that include that vertex, except those that are already listed. Keep going in this way as shown in .
Look at the last row in . Do you see a pattern emerge for counting triangles in a complete graph? Without drawing a complete graph with 7 vertices, we can predict that it will have  triangles inside it. This pattern also appears in a famous diagram known to Western mathematicians as "Pascal’s Triangle."  displays the first 11 rows of Pascal’s Triangle. Row 0 of Pascal’s Triangle only has the number 1 in it. The first and last entries in each of the other rows are also 1s. Otherwise, all the entries are formed by adding two entries from the previous row. For example, in row 6, entry 1 is 6, which was found by adding 1 and the 5 from the previous row, and entry 2 is 15, which was found by adding the 5 and the 10 from the previous row, as shown in .
If we begin to list the third entries in each row of Pascal's triangle from the top down, we see 1, 4, 10, 20, 35, and so on. Notice that these values are exactly the number of triangles in a complete graph of sizes 3, 4, 5, 6, and 7, respectively. Specifically, entry 3 in row 7 is 35, the number of triangles in a complete graph of size 7. Let's practice using Pascal’s triangle to find the number of triangles in a complete graph of a particular size.
STEPS TO FIND THE NUMBER OF TRIANGLES IN A COMPLETE GRAPH OF SIZE
Step 1 Calculate the entries in row n of Pascal's Triangle using sums of pairs of entries in previous rows as needed.
Step 2 The number of triangles is entry 3 in row n. Remember to count the entries 0, 1, 2, and 3, from left to right.

### Check Your Understanding

### Key Terms

1. complete
2. subgraph
3. cycle
4. cyclic subgraph
5. clique

### Key Concepts

1. The sum of the degrees of the vertices in a graph is twice the number of edges.
2. In a complete graph every pair of vertices is adjacent.
3. A subgraph is part of a larger graph.
4. Cycles are a sequence of connected vertices that begin and end at the same vertex but never visit any vertex twice.

### Formulas

For the Sum of Degrees Theorem,  or
The number of edges in a complete graph with  vertices is the sum of the whole numbers from 1 to , .
The number of edges in a complete graph with  vertices is .

### Videos

1. The Mathematical Secrets of Pascal's Triangle by Wajdi Mohamed Ratemi


# Graph Theory

## Comparing Graphs

### Learning Objectives

After completing this section, you should be able to:
1. Identify the characteristics used to compare graphs.
2. Determine when two graphs represent the same relationships
3. Explore real-world examples of graph isomorphisms
4. 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.
Two graphs are isomorphic if either one of these conditions holds:
1. One graph can be transformed into the other without breaking existing connections or adding new ones.
2. 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.
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.

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

### 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.
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 .
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 .
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 A4 to get A3, graph A3 to get A2, and graph A2 to get A1.
Now that we have used visual analysis to see that condition 1 holds for graphs A1, A2, A3, and A4 in , we know that they are isomorphic. In , one of the edges of graph A4 crossed another edge of the graph. By transforming it into graph A3, 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.
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.

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

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

### Check Your Understanding

### Key Terms

1. isomorphic
2. isomorphism
3. planar
4. nonplanar
5. complement
6. complementary

### Key Concepts

1. Two graphs are isomorphic if they have the same structure.
2. 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.
3. An isomorphism between two graphs preserves adjacency.
4. If two graphs differ in number of vertices, number of edges, degrees of vertices, or types of subgraphs, they cannot be isomorphic.
5. When the complements of two graphs are isomorphic, so are the graphs themselves.

### Videos

1. Determine If Two Graphs Are Isomorphic and Identify the Isomorphism


# Graph Theory

## Navigating Graphs

### Learning Objectives

After completing this section, you should be able to:
1. Describe and identify walks, trails, paths, and circuits.
2. Solve application problems using walks, trails, paths, and circuits.
3. Identify the chromatic number of a graph.
4. Describe the Four-Color Problem.
5. 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.
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 .
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 .
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 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.
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.

### 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.
1. All paths are trails, but trails that visit the same vertex twice are not paths.
2. All trails are walks, but walks in which an edge is visited twice would not be trails.
We can visualize the relationship as in .
Let’s practice identifying walks, trails, and paths using the graphs in .

### 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.
Since walks, trails, and paths are all related, closed walks, circuits, and directed cycles are related too.
1. All circuits are closed walks, but closed walks that visit the same edge twice are not circuits.
2. 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 .
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
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.

### 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.
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.
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  colors is called an . 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.
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 .

### Creating Colorings to Solve Problems

Let’s see how these facts can help us color the graph in .
1. Since the graph is planar, the chromatic number is no more than four.
2. 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.
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.
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 .
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 .
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 .
All the remaining vertices are adjacent to blue. So, it is time to repeat the procedure with another color as shown in .
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.
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.
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!

### The Four Color Problem

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!
We saw how maps can be represented as graphs in Graph Basics.  from  shows a map of the midwestern region of the United 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.
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.

### Check Your Understanding

### Key Terms

1. walk (directed walk)
2. trail (directed trail)
3. path (directed path)
4. closed
5. open
6. closed walk
7. circuit (closed trail)
8. directed cycle (closed path)
9. coloring (graph coloring)
10. -coloring
11. chromatic number

### Key Concepts

1. Walks, trails, and paths are ways to navigate through a graph using a sequence of connected vertices and edges.
2. Closed walks, circuits, and directed cycles are ways to navigate from a vertex on a graph and return to the same vertex.
3. Colorings are a way to organize the vertices of a graph into groups so that no two members of a group are adjacent.
4. Maps can be represented with planar graphs, which can always be colored using four colors or fewer.

### Videos

1. Walks, Trails, and Paths in Graph Theory
2. Closed Walks, Closed Trails (Circuits), and Closed Paths (Directed Cycles) in Graph Theory
3. Coloring Graphs Part 1: Coloring and Identifying Chromatic Number
4. The Four Color Map Theorem – Numberphile
5. Coloring Graphs Part 2: Coloring Maps and the Four Color Problem
6. Neil deGrasse Tyson Explains the Möbius Strip


# Graph Theory

## Euler Circuits

### Learning Objectives

After completing this section, you should be able to:
1. Determine if a graph is connected.
2. State the Chinese postman problem.
3. Describe and identify Euler Circuits.
4. Apply the Euler Circuits Theorem.
5. Evaluate Euler Circuits 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?
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.
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.
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.

### 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!
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.
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.
To understand why the Euler circuit theorem is true, think about a vertex of degree 3 on any graph, as shown in .
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.

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

### 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.
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.
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 .
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
becomes
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.

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

### Check Your Understanding

### Key Terms

1. connected
2. component
3. disconnected
4. Euler circuit
5. Eulerian graph
6. Chinese postman problem
7. Eulerization

### Key Concepts

1. A connected graph has only one component.
2. 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.
3. The Chinese postman problem asks how to find the shortest closed trail that visits all edges at least once.
4. If an Euler circuit exists, it is always the best solution to the Chinese postman problem.
5. Eulerization is the process of adding duplicate edges to a graph so that the new multigraph has an Euler circuit.
6. The minimum number of duplicated edges needed to eulerize a graph is half the number of odd vertices or more.

### Videos

1. Connected and Disconnected Graphs in Graph Theory
2. Recognizing Euler Trails and Euler Circuits
3. Existence of Euler Circuits in Graph Theory


# Graph Theory

## Euler Trails

### Learning Objectives

After completing this section, you should be able to:
1. Describe and identify Euler trails.
2. Solve applications using Euler trails theorem.
3. Identify bridges in a graph.
4. Apply Fleury’s algorithm.
5. 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.

### 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.
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?
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 .
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.
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.
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.
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.
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 many know about. This is likely to impact Brielle as well as the friends of Brielle.

### 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.
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.
The Euler trail that was found in  is t → v → w → u → t → w → y → x → v.
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.

### Check Your Understanding

### Key Terms

1. algorithm
2. Fleury’s algorithm
3. Euler trail
4. bridge
5. local bridge

### Key Concepts

1. An Euler trail exists whenever a graph has exactly two vertices of odd degree.
2. When a bridge is removed from a graph, the number of components increases.
3. A bridge is never part of a circuit.
4. When a local bridge is removed from a graph, the distance between vertices increases.
5. An edge that is part of a triangle is never a local bridge.

### Videos

1. Bridges and Local Bridges in Graph Theory
2. Fluery's Algorithm to Find an Euler Circuit


# Graph Theory

## Hamilton Cycles

### Learning Objectives

After completing this section, you should be able to:
1. Describe and identify Hamilton cycles.
2. Compute the number of Hamilton cycles in a complete graph.
3. 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.

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

### 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 .
Notice that the Hamilton cycle a → b → c → d for Graph Z in  is NOT an Euler circuit, because it does not visit edge . Some Hamilton cycles are also Euler circuits while some are not, and some Euler circuits are Hamilton cycles while some are not.
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 .
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  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  or , 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 , we write , which is read “7 factorial.” In other words, the product of all the counting numbers from  down to 1 is called  factorial and it is written
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.

### 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 .
 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 .
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 . Similarly, the number of Hamilton cycles in a graph with five vertices is the number of ways to arrange four letters, which is . 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.

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

### Check Your Understanding

### Key Terms

1. Hamilton cycle, or Hamilton circuit
2.  factorial
3. weighted graph
4. total weight

### Key Concepts

1. A Hamilton cycle is a directed cycle, or circuit, that visits each vertex exactly once.
2. Some Hamilton cycles are also Euler circuits, but some are not.
3. 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.
4. The number of unique Hamilton cycles in a complete graph with n vertices is the same as the number of ways to arrange  distinct objects.
5. 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  distinct objects is .
The number of distinct Hamilton cycles in a complete graph with  vertices is .