Potential function method

from Wikipedia, the free encyclopedia

In complexity theory , the potential or potential function method is used to measure the amortized time and storage complexity of data structures . The complexity is calculated using a sequence of operations, which distributes the costs of rare but expensive operations over the sequence of operations and thus smooths them out.

The aim is to assign an average cost value to each operation on the data structure under consideration in order to use this to estimate the expected runtime of any sequence of operations upwards. In contrast to the bank account method , the costs of an operation are not set in advance, but are derived. For this purpose, a potential function is introduced. This assigns its potential to each internal state of the data structure. Let us now be the maximum real costs of the operation , the amortized effort results as:

It is now true that the potential of the initial state is never undershot for all operations in any sequence of operations:

Then the sum of the real costs is never higher than the amortized costs:

For example, if there is a constant that indicates the upper limit of the amortized costs of each operation:

So the total cost of the sequence of operations can be calculated with operations with:

can be specified.

literature

swell

  1. Kurt Mehlhorn , Peter Sanders : Algorithms and Data Structures , 2008 Springer-Verlag Berlin Heidelberg, Chapter 3.3.1 The Potential or Bank Account Method for Amortized Analysis , pp. 72–74