Linear Algebra (source: Gilbert Strang notes) · 13 / 37

Lecture 12: Graphs, Networks, Incidence Matrices

This summary is based on the same lecture's transcript from an OCW mirror.

Theme. Real matrices come from applications and have structure. Strang calls the graph and its incidence matrix "the most important model in applied math." All four fundamental subspaces get a physical meaning here.


1. The graph and its incidence matrix

What a graph is. A graph consists of nodes and edges. Each edge is given a direction, drawn as an arrow. The direction is arbitrary; it only fixes which way counts as positive.

The example: \(n = 4\) nodes and \(m = 5\) edges.

Edge From → To
1 1 → 2
2 2 → 3
3 1 → 3
4 1 → 4
5 3 → 4

The incidence matrix \(A\) (\(m \times n = 5 \times 4\)) has one row per edge and one column per node. Each row has \(-1\) at the node where the edge starts and \(+1\) at the node where it ends:

\[A = \begin{bmatrix} -1 & 1 & 0 & 0 \\ 0 & -1 & 1 & 0 \\ -1 & 0 & 1 & 0 \\ -1 & 0 & 0 & 1 \\ 0 & 0 & -1 & 1 \end{bmatrix}\]

Structure:

  • \(A\) is sparse: each row has exactly 2 nonzeros, so there are \(2m\) nonzeros in total.
  • Loops give dependent rows. Edges 1, 2, 3 form a loop, and row 1 + row 2 = row 3.

Physical interpretation. Strang uses an electrical network: potentials, currents, Ohm's law. The same structure describes hydraulic networks (water or oil flow) and structures such as bridges or geodesic domes.


2. Nullspace \(N(A)\): constant potentials

What \(A\) computes. Let \(x = (x_1, x_2, x_3, x_4)\) be the potentials at the nodes. Then

\[Ax = \begin{bmatrix} x_2 - x_1 \\ x_3 - x_2 \\ x_3 - x_1 \\ x_4 - x_1 \\ x_4 - x_3 \end{bmatrix} = \text{potential differences across the edges}\]

When is \(Ax = 0\)? Exactly when every potential difference is zero, meaning all potentials are equal:

\[N(A) = \left\{ c\begin{bmatrix}1\\1\\1\\1\end{bmatrix} \right\}, \qquad \dim N(A) = 1\]

Physical meaning. Potentials are determined only up to an additive constant. Only differences make current flow. Strang compares this to the \(+C\) in an indefinite integral, and to temperature scales (Celsius vs. absolute zero).

Grounding a node. In practice, one node is fixed at potential 0, for example \(x_4 = 0\). That removes its column, and the remaining 3 columns are independent.

Rank:

\[r = n - 1 = 3\]
Any 3 of the 4 columns are independent.


3. Left nullspace \(N(A^\top)\): Kirchhoff's Current Law

Dimension. \(\dim N(A^\top) = m - r = 5 - 3 = 2\).

The transpose:

\[A^\top = \begin{bmatrix} -1 & 0 & -1 & -1 & 0 \\ 1 & -1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & -1 \\ 0 & 0 & 0 & 1 & 1 \end{bmatrix}\]

Meaning of \(y\). Let \(y = (y_1, \dots, y_5)\) be the currents on the edges.

Each row of \(A^\top y = 0\) is a balance equation at one node:

Node Equation Meaning
1 \(-y_1 - y_3 - y_4 = 0\) Edges 1, 3, 4 all leave node 1, so their currents sum to 0
2 \(y_1 - y_2 = 0\) Current in equals current out
3 \(y_2 + y_3 - y_5 = 0\) Current in equals current out
4 \(y_4 + y_5 = 0\) Current in equals current out

This is Kirchhoff's Current Law (KCL): no charge accumulates at a node, so current in equals current out. Strang calls \(A^\top y = 0\) probably the most fundamental equation of applied mathematics.

Basis for \(N(A^\top)\): currents around loops

The basis can be read directly from the graph, without elimination. Any current that flows around a loop satisfies KCL.

Loop 1 → 2 → 3 → 1 (edges 1, 2, then back along edge 3, against its arrow):

\[y = (1, 1, -1, 0, 0)\]

Loop 1 → 3 → 4 → 1 (edges 3, 5, then back along edge 4, against its arrow):

\[y = (0, 0, 1, -1, 1)\]

The outer loop 1 → 2 → 3 → 4 → 1 gives \((1, 1, 0, -1, 1)\). This is not a new basis vector: it is the sum of the two above. The currents on edge 3 cancel.

\(\dim N(A^\top)\) = the number of independent loops.


4. Row space \(C(A^\top)\): trees

Dimension. \(\dim C(A^\top) = r = 3\). So 3 of the 5 rows of \(A\) (the edges) are independent.

Not just any three edges. Edges 1, 2, 3 are dependent, because they form a loop. The vector \((1,1,-1,0,0)\) in \(N(A^\top)\) records exactly this dependency.

Pivot columns of \(A^\top\). They are columns 1, 2, 4, which correspond to edges 1, 2, 4.

What those edges look like. Together they reach all 4 nodes using only 3 edges and contain no loop. Adding any other edge would create a loop.

A graph with no loops is a tree. Independent rows of \(A\) correspond to edges forming a tree. Dependencies among rows come from loops.


5. Euler's formula, from linear algebra

Combine three facts:

  • \(\dim N(A^\top) = m - r\)
  • \(\dim N(A^\top) = \) the number of independent loops
  • \(r = n - 1\)

This gives

\[\#\text{loops} = m - (n - 1)\]

Rearranging:

\[\boxed{\#\text{nodes} - \#\text{edges} + \#\text{loops} = 1}\]

This is Euler's formula. It holds for any connected graph. Strang notes the dimensions involved: nodes are 0-dimensional, edges 1-dimensional, and loops are 2-dimensional (they enclose area).

Checks:

  • This graph: \(4 - 5 + 2 = 1\).
  • Strang's second example: \(5 - 7 + 3 = 1\).

6. The framework of applied mathematics

Three steps link potentials to sources:

\[x \;\xrightarrow{\;A\;}\; e = Ax \;\xrightarrow{\;C\;}\; y = Ce \;\xrightarrow{\;A^\top\;}\; A^\top y = f\]
Step Equation Name
Potentials → potential differences \(e = Ax\)
Potential differences → currents \(y = Ce\) Ohm's law. \(C\) is diagonal and holds the edge conductances, which are 1/resistance.
Currents → balance at nodes \(A^\top y = f\) KCL. \(f\) holds the external current sources, or \(f = 0\) if there are none.

Combined into one equation:

\[\boxed{A^\top C A\, x = f}\]

Other places a source can enter. Batteries in the edges would enter at the \(e\) step instead.

Scope. Strang calls this the basic equation of applied mathematics in equilibrium: there is no time dependence.

Closing question. What do you know about \(A^\top A\), or \(A^\top C A\)? It is always symmetric:

\[(A^\top C A)^\top = A^\top C^\top A = A^\top C A\]
since \(C\) is diagonal and therefore symmetric.


The four subspaces, interpreted

Subspace Dimension Meaning
\(N(A)\) \(n - r = 1\) Constant potentials, which drive no current
\(C(A^\top)\) \(r = n - 1 = 3\) Rows from edges forming a tree
\(N(A^\top)\) \(m - r = 2\) Currents around loops, satisfying KCL
\(C(A)\) \(r = 3\) Achievable potential differences

A note on \(C(A)\). Strang does not develop \(C(A)\) in this lecture. A standard fact, not stated in the lecture: \(e \in C(A)\) exactly when the potential differences sum to zero around every loop. This is Kirchhoff's Voltage Law. It is also the orthogonality of \(C(A)\) and \(N(A^\top)\), which comes up in Lecture 14.

Big ideas from Lecture 12

  1. Incidence matrix. One row per edge, with entries \(-1\) and \(+1\). It is sparse and highly structured.
  2. \(N(A)\) is spanned by \((1,1,\dots,1)\). Potentials are determined only up to a constant, so the rank is \(n - 1\).
  3. \(N(A^\top)\) consists of the solutions of Kirchhoff's Current Law. Its basis is currents around independent loops.
  4. Independent edges form a tree, which has no loops.
  5. Euler's formula \(n - m + \ell = 1\) follows from \(\dim N(A^\top) = m - r\).
  6. Equilibrium equation \(A^\top C A x = f\), and the matrix \(A^\top C A\) is symmetric.