Given an electrical network, a potential function is an assignment such that for all , , defined up to scaling by a constant.
The existence of such a function is equivalent to Kirchoff's second law
The nice thing about this formulation is that it's independent of direction.
Ohm's law then may be rewritten as
and the first law is equivalent to for all vertices connected to for not connected to the battery
We can combine all the terms together to get
If , then this would be equal to
If , then this would be equal to
Connection to Kirchoff's matrix
The first law is equivalent to saying that for the vector of all potentials