How do we describe a graph precisely and record it as a matrix?
Use vertex, edge, degree, loop and multiple-edge terminology, apply the handshake rule, and represent a graph with an adjacency matrix.
How to use the core graph vocabulary of vertices, edges, degree, loops and multiple edges, apply the handshake rule, and translate between a graph and its adjacency matrix.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
You must use the vocabulary precisely, apply the handshake rule to check or complete a graph, and convert between a drawn graph and its adjacency matrix.
Core terminology
A graph is a set of vertices (nodes) joined by edges (lines). Key terms:
- Degree of a vertex: the number of edge ends meeting at it.
- Loop: an edge joining a vertex to itself; it adds to that vertex's degree.
- Multiple edges: two or more edges joining the same pair of vertices.
- Simple graph: a graph with no loops and no multiple edges.
- Connected graph: one in which you can travel between any two vertices.
The adjacency matrix
An adjacency matrix is a square table with one row and one column per vertex. Each entry records the number of edges directly joining that pair.
- For an undirected graph the matrix is symmetric (entry from A to B equals entry from B to A).
- A loop is recorded as a on the diagonal, matching its contribution of to the degree.
- The degree of a vertex is the sum of its row (counting a diagonal loop entry once as written).
Why the matrix matters
The adjacency matrix lets you store a network for computation, check the degree sequence quickly, and (by matrix multiplication, met later) count walks of a given length. For directed graphs the matrix is generally not symmetric, which is the first sign that direction matters.