3.5.3 · HinglishGraphs
Incidence matrix
3.5.3· Coding › Graphs
Incidence matrix KYA hota hai?
Ise scratch se KAISE banayein (construction se derivation)
Hum koi formula yaad nahi karte — hum matrix ko generate karte hain.
- Har vertex list karo → ye rows ko label karenge.
- Har edge ko us vertex pair ke roop mein list karo jise wo join karta hai → ye columns ko label karenge.
- Har column (edge) ke liye, uske do endpoints ki rows mein mark lagao.

Worked Example 1 — Undirected
Graph: vertices , edges (ek triangle).
| 1 | 0 | 1 | |
| 1 | 1 | 0 | |
| 0 | 1 | 1 |
- Row 1 =
1 0 1KYU? Vertex 1 sirf edges aur mein hai. → Ye step KYU? Hum har edge scan karte hain aur poochte hain "kya vertex 1 ek endpoint hai?" - Degrees check karein: har row ka sum 2 hai → har vertex ki degree 2 hai. Triangle ke liye sahi. ✔
Worked Example 2 — Directed
Edges: , , .
| 0 | |||
| 0 | |||
| 0 |
- KYU? Edge vertex 1 ko leave karti hai (vertex 1 tail hai). → Ye step KYU? Convention: tail negative, head positive.
- Check: har column ka sum 0 hai. ✔
Worked Example 3 — Self-loop
Edge vertex 1 par ek loop hai (ek edge ).
| 2 |
- 2 KYU (undirected mein) 1 ki jagah? Ek loop vertex 1 ko dono endpoints se touch karta hai, isliye ye degree mein 2 add karta hai. → Ye step KYU? Row-sum = degree rule consistent rehta hai (loops degree mein 2 add karte hain).
Recall Feynman: ek 12-saal ke bacche ko samjhao
Ek dosto ki list socho. Side mein sabke naam likho. Upar har dosti likho jaise "Dosti #1". Agar wo insaan us dosti ka hissa hai toh box mein tick lagao. Kyunki ek dosti hamesha do logon ko jorti hai, isliye har column mein exactly do ticks aate hain. Apni row ke ticks gino aur tumhe pata chalega tumhare kitne dost hain. Wo tick-grid hi incidence matrix hai — dosto ko pure numbers mein likhne ka tarika taaki computer unhe padh sake.
Flashcards
n vertices aur m edges wale graph ke incidence matrix ki dimensions kya hoti hain?
(rows = vertices, columns = edges).
Ek undirected incidence matrix mein har column mein kitne non-zero entries hote hain?
Exactly do (do endpoints), ya self-loop ke liye sirf ek "2".
Row ka sum (undirected) kiske barabar hota hai?
Vertex ki degree ke.
Ek directed incidence matrix mein edge ke tail aur head ko kaunsi values se mark karte hain?
Tail = , Head = .
Directed incidence matrix mein har column ka sum 0 KYU hota hai?
Har edge mein ek tail () aur ek head () hota hai; wo cancel ho jaate hain.
Ek self-loop ek undirected incidence matrix mein kaise dikhta hai?
Us vertex ki row mein ki ek entry ke roop mein (loop degree mein 2 add karta hai).
Incidence matrix Handshake Lemma ko kaise prove karta hai?
Columns se total 1's gino = ; rows se gino = ; isliye .
Directed incidence matrix B ke terms mein graph Laplacian kya hai?
.
Connections
- Adjacency matrix — alternative representation (vertex-to-vertex).
- Graph Laplacian — oriented incidence matrix se ke roop mein banta hai.
- Degree of a vertex — yahan ek row sum ke barabar hota hai.
- Handshake Lemma — incidence marks count karne se nikalta hai.
- Sparse graph representations — bade graphs ke liye incidence lists/CSR.