 Two graphs might be isomorphic if we can relabel the vertices of g, so they correspond to the vertices of g prime. But finding such a relabeling is a hard task. So we might want to know if the graphs are isomorphic before we begin. So a graph isomorphism corresponds to a relabeling of the vertices. So suppose the vertices g and g prime are labeled 1, 2, 3, all the way up to n. A relabeling to produce the vertices of g prime corresponds to a permutation of the elements of our vector. So let's see how that works. So we'll relabel the graph, according to our permutation, our vector 1, 2, 3, 4, 5 becomes the vector 2, 5, 1, 4, 3. So the permutation could be read as relabeling 1 as 2, 2 as 5, 3 as 1, 4 says the same, and 5 becomes. Since the labels are the same, we'll change the color of the vertex after we've relabelled it. So our first relabeling, vertex 1 gets renamed vertex 2, vertex 2 gets renamed vertex 5, vertex 3 gets renamed vertex 1, vertex 4 stays the same, but because we have relabelled it, we'll change its color, and then vertex 5 gets called vertex 3. And so here's a new graph that is isomorphic to our original, because it was just a relabeling of the vertices. We can represent any permutation using a permutation matrix. The permutation matrix is found using a rather complicated process. Permute the rows of the identity matrix in the same way you permute the elements of the permutation. This is actually a little more complicated than it sounds. So let's consider our permutation matrix that corresponds to that graph relabeling. So it's important to understand that the permutation is the rearrangement. What this means is that while we can read the permutation as vertex 1 is renamed vertex 2, the actual permutation is where did vertex 1 go to? And so if we look, we see that 1 is rearranged from the first position to the third position. This means our permutation matrix will move the first row of the identity matrix to the third row. And so we need the following permutations. Row 1 moves to row 3. Similarly, 2 is rearranged from the second position to the first position. So the second row of the identity matrix is moved to the first row. 3 is moved to the fifth position. 4 is kept in the fourth position, but we'll still record that as the fourth row goes to the fourth row. And 5 is moved to the second position. And so if we apply these permutations we get. Now let's verify that this actually does produce the permutation we want. So we'll apply the matrix to the column vector 1, 2, 3, 4, 5, and if we do that we get. And so this does produce the desired transformation. So we've identified the relabeling of the vertices of a graph with a permutation matrix. The graph itself can be represented using the adjacency matrix. And this suggests we can solve the problem of deciding whether two graphs are isomorphic using linear algebra. The bad news is, linear algebra has a lot of powerful tools, so we have a lot of possibilities to pursue. If the only thing you learned in linear algebra is that every matrix represents a linear transformation, you probably failed the class. But at least you learned the most important concept. Suppose G is a graph with n vertices. We can interpret the adjacency matrix as a linear transformation on a n by 1 column vector v whose components each reflect some feature of the corresponding vertex. A useful idea in math and in life, things that do the same thing are the same thing. Consider another graph G prime in its adjacency matrix A prime. If G and G prime are isomorphic, they should do the same thing to the vector. However, since G prime is a relabeling of the vertices of G, we should perform the same relabeling on the components of v. So suppose v is the n by 1 column matrix whose i-th entry contains information about vertex i in G. And suppose p is the permutation matrix that relabels the vertices of G to be the vertices of G prime. Then p applied to v would correctly assign the information to the vertices in G prime. A prime pv would apply the linear transformation. And since the output would be in terms of the vertices of G prime, we'd need to convert it back to the original labeling using the inverse of p. Putting it all together, we'd want p inverse a prime pv to equal a v. But remember, things that do the same thing are the same thing. And so this product p inverse a prime p must equal a. Putting everything together, if a and a prime are the adjacency matrices for isomorphic graphs G and G prime, then there's some permutation matrix p where p inverse a prime p is equal to a. And this motivates the following definition. a and a prime are orthogonally equivalent if there is a permutation matrix p where p inverse a prime p is equal to a. Note there are several equivalent definitions based on some additional theorems from linear algebra. So we can rearrange the product as a prime equals p a p inverse. Also, since p is a permutation matrix, its inverse is its transpose, giving us another formulation. Regardless of how we choose to define orthogonally equivalent, this does allow us to state our result as suppose G and G prime are isomorphic graphs with adjacency matrices a and a prime, then a and a prime are orthogonally equivalent. But wait, there's more. On the other hand, if G and G prime have adjacency matrices a and a prime that are orthogonally equivalent, then there's some permutation p where p inverse a prime p equals a. In that case, p corresponds to the permutation of the vertices giving an isomorphism that maps the vertices of G to the vertices of G prime. Consequently, suppose G and G prime are graphs with adjacency matrices a and a prime. If a and a prime are orthogonally equivalent, then G and G prime are isomorphic. This means we can decide if two graphs are isomorphic by determining if their adjacency matrices are orthogonally equivalent. So how can we do that? Let's take a look at that next.