[Math] Adjacency matrix of the complement of a graph

graph theory

I read a lemma.

$J$ is the all ones $n \times n$ matrix, $I_n$ is the $n \times n$ identity matrix. Let the adjacency matrix of a simple graph $G$ on $n$ vertices be $A = A(G)$. Then the adjacency matrix of its complement is $\bar A = A \bar{(G)} = J – I – A$.

From a previous posting, I know that $\bar A=J-I-A$. Can anyone help me understand how? The linked question has no comments regarding this.

Best Answer

You want to prove that if the adjacency matrix of the graph $G$ is $A$, then the adjacency matrix $\overline{A}$ of the complement graph $\overline{G}$ is $J-I-A$. Observe that vertices $i$ and $j$ are adjacent in $G$ iff vertices $i$ and $j$ are nonadjacent in $\overline{G}$. Hence, the edge set of $G$ and of $\overline{G}$ together form the edge set of the complete graph $K_n$. Observe that the adjacency matrix of the complete graph is $J-I$. Hence, $A + \overline{A} = J-I$. So, $\overline{A} = J-I-A$.