next up previous
Next: Up: Previous:

Potential Method

Credit adds to ``potential'' of whole data structure instead of to individual objects.



Definitions


\begin{displaymath}\sum_{i=1}^{n} \hat{c_i} \;=\; \sum_{i=1}^{n} (c_i \;+\; \Phi(D_i)
\;-\; \Phi(D_{i-1}))\end{displaymath}

This is a telescoping series. $\sum_{i=1}^n (a_i - a_{i-1}) = a_n - a_0$


\begin{displaymath}=\; \sum_{i=1}^{n} c_i \;+\; \Phi(D_n) \;-\; \Phi(D_0).\end{displaymath}

If \(\Phi(D_n) \;\geq\; \Phi(D_0)\), then the amortized cost is an upper bound on the actual cost.

However, we do not know n.

If \(\Phi(D_i) \;\geq\; \Phi(D_0)\) for all i, then we always pay in advance.

Let \(\Phi(D_0) \;=\; 0\), thus we want \(\Phi(D_i) \;\geq\; 0\).

This is similar to the accounting method since we credit potential when \(\Phi(D_i) \;-\; \Phi(D_{i-1})\) is positive and debit potential when \(\Phi(D_i) \;-\; \Phi(D_{i-1})\) is negative.


next up previous
Next: Up: Previous: