★ The Potential Method [00TT]
- November 25, 2026
Motivation [00TU]
- November 25, 2026
There is one more method we can use to prove amortized time bounds, called the potential method, which comes from an analogy with physics. The idea is to think of a data structure as having some “potential energy”. Operations on the data structure will sometimes increase the potential energy (storing up some extra energy that can be used later) and sometimes decrease it (releasing some of the stored energy). The amortized cost of an operation is the actual cost of the operation plus the change in energy. The change in energy can be positive (in which case the amortized cost is more than the actual cost, and some energy is stored for later) or negative (in which case the amortized cost is less than the actual cost, using up some of the stored energy to pay for the difference).
The Potential Method, formally [00TV]
- November 25, 2026
Consider a sequence of operations on a data structure, and let D_i denote the state of the data structure after the ith operation, and \Phi _i the potential energy of D_i. Then the amortized cost of the ith operation (which turned D_{i-1} into D_i) is defined as a_i = c_i + \Phi _i - \Phi _{i-1} where c_i is the actual cost of the operation. Therefore the amortized cost of the sequence of operations is \sum _{i=1}^n a_i = \sum _{i=1}^n (c_i + \Phi _i - \Phi _{i-1}) =
\left ( \sum _{i=1}^n c_i \right ) + \Phi _n - \Phi _0. We need the total amortized cost to be an upper bound on the actual cost, and we can see this will happen as long as \Phi _n - \Phi _0 \geq 0, which motivates the following definition:
\Phi is valid if \Phi _i - \Phi _0 \geq 0 for all i.Definition Valid potential function [00TW]
Remark Potential method generalizes accounting method [00TX]
- November 25, 2026
Note that this can be seen as a generalization of the accounting method: the amount of “extra money” stored in a data structure can be thought of as “potential energy”. But the potential method makes it more clear that the energy does not have to be an integer, nor does it have to be “stored” anywhere in particular. In some cases this leads to an easier analysis even though in theory we could do the analysis using the accounting method (with weird fractional amounts of money stored in a “bank account”).