Graphs, Networks, Incidence Matrices
Real matrices come from applications, and the best source is a graph. The incidence matrix of a graph carries all its structure, and the four fundamental subspaces turn out to say physical things: the null space is constant potentials, the null space of A transpose is Kirchhoff's Current Law, loops are dependencies, trees are independence — and counting dimensions proves Euler's formula.
Matrices that come from somewhere
Strang opens with a confession. When he needs an example of a null space or a row space, he invents a little matrix on the spot — and he feels a little guilty about it, “because the truth is that real linear algebra uses matrices that come from somewhere.” They come from applications, they have definite structure, and everyone who works with them uses that structure. Chemistry professors row-reduce matrices that record how many molecules of each kind go into a reaction and what comes out. The people at Mathworks build Matlab around exactly these computations.
So today’s lecture is about what Strang calls “the most important model in applied math” — and its discrete version is a graph. A graph is a source of matrices, and the matrix it produces is the star of this lecture.
A graph and its incidence matrix
A graph has nodes and edges. Strang draws a small one: nodes and edges. Edge 1 runs from node 1 to node 2, edge 2 from node 2 to node 3, edge 3 from node 1 to node 3, edge 4 from node 1 to node 4, and edge 5 from node 3 to node 4. Each edge gets an arrow — a direction, chosen arbitrarily — so that a current flowing along it counts as positive with the arrow and negative against it. (Real interest would be in the graph of all websites, or all telephones, or all people in the world; four nodes is enough to see everything.)
The language will be electrical — potentials, potential differences, currents — but the same picture describes a hydraulic network carrying water or oil, or a structure like a bridge or a Buckminster Fuller dome.
For Strang’s graph, with five edges and four nodes:
A big graph would give a big matrix — but a very sparse one: every row has exactly two nonzeros, so the number of nonzeros is exactly . That is structure, and it can be used.
Notice something already. Edges 1, 2, 3 form a loop in the graph — and look at rows 1, 2, 3 of : row 1 plus row 2 equals row 3. Loops correspond to linearly dependent rows. Hold that thought.
The null space of A: potentials up to a constant
First question, always: what is the null space? Are the four columns independent? Solve with :
The matrix we built computes differences across every edge. Interpret as potentials at the nodes; then gives the potential differences across the edges. When are all five differences zero? When all the potentials are equal:
So the null space is one-dimensional — the line through — and the rank is . Any three columns of are independent.
Physically: the potentials can only be determined up to a constant. Potential differences are what make current flow; if all potentials equal , nothing moves. It’s the same arbitrary constant as ranking football teams, or measuring temperature in Celsius versus from absolute zero, or the in every indefinite integral from calculus. The standard fix is to ground a node — set its potential to zero. That removes one column, the remaining three are independent, and all other potentials can then be computed.
The null space of A transpose: Kirchhoff’s Current Law
Now the equation Strang calls “probably the most fundamental equation of applied mathematics”: . Here is , and holds the currents on the edges.
Its dimension we know in advance: .
But what does the equation say? Write out the rows of :
Each equation belongs to a node. The first says the net current leaving node 1 is zero — edges 1, 3, 4 all leave node 1, so . The second says : current in equals current out at node 2. This is Kirchhoff’s Current Law: a balance equation, a conservation law. Charge doesn’t accumulate at the nodes; it travels around.
Trees and Euler’s formula
What about the row space of — the column space of ? Its dimension is the rank, 3. But the first three columns of are not a basis: they correspond to edges 1, 2, 3, which form a loop, and the loop vector in says column 1 plus column 2 equals column 3. The pivot columns are 1, 2, and 4 — edges 1, 2, 4, which form a subgraph with the same four nodes, three edges, and no loop. The independent edges are exactly the ones without a loop.
Now look once more at the dimension formula , and read every symbol off the graph. The dimension of is the number of independent loops. is the number of edges. And : the rank is the number of nodes minus one, because of the vector in the null space. So the number of loops equals , and rearranging:
Check it on the lecture’s graph: . Strang draws a messier graph with five nodes, seven edges, three loops: . “And Euler’s right, I always get one.” Euler’s formula is a great fact of topology, true for any graph — and linear algebra proves it, just by computing the dimension of two ways. “We see Euler again — that guy never stopped.”
The framework of applied mathematics
The lecture closes with the picture Strang calls the great picture of applied mathematics, built from three steps.
Start with the potentials at the nodes. First, computes potential differences across the edges:
Second, Ohm’s Law: the current on an edge is a number — the conductance, one over the resistance — times the potential drop. A diagonal matrix of physical constants connects them:
Third, Kirchhoff’s Current Law balances the currents at the nodes. With no outside source, . To make something actually happen, add external current sources going into and out of the nodes (batteries in the edges are the other option), and KCL becomes .
Chain the three steps together — multiply by , then , then — and you get the basic equation of applied math in equilibrium (no time, no Newton’s law; everything has settled down):
Rectangular matrices came from the real application, but they arrive together with their transposes — which is exactly why the four subspaces are the right things to know. Strang’s final question: what can you say about the matrix , or even ? It is always symmetric.
Problems
Work these before revealing the solutions — everything you need is in the lecture.
A directed graph has 3 nodes and 3 edges: edge 1 from node 1 to node 2, edge 2 from node 2 to node 3, edge 3 from node 1 to node 3. Write the incidence matrix , find its rank, and give a basis for . Which rows are dependent, and why does the graph tell you so before any elimination?
Show solution
, which is zero exactly when . So has basis , its dimension is 1, and the rank is .
The three edges form a loop, so the rows must be dependent: row 1 plus row 2 equals row 3. One loop, and indeed dependency.
A directed graph has 4 nodes and 5 edges: edge 1 from node 1 to node 2, edge 2 from node 2 to node 3, edge 3 from node 3 to node 4, edge 4 from node 4 to node 1, and edge 5 from node 1 to node 3 (a diagonal). Without elimination, find the dimension of and write down a basis of loop currents. Then express the current around the outer loop (edges 1, 2, 3, 4) in terms of your basis.
Show solution
Here , , so and : two independent loops.
Loop A uses edges 1, 2, 5: one amp along edge 1, then edge 2, returning against edge 5’s arrow gives
Loop B uses edges 5, 3, 4: one amp with edge 5, then edges 3 and 4, gives
Both satisfy current balance at every node.
The outer loop sends one amp along edges 1, 2, 3, 4: . That is exactly — the currents on the shared diagonal edge 5 cancel, so the outer loop is dependent, not a third basis vector.
A connected graph has 6 nodes and 9 edges. (a) What is the rank of its incidence matrix ? (b) What is , and how many independent loops does the graph have? (c) How many edges must you remove to leave a tree, and how many edges does that tree have?
Show solution
(a) The rank is : the only dependency among the columns is the constant vector in .
(b) , so there are 4 independent loops. Check with Euler: nodes edges loops . ✓
(c) A tree has no loops, so removing one well-chosen edge per independent loop — 4 edges — leaves a tree with edges. That matches the general fact: a tree on nodes has edges, exactly the rank of .
Let be any incidence matrix and a diagonal matrix of positive conductances. (a) Show that is symmetric. (b) For the 3-node loop graph of Problem 12.1 with , compute and identify the vector in its null space. What does that mean for solving ?
Show solution
(a) Transpose the product, reversing the order: , since the diagonal matrix satisfies . So is symmetric — always.
(b) With from Problem 12.1:
Each row sums to zero, so is in the null space of — the same constant vector that was in . The matrix is singular, which says the potentials are only determined up to a constant. To solve in practice, ground a node: fix one potential at zero, delete that row and column, and the remaining system is invertible.