Incidence matrix
WHAT is an incidence matrix?
HOW to build it from scratch (derivation by construction)
We don't memorise a formula — we generate the matrix.
- List every vertex → these label the rows.
- List every edge as the pair of vertices it joins → these label the columns.
- For each column (edge), put a mark in the rows of its two endpoints.

Worked Example 1 — Undirected
Graph: vertices , edges (a triangle).
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 0 | 1 | 1 |
- Why row 1 =
1 0 1? Vertex 1 is in edges and only. → Why this step? We scan each edge and ask "is vertex 1 an endpoint?" - Check degrees: each row sums to 2 → every vertex has degree 2. Correct for a triangle. ✔
Worked Example 2 — Directed
Edges: , , .
| 0 | |||
| 0 | |||
| 0 |
- Why ? Edge leaves vertex 1 (vertex 1 is the tail). → Why this step? Convention: tail negative, head positive.
- Check: every column sums to 0. ✔
Worked Example 3 — Self-loop
Edge is a loop at vertex 1 (an edge ).
| 2 |
- Why 2 (in undirected) instead of 1? A loop touches vertex 1 with both its endpoints, so it contributes 2 to the degree. → Why this step? Keeps the row-sum = degree rule consistent (loops add 2 to degree).
Recall Feynman: explain to a 12-year-old
Imagine a list of friendships. Down the side you write everyone's name. Across the top you write each friendship like "Friendship #1". You put a tick in the box if that person is part of that friendship. Since a friendship always joins exactly two people, every column gets exactly two ticks. Count the ticks in your row and you know how many friends you have. That tick-grid is the incidence matrix — a way to write friendships in pure numbers so a computer can read them.
Flashcards
What are the dimensions of an incidence matrix for a graph with n vertices and m edges?
In an undirected incidence matrix, how many non-zero entries does each column have?
What does the sum of row equal (undirected)?
In a directed incidence matrix, what values mark the tail and head of an edge?
Why does every column of a directed incidence matrix sum to 0?
How does a self-loop appear in an undirected incidence matrix?
How does the incidence matrix prove the Handshake Lemma?
What is the graph Laplacian in terms of incidence matrix B (directed)?
Connections
- Adjacency matrix — alternative representation (vertex-to-vertex).
- Graph Laplacian — built as from the oriented incidence matrix.
- Degree of a vertex — equals a row sum here.
- Handshake Lemma — falls out of counting incidence marks.
- Sparse graph representations — incidence lists/CSR for big graphs.
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, graph ek picture hai — dots (vertices) aur unko jodne wali lines (edges). Computer ko ye picture samajhane ke liye usko numbers me convert karna padta hai. Incidence matrix bilkul ek attendance register jaisa hai: rows me vertices likho (students), columns me edges likho (classes). Agar koi vertex us edge ka endpoint hai, to wahan mark laga do. Isliye matrix ka size hota hai — n vertices, m edges. Yaad rakho, ye adjacency matrix ki tarah square nahi hota, kyunki yahan hum vertices ko edges se relate kar rahe hain, vertices ko vertices se nahi.
Undirected graph me har column me bas do 1 hote hain — kyunki har edge ke sirf do endpoints hote hain. Agar tum kisi row ka sum karo, to wo us vertex ka degree ban jaata hai (kitni edges us pe lagi hain). Isi se Handshake Lemma aa jaata hai: total marks ko columns se gino to , aur rows se gino to — dono barabar, matlab .
Directed graph me thoda twist hai: 0/1 ki jagah hum (jahan se edge nikalti hai, tail) aur (jahan edge aati hai, head) lagate hain. Isse har column ka sum 0 ho jaata hai, kyunki ek tail aur ek head cancel kar dete hain. Yahi cheez aage graph Laplacian banane me kaam aati hai, jo machine learning aur network analysis me bahut use hota hai.
Common galti: log ise square () samajh lete hain ya column me 3 marks daal dete hain. Bas yaad rakho — "ek edge ke do hi endpoints hote hain", isliye column me hamesha do hi marks (ya self-loop ke liye ek "2"). Yeh chhota sa rule clear ho gaya to incidence matrix ka pura concept clear ho jaata hai.