External memory model
In theoretical computer science, the external memory model (also called the I/O model or disk access model) is a model of computation that models the behavior of computers that use magnetic storage. It captures the fact that read and write operations are much faster in a cache than in main memory, and that reads long contiguous blocks is faster than reading randomly using a disk read-and-write head. The running time of an algorithm in the external memory model is defined the number of reads and writes to memory required.[1] The model was introduced by Alok Aggarwal and David Vitter in 1988.[2] The external memory model is related to the cache-oblivious model, but algorithms in the external memory model may know the block size.
Model

The model consists of a processor with an internal memory or cache of size , connected to an unbounded external memory. Both the internal and external memory are divided into blocks of size . One input/output operation consists of moving a block of contiguous elements from external to internal memory, and the running time of an algorithm is determined by the number of these input/output operations.
Algorithms
Algorithms in the external memory model take advantage of the fact that retrieving one object from external memory retrieves an entire block of size . This property is sometimes referred to as locality.
Searching for an element among objects is possible in the external memory model is possible using a B-tree with branching factor . Using a B-tree, searching, insertion, and deletion can be achieved in time (in Big O notation). Information theoretically, this is the minimum running time possible for these operations, so using a B-tree is asymptotically optimal.[2]
Using external sorting, such as a -way merge sort, sorting elements in the external memory model is possible in time, which is similarly asymptotically optimal.
The permutation problem is to rearrange elements into a specific permutation. This can either be done either by sorting, which requires the above sorting runtime, or inserting each element in order and ignoring the benefit of locality. Thus, permutation can be done in time.
Applications
The external memory model captures the memory hierarchy, which is not modeled in other common models used in analyzing data structures, such as the random access machine. The model is also useful for analyzing algorithms that work on datasets too big to fit in internal memory.[2]
See also
References
- ^ "I/O Model of Computation". Encyclopedia of Database Systems. Springer Science+Business Media. 2009. pp. 1333–1334.
- ^ a b c Aggarwal, Alok; Vitter, Jeffrey (1988). "The input/output complexity of sorting and related problems". Communications of the ACM. 31 (9): 1116–1127.