Login
📚 Contemporary Mathematics
Chapters ▾
⇩ Download ▾

12.3 Comparing Graphs

A map of the world continents. The continents are North America, South America, Europe, Asia, Africa, Oceania, and Antarctica.
Figure 12.36 A flat map represents the surface of Earth in two dimensions.A flat map represents the surface of Earth in two dimensions. (credit: modification of work "World Map" by Scratchinghead/Wikimedia Commons, Public Domain)
A globe.
Figure 12.37 A globe represents the surface of Earth in three dimensions.A globe represents the surface of Earth in three dimensions. (credit: "Globe" by Wendy Cope/Flickr, CC BY 2.0)

Learning Objectives

After completing this section, you should be able to:

  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?

Figure 12.38 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 labeled graph A and graph F. Graph A has four vertices: b, c, d, and e. The edges connect b c, c e, e d, d b, and d c. Graph F has four vertices: g, h, i, and j. The edges connect g h, h j, j i, I g, and I h.
Figure 12.38 Identical Graphs with Different Labels

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, Figure 12.39 shows how Graph T can be bent and flipped to look like Graph Z, which means that Graphs T and Z satisfy condition 1 and are isomorphic.

Graph T is converted into Graph Z. Edges from the third vertex in graph T connect to the first, second, and fourth vertices. The first and second vertices are connected by an edge. The fourth vertex is moved to the top. Then the whole graph is rotated 180 degrees to achieve graph Z.
Figure 12.39 Graph T Transformed Into Graph Z

Also, notice that the vertices that were adjacent in the first graph are still adjacent in the transformed graph as shown in Figure 12.40. For example, vertex 3 is still adjacent to vertex 4, which means they are still neighboring vertices joined by a single edge.

Graph T is converted into Graph Z. Edges from the third vertex in graph T connect to the first, second, and fourth vertices. The first and second vertices are connected by an edge. The fourth vertex is moved to the top. Then the whole graph is rotated 180 degrees to achieve graph Z.
Figure 12.40 Adjacent Vertices Are Still Adjacent

When Are Two Graphs Really Different?

Verifying that two graphs are isomorphic can be a challenging process, especially for larger graphs. It makes sense to check for any obvious ways in which the graphs might differ so that we don’t spend time trying to verify that graphs are isomorphic when they are not. If two graphs have any of the differences shown in Table 12.3, then they cannot be isomorphic.

Table 12.3
Unequal number of vertices
Unequal number of edges
Unequal number of vertices of a particular degree
Different cyclic subgraphs

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 Figure 12.41, each of the diagrams represents the same pattern of connections.

Four representations of the same graph are displayed. The graphs are labeled graph A 1, graph A 2, graph A 3, and graph A 4. In the first graph, the four vertices are connected by edges to resemble a square. The bottom-left and top-right vertices are connected using an edge. The other graph represents the same in different forms.
Figure 12.41 Four Representations of the Same Graph

Looking at Figure 12.41, how can we know that these graphs are isomorphic? We will start by checking for any obvious differences. Each of the graphs in Figure 12.41 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 Figure 12.42.

Four representations of the same graph are displayed. The graphs are labeled graph A 1, graph A 2, graph A 3, and graph A 4. In the first graph, the four vertices are connected by edges to resemble a square. The bottom-left and top-right vertices are connected using an edge. The top-left, top-right, bottom-right, and bottom-left vertices are 2, 3, 2, and 3. The other graph represents the same in different forms.
Figure 12.42 Graphs with Vertices of the Same Degrees

As shown in Figure 12.42, 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 Figure 12.43.

Four representations of the same graph are displayed three times. In the first row, two squares, a quadrilateral, and a pentagon are highlighted. In the second row, a triangle and three other shapes are highlighted. In the third row, a triangle and three other shapes are highlighted.
Figure 12.43 Graphs with the Same Cyclic Subgraphs

As shown in Figure 12.43, 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. Figure 12.44 demonstrates how to change graph A4 to get A3, graph A3 to get A2, and graph A2 to get A1.

Transformation of Graph A 4 to graph A 1 through graph A 3 and graph A 2. Graph A 4 has four vertices. It resembles a pentagon with a curved edge from the top-left vertex to the bottom-left vertex. The top-right vertex is moved to the center to obtain graph A 3. In graph A 3, the center vertex is moved to the top-left to obtain graph A 2. In graph A 2, the curved edge from the bottom-left vertex to the top-right vertex is shifted inside the graph to obtain graph A 1. In graph A 1, the four vertices are in four corners and they are connected using edges to resemble a square. A diagonal edge from the bottom-left vertex connects to the top-right vertex.
Figure 12.44 Transforming Graphs

Now that we have used visual analysis to see that condition 1 holds for graphs A1, A2, A3, and A4 in Figure 12.43, we know that they are isomorphic. In Figure 12.44, 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.

Two game boards and a spinner. The first game board is titled, Colors Game Figure A. It has 12 spaces arranged in a square. The spaces are as follows: A (yellow), B (red), C (green), D (yellow), E (blue), F (blue), G (green), H (purple), I (red), J (purple), K (white), L (white). Arrows show a path starting in space L and moving counterclockwise around the board to end in space L. The second game board is titled, Clock Game Figure B. It has 12 spaces arranged in a circle. The spaces are as follows: I (plus 3), II (plus 7), III (plus 4), IV (minus 3), V (plus 1), VI (minus 1), VII (minus 4), VIII (plus 2), IX (minus 7), X (minus 2), XI (plus 0), XII (minus 0). The space XII is indicated as the start and end space. A spinner has 2 sections labeled 1 and 2.
Figure 12.48 Two Game Boards

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 Figure 12.38. In Figure 12.51, we could replace the labels Graph F with the labels from Graph A and have an identical graph, as in Figure 12.52.

Two graphs are labeled graph A and graph F. Graph A has four vertices: b, c, d, and e. The edges connect b c, c e, e d, d b, and d c. Graph F has four vertices: g, h, i, and j. The edges connect g h, h j, j i, I g, and I h.
Figure 12.51 Identical Graphs with Different Labels
Two graphs are labeled graph A and graph F. Graph A has four vertices: b, c, d, and e. The edges connect b c, c e, e d, d b, and d c. Graph F has four vertices: b, c, d, and e. The edges connect b c, c e, e d, d b, and d c. The vertices, g, h, i, and j are struck through and written as b, c, d, and e.
Figure 12.52 Corresponding Vertices

So, we can identify an isomorphism between Graph A and Graph F by listing the corresponding pairs of vertices: b-g, c-h, d-i, and e-j. Notice that b is adjacent to c and g is adjacent to h. This must be the case since b corresponds to g and c corresponds to h. The same is true for other pairs of adjacent vertices.

An isomorphism between graphs is not necessarily unique. There can be more than one isomorphism between two graphs. We can see how to form a different isomorphism between Graph A and Graph F from Figure 12.33 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 Figure 12.53.

Graph F is converted into graph A. Graph F has four vertices: g, h, i, and j. The edges connect g h, h j, j i, i g, and i h. Graph F is rotated 90 degrees clockwise. Graph F is rotated 180 degrees clockwise to obtain graph A. Graph A has four vertices: b, c, d, and e. The edges connect b c, c e, e d, d b, and d c.
Figure 12.53 Transforming Graph F into Graph A

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 Figure 12.58 to help you visualize which events have campers in common.

A graph with four vertices. The vertices are labeled, a, b, c, and d. The edges connect a b, b d, d c, and c a.
Figure 12.58 Graph of Events with Campers in Common

Graph E in Figure 12.58 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 Figure 12.59. 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.

Two graphs: graph E and complement of E. Graph E has four vertices: a, b, c, and d. The edges connect a b, b d, d c, and c a. The complement of E has four vertices: a, b, c, and d. The edges connect a d, and b c.
Figure 12.59 Graphs of Camp Olympics

One way to find the complement of a graph is to draw the complete graph with the same number of vertices and remove all the edges that were in the original graph. Let’s say you wanted to find the complement of Graph E from Figure 12.59, 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 Figure 12.60.

Three graphs. The first graph has four vertices: a, b, c, and d. The edges connect a b, b d, d c, c a, a d, and b c. The second graph has four vertices: a, b, c, and d. The edges connecting a b, b d, d c, and c a are struck through. The edges connect a d and c b. The third graph has four vertices: a, b, c, and d. The edges connect a d and c b.
Figure 12.60 Use Complete Graph to Find Complement

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.

Key Terms

  • isomorphic
  • isomorphism
  • planar
  • nonplanar
  • complement
  • complementary

Key Concepts

  • Two graphs are isomorphic if they have the same structure.
  • When graphs are relatively small, we can use visual inspection to identify an isomorphism by transforming one graph into another without breaking connections or adding new ones.
  • An isomorphism between two graphs preserves adjacency.
  • If two graphs differ in number of vertices, number of edges, degrees of vertices, or types of subgraphs, they cannot be isomorphic.
  • When the complements of two graphs are isomorphic, so are the graphs themselves.

Videos

Adapted from Contemporary Mathematics by OpenStax (openstax.org), licensed under CC BY-NC-SA 4.0. Changes were made. License: CC-BY-NC-SA-4.0.