In the diagram below there is a source node (S), a sink node (T), and an internal node (A).
The numbers give the flow (say in litres per second). There are 3 litres per second entering A, but only 1 litre per second leaving A, so the excess flow for A is 2.
Note
In a push-relabel algorithm, the excess flow for internal nodes cannot be negative. In other words, you are not allowed to have more flow leaving than enters.
The source node is allowed to generate flow (it does not count as an internal node so note 1 does not apply)
During the algorithm, the excess flow is reduced until at the end all vertices have 0 excess flow
You could compute the excess flow by adding up all incoming flow, and subtracting all outgoing flow.
However, in practice, the algorithm maintains an array of excess flows and updates the value as the algorithm progresses.
