Problem Solving

Adjacency Matrix

Students compare colored pins and a square grid.

Adjacency Matrix definition

An adjacency matrix records which pairs of vertices have an edge between them.

In Spanish
matriz de adyacencia
Topic
Graph theory

Adjacency Matrix in a picture

Adjacency Matrix diagramFor the undirected chain A–B–C, rows and columns use the same order A, B, C.Row A: 0, 1, 0A is adjacent only to BRow B: 1, 0, 1B is adjacent to A and CRow C: 0, 1, 0C is adjacent only to B
For the undirected chain A–B–C, rows and columns use the same order A, B, C.

How it works

Choose an order for the vertices, then use that same order for rows and columns. In a simple graph, the entry in row i and column j is 1 when the two vertices share an edge and 0 otherwise. For a directed graph, use 1 when the edge goes from the row vertex to the column vertex.

Worked examples

What size is the adjacency matrix of a four-vertex graph?

4 × 4.

Why is the matrix symmetric for a simple undirected graph?

Each edge joins its two endpoints in both directions, so the two reflected entries match.

What is the diagonal of the adjacency matrix of a simple graph?

All zeros, because a simple graph has no loops.

Common mistake

For directed graphs, read from row to column. Reversing that convention reverses the edges.

Quick check

What does a zero entry mean in the simple-graph convention?

Show answer

There is no edge between the two vertices.

What does a row sum give in a simple graph?

Show answer

The degree of its vertex.

Must a directed graph have a symmetric adjacency matrix?

Show answer

No.

Sources

Flashcard

Adjacency Matrix

Reveal the definition

An adjacency matrix records which pairs of vertices have an edge between them.

Effortless Math. “Adjacency Matrix.” Math Dictionary.