Undirected adjacency matrices
State vertex order and the loop convention before translating a graph. Here each loop is recorded once on the diagonal
- Fix both orders Use the same declared vertex order for the rows and columns. Entry aᵢⱼ is read at row i, column j
- Record multiplicity An off-diagonal entry counts all direct edges joining that vertex pair, not merely whether a connection exists
- Mirror undirected edges For distinct vertices, each edge is represented in both mirrored cells. Those two cells still describe one edge \(\displaystyle a_{ij}=a_{ji}\)
- Count each loop once on the diagonal In this course and the retained generators, aᵢᵢ is the number of loops at vertex i. Some sources use doubled diagonal entries; state and follow the convention rather than mixing them
- An isolated vertex remains visible Its entire row and column are zero, but the vertex is still included in the matrix order
Worked example
Use order A, B, C, D for the graph with two AB edges, one BC edge, one loop at C and isolated D. Construct its adjacency matrix
- \(\displaystyle a_{12}=a_{21}=2\)Record the two AB edges in both mirrored cells
- \(\displaystyle a_{23}=a_{32}=1\)Record the single BC edge in both mirrored cells
- \(\displaystyle a_{33}=1\)Record the loop once on the diagonal. All unlisted entries are zero
- \(\displaystyle M=\begin{bmatrix}0&2&0&0\\2&0&1&0\\0&1&1&0\\0&0&0&0\end{bmatrix}\)Keep the all-zero row and column for isolated D
Common mistakes
Difficulty levels
Questions about this topic
Why is the matrix square?+
Every vertex appears once in the row order and once in the column order, so n vertices give n rows and n columns
Why use the same order for rows and columns?+
It makes the vertex labels and symmetry unambiguous. A different consistent order changes positions, not the graph
Why can a diagonal entry be zero?+
It means no loop at that vertex, not that the vertex is absent
What if my textbook doubles loop entries?+
State its convention and follow it consistently. This course and these practice generators record each loop once on the diagonal; degree then adds the diagonal entry to the row sum
Are directed matrices practised here?+
No. This Specialist section serves only the existing undirected intro and standard variants
Can I use a calculator?+
No. This topic is practised without a calculator
Which year level and chapter is this?+
Year 11, VCE Units 1 & 2, Specialist Mathematics, chapter 2: Graph theory