Five wires join four points. Watch current circle round each loop while every junction stays in balance.
Kirchhoff's laws are linear algebra
Current round a loop: in equals out at every node.
Four nodes and five edges, each edge with a number and an arrow.
Describe this picture
A small network of four numbered nodes, drawn as a diamond: node 1 on the left, 2 at the top, 3 on the right, 4 at the bottom. Five numbered edges join them, each with an arrow: edge 1 from node 1 to 2, edge 2 from 2 to 3, edge 3 from 1 to 3 straight across, edge 4 from 1 to 4, edge 5 from 3 to 4. A unit current circulates round the loop 1 to 2 to 3 and back to 1, drawn as dots running along the lit edges, and each lit edge is labelled with its value: on edges 1 and 2, and on edge 3, where the current runs against the arrow. Readouts give the edge values as a vector, , and the total current in minus out at the nodes, , which is also written beside every node. Then a second unit current circulates round the loop 1 to 3 to 4 and back to 1, with edge values , and every node total is still 0. There is no control.
A small network
A graph is a set of points, the nodes, joined by lines, the edges. The picture has 4 nodes and 5 edges. Think of the edges as wires, pipes or roads, and the nodes as the junctions where they meet.
Each edge gets an arrow, chosen once and never changed. The arrow does not say which way anything flows. It only fixes a sign: a flow along the arrow counts as positive, and a flow against it as negative. The first loop in the picture runs against the arrow of edge 3, so edge 3 gets .
The incidence matrix
Write the graph as a matrix with one row per edge and one column per node. In each row, put in the column of the node the edge leaves, in the column of the node it enters, and 0 elsewhere. This is the incidence matrix:
Row 1 is edge 1, from node 1 to node 2; row 5 is edge 5, from node 3 to node 4. With edges and nodes, is .
Potentials in, differences out
Give each node a number , its potential: a voltage in a circuit, a pressure in pipes, a height in a landscape. The vector has one entry per node, so it is an input of . Each row of is the potential at the head of an edge minus the potential at its tail:
With potentials the differences are .
What does erase? Only differences reach the output, so raising every potential by the same amount changes nothing. The null space is the line of : equal potentials, no differences, nothing flows. For a graph in one connected piece, that is the whole null space, so and the rank is .
Loops
Now put a current on each edge, positive along its arrow. The vector has one entry per edge, so it lives on the output side of .
Multiply by the transpose. Column of has for the edges that enter node and for those that leave it, so entry of is the current flowing into node minus the current flowing out. Kirchhoff’s current law says that, with nothing fed in from outside, these are equal at every node:
So the currents that can flow on their own are exactly the left null space , from The four fundamental subspaces. Its dimension is , and the two loop currents of the picture are a basis: round nodes 1, 2, 3, and round nodes 1, 3, 4. Every current that balances at every node is a mix of these two loops.
The same vectors carry the other law. Read as weights on the rows: row 1 plus row 2 minus row 3 is the zero row. So for any potentials, the differences round that loop add up to zero: here . That is Kirchhoff’s voltage law. It is the right angle of the four subspaces page: a left null vector is perpendicular to every output .
Counting
Put the two dimensions together. The null space gives , and the loops are of them:
Rearranged, this is Euler’s count for a connected graph:
Here . Add a sixth edge and you add one loop; add a node with one edge to reach it and you add no loop.
A resistor network
Make every edge a resistor. Its conductance is one over its resistance, in siemens, and the matrix holds them on its diagonal.
Current flows from high potential to low, and Ohm’s law says how much: conductance times the drop. Measured along the edge arrows, the drop is tail minus head, which is . So on this page
Now feed currents in from outside, amperes into node . At each node, what flows out along the edges equals what is fed in. Flow out is , so , and with Ohm’s law:
The matrix is , one row per node. It has the same null space as : raising every potential changes no current. So fix one potential first, which an engineer calls grounding a node: set its potential to 0, and drop its row and column.
With every resistor 1 Ω, and :
Each diagonal entry counts the edges at a node, and each marks a pair of nodes joined by an edge.
Worked example
Feed 1 A into node 1 and take it out at node 4, which is grounded: . So for nodes 1 to 3. Drop row and column 4 of :
The solution is , and volts. The currents along the arrows are then
Check each node:
- Node 1: edges 1, 3 and 4 leave it, carrying A, the current fed in.
- Node 2: 0.125 A arrives on edge 1 and leaves on edge 2.
- Node 3: A arrives on edges 2 and 3 and leaves on edge 5.
- Node 4: A arrives, and leaves through the ground.
Node 1 sits at 0.625 V while 1 A flows to node 4, so the network behaves like a single resistor of between those two nodes. Most of the current, 0.625 A, takes the direct edge 4.
Predict before you check: by which edge does most current leave node 1? Edge 4, the direct one.
Where you’ll meet this
Circuit simulators. A simulator reads a list of components and the nodes they join, builds from it, grounds one node and solves for every potential. This is called nodal analysis, and it is the matrix of this page, built from a list instead of by hand.
Pipes, roads and power grids. Water in pipes, cars on roads and power on a grid obey the same two laws: what enters a junction leaves it, and a flow is driven by a difference in pressure, demand or voltage. The same matrix appears with new names for and .
Grouping points. With unit conductances, is called the graph Laplacian. Methods that sort the members of a network into tightly linked groups, such as communities of friends, start from it.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Incidence matrix | , | one row per edge: at the tail, at the head |
| Differences | head minus tail potential, per edge | |
| Null space | the line of | equal potentials; for a connected graph |
| Current law | balanced currents form , the loops | |
| Voltage law | loop vector | differences round a loop add to zero |
| Euler’s count | nodes edges loops | connected graph |
| Ohm’s law | current along the arrows, high to low potential | |
| Network equation | is the current fed in; ground one node first |