Worked examples — Incidence matrix
Before anything, let us pin down our one central symbol and re-earn one word we lean on constantly.
The scenario matrix
Every incidence-matrix problem falls into one of these case classes. We will hit each cell with at least one worked example.
| # | Case class | The twist it tests | Worked in |
|---|---|---|---|
| C1 | Undirected, simple | The plain "1 if endpoint" rule | Example 1 |
| C2 | Directed, simple | Signs (tail) / (head), columns sum to 0 | Example 2 |
| C3 | Undirected self-loop | An edge whose two endpoints are the same vertex → entry "2" | Example 3 |
| C4 | Directed self-loop | A loop in a digraph: a and a in the same row | Example 4 |
| C5 | Parallel (multi) edges | Two edges joining the same pair | Example 5 |
| C6 | Isolated vertex (degree 0) | A dot touching no edge → an all-zero row | Example 6 |
| C7 | Degenerate: no edges at all | , matrix has zero columns | Example 6 |
| C8 | Read backwards | Given the matrix, recover the graph | Example 7 |
| C9 | Word problem (real world) | Translate a story into | Example 8 |
| C10 | Exam twist: prove with | Use to prove Handshake / column-rank facts | Example 9 |
| C11 | Limiting behaviour | What looks like as the graph gets dense/sparse | Example 10 |
Example 1 — Undirected, simple (cell C1)
Forecast: Guess before reading — how many 's total will the matrix have, and what will the degree of vertex 2 be?
Steps.
- List rows and columns. Rows (the 4 dots), columns (the 3 lines). So is . Why this step? The matrix is ====: 4 vertices, 3 edges. Fixing the shape first stops the "square matrix" mistake.
- Fill each column by its two endpoints. touches ; touches ; touches . Why this step? An edge has exactly two endpoints, so each column gets exactly two 's.
- Read degrees off row sums. Row 1: ; row 2: ; row 3: ; row 4: . Why this step? The row sum — counting the marks in a row is counting the edges at that vertex.
The figure below draws this path with each edge coloured and each vertex labelled by its degree — look at how the two end vertices carry a single blue edge (degree 1) while the two middle ones sit between two edges (degree 2), exactly the row sums we just computed.

Verify: Total 's . Adding row sums: ✔. The two "end" vertices (1,4) have degree 1, the two "middle" ones degree 2 — exactly what a path looks like.
Example 2 — Directed, simple (cell C2)
Forecast: In the undirected version every column summed to 2. What will each column sum to now?
Steps.
- Same shape, signed entries. For each edge, put at its tail (where the arrow leaves) and at its head (where the arrow enters). Why this step? Direction is information; a bare throws it away. The sign convention ==tail , head == is what preserves it.
- Sum each column. ; ; . Why this step? Each edge has exactly one tail and one head, so its column contains one and one — they cancel.
In the figure below, every edge is now an arrow; the pink sits at each arrow's tail and the yellow at its head. Trace any single arrow and you see the two signs that cancel to give that column's zero sum.

Verify: Every column sums to , so . This is precisely the property that makes the Graph Laplacian well-behaved. Column sums vanishing is the signature that you oriented every edge exactly once. ✔
Example 3 — Undirected self-loop (cell C3)
Forecast: A normal column has two 's. A loop only touches ONE vertex — so what does its column look like, and what is ?
Steps.
- The loop's column. A loop leaves and returns to the same vertex, so both endpoints are vertex 1. We record that as a single entry in row 1. Why this step? Writing "2" keeps the promise that row-sum degree: a loop adds 2 to a vertex's degree (you can leave along it and arrive along it).
- The normal edge. touches and → a in each. Why this step? is an ordinary edge with two distinct endpoints, so it obeys the plain "two 1's per column" rule from Example 1 — the loop is the special case, not this.
- Degrees. Row 1: ; row 2: .
Verify: (loop contributes 2, edge contributes 1) and . Check the Handshake Lemma: . Counting edges "with loops weighing 2": loop , , total ✔. This is the one exception to "every column has exactly two 1's."
Example 4 — Directed self-loop (cell C4)
Forecast: In the undirected loop we wrote a single "2". A directed loop has a tail () and a head () — but both land on vertex 1. What single number goes in that cell, and does its column still sum to 0?
Steps.
- The directed loop's column. The loop's tail is vertex 1 () and its head is also vertex 1 (). Both contributions fall in the same cell, so we add them: . Why this step? Signs are additive within a cell. A directed loop therefore leaves a 0 in row 1 — the tail and head cancel inside one entry because they share a vertex.
- The ordinary directed edge. gives at its tail (row 1) and at its head (row 2). Why this step? has two distinct endpoints, so its and land in different rows — the normal directed rule from Example 2.
- Column sums. ; . Why this step? We are testing whether the "every column sums to 0" law survives a loop — it does, but for the loop the cancellation happens within a single cell rather than across two rows.
Verify: Both columns sum to , so still holds ✔. Note the contrast with Example 3: the undirected loop showed a 2, the directed loop shows a 0. A directed loop is therefore invisible to — a known quirk worth remembering when building the Graph Laplacian.
Example 5 — Parallel edges (cell C5)
Forecast: Adjacency matrices merge parallel edges into a count. Does the incidence matrix merge them or keep them separate?
Steps.
- One column per edge — always. and are different edges, so they get different columns, even though they join the same pair. Why this step? Columns are indexed by edges, not by vertex-pairs. This is exactly why the incidence matrix can represent multigraphs where an adjacency matrix would blur them.
- Degrees. Row 1: ; row 2: . Why this step? Each row sum still equals the degree; both vertices sit on both edges, so each has degree 2 — the row-sum rule doesn't care that the two edges are parallel.
Verify: Total 's ; row sums ✔. Each of vertices 1 and 2 has degree 2, because two edges leave each. Columns are identical here, which is fine — identical columns simply mean parallel edges.
Example 6 — Isolated vertex & the empty graph (cells C6, C7)
Forecast: What does the row for a vertex with no edges look like? And what happens to a matrix that has vertices but no edges?
Steps (a).
- Fill only the real edge. marks rows 1 and 2. Why this step? We build purely from edges; with only present, only its two endpoints (1 and 2) receive a mark, and nothing else is touched.
- Row 3 is all zeros. Vertex 3 is an endpoint of no edge. Why this step? An isolated vertex (degree 0) contributes a row of zeros — the matrix still needs the row so the row-count stays .
Verify (a): Row 3 sums to ✔. Total 's ; row sums ✔.
Steps (b). With there are no columns. is a matrix — three empty rows. Why this step? Shape is . The degenerate case is not "undefined"; it is a genuine matrix with zero width, and every row sum is the empty sum , so every degree is . ✔
Example 7 — Read the matrix backwards (cell C8)
Forecast: In each column, where is the and where is the ? That literally tells you the arrow.
Steps.
- Column : in row 1, in row 2 → arrow . Why this step? tail (start), head (end). Reading a column decodes one edge.
- Column : in row 2, in row 3 → arrow . Why this step? Same decode applied to the next column — the locates the tail, the the head, giving the second arrow.
- Column : in row 3, in row 1 → arrow . Why this step? Finishing every column guarantees we recover all edges; this last arrow closes the loop back to vertex 1.
So the graph is a directed 3-cycle .
The figure below shows the recovered cycle — follow the blue arrows around the triangle and confirm each matches the tail→head we read out of its column.

Verify: Every column sums to 0 (each has one , one ) ✔. Row sums: row 1 , row 2 , row 3 — every vertex has one arrow in and one out, exactly a directed cycle. ✔
Example 8 — Word problem (cell C9)
Forecast: "Pays" has a direction — the payer is the tail. Guess Ann's row before building, and whether the group's net signs sum to zero.
Steps.
- Choose orientation. " pays " arrow , so (payer) is tail , is head . Why this step? We must fix a convention first; "money leaves the payer" makes the payer the tail.
- Rows people (Ann, Bo, Cy), columns transactions (). Why this step? is always vertices-by-edges; here "people" play the vertex role and "transactions" the edge role, so the shape is with people down the side.
- Interpret row sums as (money in) (money out). Ann (received , paid twice: ), Bo (received once, paid once: ), Cy (received twice, paid : ). Why this step? A directed row sum counts 's for arrows into the vertex (money in) and 's for arrows out (money out), so the row sum is (money in) (money out) — matching the Forecast's question exactly.
Verify: Total of all row sums . This must hold: every transaction contributes one and one , so the grand total is always (). Money is conserved across the group ✔.
Example 9 — Exam twist: prove Handshake with (cell C10)
Forecast: The matrix has a fixed number of 's. Can you count them two ways?
Steps.
- Count all 's by columns. Each of the columns has exactly two 's (its two endpoints). Total . Why this step? The structural fact "two 's per column" is the whole engine.
- Count all 's by rows. Row sums to , so the grand total is . Why this step? Row sum degree, from Example 1.
- Both count the same marks, so they are equal:
Verify: Reuse Example 1's path: and ✔. A corollary drops out for free: since is even, the number of odd-degree vertices is even.
Example 10 — Limiting behaviour: sparse vs dense (cell C11)
Forecast: always has exactly non-zeros (Example 9). As a graph gets dense, does that fraction go up or down?
Steps.
- : , . Size cells; non-zeros . Fraction filled . Why this step? counts the pairs; each column still has just two 's.
- Star: , . Size cells; non-zeros . Fraction . Why identical? Non-zeros and cells , so fraction — it depends only on , not on how many edges! For that is in both.
- Limit as : fraction . The matrix becomes overwhelmingly zeros. Why this step? Each column has two 's no matter how tall it is, so large graphs give extremely sparse incidence matrices.
The figure below plots the fill fraction against : notice the pink dot at (where and the star agree at ) and the blue dot far right showing the curve collapsing toward zero — the visual reason large graphs demand sparse storage.

Verify: : ; star: ; both equal ✔. For , fraction — this is exactly why big graphs are stored with Sparse graph representations instead of dense arrays.
Recall Self-test: match example to cell
Which example proved the Handshake Lemma from ? ::: Example 9 (cell C10), by double-counting the 's. Which case makes a column contain a single "2" instead of two "1"s? ::: An undirected self-loop (Example 3, cell C3). What does a directed self-loop leave in its cell, and why? ::: A single "0" — the tail and head share the same vertex and cancel in one cell (Example 4, cell C4). Why does the fill-fraction of an incidence matrix equal ? ::: Non-zeros , cells , ratio — independent of (Example 10). How do you recover a directed graph from ? ::: Read each column: the is the tail, the is the head (Example 7).
Connections
- Incidence matrix — the parent note whose rules we stress-tested here.
- Degree of a vertex — every row sum in these examples.
- Handshake Lemma — proved from in Example 9.
- Adjacency matrix — contrast in Example 5 (it merges parallel edges; keeps them).
- Graph Laplacian — the vanishing column sums (Examples 2, 4) feed .
- Sparse graph representations — motivated by the limit in Example 10.