The Potential Method, formally [00TV]

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:

If a potential energy function \Phi is valid, it means that the total amortized cost will always be at least the total actual costs, that is, \sum _{i=1}^n a_i \geq \sum _{i=1}^n c_i. So the general technique is to define a potential energy function \Phi which starts out as 0 on the initial data structure, and always remains nonnegative. Given such a valid potential function, the amortized cost of an operation (defined as the actual cost plus the change in potential energy) gives a valid bound on the average cost of a single operation.

Context

★ The Potential Method [00TT]