Adjacency Matrix/Examples
Examples of Adjacency Matrices
Simple Graph
The elements of the adjacency matrix of a simple graph are $0$ and $1$, and the diagonal elements are all zero:
- $\qquad \begin{pmatrix} 0 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{pmatrix}$
Multigraph
The elements of the adjacency matrix of a multigraph are integers, and the diagonal elements are all zero:
$\qquad \begin{pmatrix} 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 2 & 1 & 0 & 0 \\ 0 & 2 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 3 \\ 0 & 0 & 0 & 0 & 3 & 0 \\ \end{pmatrix}$
Digraph
The adjacency matrix for a directed graph is no longer symmetrical about the main diagonal:
$\qquad \begin{pmatrix} 0 & 1 & 0 & 1 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ \end{pmatrix}$
Loop-Graph
The elements on the main diagonal of the adjacency matrix for a loop-graph are not all non-zero:
$\qquad \begin{pmatrix} 0 & 1 & 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 2 & 1 & 1 & 1 & 0 \\ 0 & 0 & 1 & 2 & 1 & 1 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ \end{pmatrix}$
Loop-Multigraph
The elements of the adjacency matrix of a loop-multigraph are integers, and this time some of the diagonal elements are non-zero:
$\qquad \begin{pmatrix} 0 & 2 & 0 & 0 & 0 & 0 \\ 2 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & 1 & 1 & 2 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 3 \\ 0 & 0 & 0 & 1 & 3 & 0 \\ \end{pmatrix}$
Loop-Digraph
The adjacency matrix for a loop-digraph is not only not symmetrical about the main diagonal, it also has non-zero elements on that main diagonal:
$\qquad \begin{pmatrix} 1 & 1 & 0 & 1 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 0 \\ \end{pmatrix}$
Network
The adjacency matrix for a general network can have any numbers in any of its elements:
$\qquad \begin{pmatrix} 0 & 1.2 & 0 & 0.5 \\ 0 & 0 & 0 & 3.4 \\ 0 & 0 & 0 & 0 \\ 4.1 & 0 & 10.1 & 0 \\ \end{pmatrix}$