Amy has a master's degree in secondary education and has taught math at a public charter high school.
A Hamilton Circuit
Imagine that you're a salesman. You want to visit each house in a certain neighborhood. You have drawn a map of the neighborhood in graph form using dots for houses and lines for the roads connecting the houses. You want to find a route that takes you to each house just once and takes you back to where you started. This type of route is called a Hamilton circuit in graph theory. Such a route visits each vertex just once, and you end where you start. Let's take a look at the graph you have drawn for the neighborhood:
One Hamilton circuit that you can take is with you starting at point B, for example. Then going to points C, D, E, A, G, F, J, I, H and then back to B where you started. You have visited each point or house exactly once, and you ended up where you began.
A Weighted Graph
Now, what if each road had a cost associated with it? For example, say you were driving from house to house. Each road will have a different cost since some roads are longer than others and will require more gas. More gas equals more money. In graph theory, we call a graph where each edge has an associated cost or weight a weighted graph. If we added the cost for the edges, our graph might look like this now:
Now, because we have a cost associated with each edge, our job of finding a Hamilton circuit gets a little bit more complicated. What we need to do now is to find a route that will cost us the least. Hey, as a salesman, you don't want to spend any more money than you have to. The cheaper it is for you to travel, the better. Now, we go along our path, we need to add up the cost associated with each edge, with each road we take. The best Hamilton circuit now is the Hamilton circuit with the least total cost. Looking at our graph and looking at how much it costs to take each road, the best Hamilton circuit is the one that zigzags between the houses. For example, if we start at house B, then go to houses H, C, I, D, J, E, F, A, G and then back to B again, our total cost is 20. Going this way is the cheapest. Of course, we could also start at house C or any other house for that matter and follow the same zigzag pattern. Any of these circuits will be the cheapest and the best. Try going other ways, and add up your costs to see if you can beat the total cost of 20.
A Complete Graph
Let's switch gears for just a moment and talk briefly about another type of graph that has a relation to the number of Hamilton circuits. This type of graph is called a complete graph. It is where each vertex is connected to every other vertex by an edge. For example, the graph below is a complete graph because you can get to any other vertex from any vertex in the graph. You don't have to pass a vertex to get to another.
When we have a complete graph like this, we have a formula we can use to determine the number of Hamilton circuits such a graph has. To use the formula, we first must count the number of vertices we have. We will call our number of vertices N. The formula then tells us that the number of Hamilton circuits such a graph has is (N - 1)!. So, for our graph, we have N = 5, because we have 5 vertices. Following the formula, we then have (5 - 1)! = 4! = 4 * 3 * 2 * 1 = 24 Hamilton circuits present in this graph.
Let's look at an example. Analyze this graph for completeness and the number of Hamilton circuits:
Looking at this graph, we see that each vertex is connected to every other vertex. This makes this graph a complete graph. Because this is a complete graph, we can calculate the number of Hamilton circuits. We use the formula (N - 1)!, where N is the number of vertices. Our N = 4. So, we have (4 -1)! = 3! = 3 * 2 * 1 = 6. We have a total of six Hamilton circuits in this graph. One such circuit is A, B, C, D, A.
Let's review what we've learned now. A Hamilton circuit is a route that visits each vertex just once and takes you back to where you started. A weighted graph is a graph where each edge has an associated cost or weight. The best Hamilton circuit for a weighted graph is the Hamilton circuit with the least total cost. A complete graph is a graph where each vertex is connected to every other vertex by an edge. A complete graph has (N - 1)! number of Hamilton circuits, where N is the number of vertices in the graph.
You should have the ability to do the following after this lesson:
- Define Hamilton circuit
- Explain what a weighted graph is and what the best Hamilton circuit is for a weighted graph
- Describe what a complete graph is and identify the formula for finding the number of Hamilton circuits in a complete graph
To unlock this lesson you must be a Study.com Member.
Create your account
Register to view this lesson
Unlock Your Education
See for yourself why 30 million people use Study.com
Become a Study.com member and start learning now.Become a Member
Already a member? Log InBack