This post will briefly go over the definition of adjacency matrix for graphs, some related theorems regarding graph isomorphism, and some proofs.
Adjacency Matrix
The adjacency matrix is one way to formally represent a graph, for example in convenience for computer computation.
Given a graph G : = ( V , E ) G:=(V,E) G:=(V,E), where ∣ V ∣ = n |V|=n ∣V∣=n, to obtain the adjacency matrix of this graph, we firstly select an ordering of the vertices, say we (re)name them as v 1 , . . . , v n v_1,...,v_n v1,...,vn.
Next, we label the rows and columns of a matrix with the ordered vertices.
The entry in this matrix in row $i4, column j j j, when i ≠ j i \ne j i=j, is the number of edges incident on i i i and j j j.
If i = j i = j i=j, the entry is twice the number of loops incident on i i i, and this is because we want the nice formula ∑ i = 1 n δ ( v i ) = 2 ∣ E ∣ , n ≥ 1 \sum_{i=1}^n\delta(v_i)=2|E| ,n≥1 ∑i=1nδ(vi)=2∣E∣,n≥1 to hold in general ( n = 0 n=0 n=0 is not particuarly interesting).
Remark
Besides entries on the main diagonal, the information are redundantly stored twice in the adjacency matrix (the information above the main diagonal is identical to the information below the main diagonal). Therefore, to obtain δ ( v i ) \delta(v_i) δ(vi), we sum up all the entries in the i i ith row OR all the entries in the i i ith column, but never both.
Reordering the Vertices
Ordering affects which row represents which vertex. Observe that if a graph has n n n vertices, we have n ! n! n! ways to reorder the vertices, and we can thus produce n ! n! n! (not necessarily distinct) adjacency matrices.
Graph Isomorphism and Adjacency Matrix
Proposition
Two graphs G 1 , G 2 G_1,G_2 G1,G2 are isomorphic iff there is some ordering of their vertices so that A 1 = A 2 A_1=A_2 A1=A2 ( A 1 A_1 A1 is an adjacency matrix of G 1 G_1 G1, and A 2 A_2 A2 is an adjacency matrix of G 2 G_2 G2).
Proof
Isomorphism ⟹ \implies ⟹Ordering
Suppose G 1 , G 2 G_1,G_2 G1,G2 are isomorphic, then there exist bijections f : V 1 → V 2 f:V_1\to V_2 f:V1→V2 and g : E 1 → E 2 g:E_1\to E_2 g:E1→E2 such that e ∈ E 1 e\in E_1 e∈E1 is incident on v , w ∈ V 1 v,w\in V_1 v,w∈V1 iff g ( e ) ∈ E 2 g(e)\in E_2 g(e)∈E2 is incident on f ( v ) , f ( w ) ∈ V 2 f(v),f(w)\in V_2 f(v),f(w)∈V2.
Thus, we can choose arbitrarily an ordering of the vertices of G 1 G_1 G1, say v 1 , . . . , v n v_1,...,v_n v1,...,vn, which gives us an adjacency matrix of G 1 G_1 G1, A 1 A_1 A1. Since f f f is a bijection, we can let the ordering of vertices of G 2 G_2 G2 be f ( v