Adjacency Matrix
Let \(G = (V, A)\) be a graph with \(V = \{v_1, v_2, \dots, v_n\}\). The adjacency matrix of \(G\) is the matrix
\[ M = (m_{ij}) \in \mathbb{R}^{n \times n} \] defined by
Each entry \(m_{ij}\) indicates whether the vertices \(v_i\) and \(v_j\) are adjacent in the graph.
Adjacency Matrix Example with Directed Graph G
Let G = (V, A) with V = {A, B, C, D, E}. The adjacency matrix of G is:
Each entry \(m_{ij}\) indicates whether there exists an arc from vertex \(v_i\) to vertex \(v_j\):
- \(m_{ij}=1\) ⇒ there exists an arc \(v_i \to v_j\)
- \(m_{ij}=0\) ⇒ there is no arc \(v_i \to v_j\)
\(m_{AB}=1\) indicates the arc A → B (q).
\(m_{EA}=0\) indicates that there is no arc E → A.