WIPIVERSE All articles

L (complexity)

L (also known as LSPACE, LOGSPACE, or DLOGSPACE) is a complexity class in computational complexity theory. It contains the decision problems that can be solved by a deterministic Turing machine using a logarithmic amount of writable memory space, relative to the length of the input.

Formal definition

Formally, a Turing machine deciding a problem in L has two tapes. One tape encodes the input and is read-only; the other tape is of logarithmic size but can be both read and written. This logarithmic work space is sufficient to hold a constant number of pointers into the input and a logarithmic number of Boolean flags, which is how many basic logspace algorithms utilize the available memory.

Characterization and complete problems

Every non-trivial problem in L is complete under log-space reductions, so weaker reductions—most commonly first-order reductions—are required to define meaningful notions of L-completeness.

A significant 2004 result by Omer Reingold demonstrated that USTCON (the problem of determining whether there exists a path between two vertices in a given undirected graph) is in L. Since USTCON is SL-complete, this established that L = SL.

L also has a logical characterization: it contains precisely those languages expressible in first-order logic with an added commutative transitive closure operator. This result has applications in database query languages; under the measure of data complexity, queries against relational databases with complete information (as expressed, for example, in relational algebra) fall within L.

Relations to other complexity classes

L is a subclass of NL, the class of languages decidable in logarithmic space on a nondeterministic Turing machine. The relationship between these and other classes is captured by the containment chain:

NC¹ ⊆ L ⊆ NL ⊆ NC²

and it follows that L ⊆ NL ⊆ P, since a decider using O(log n) space cannot use more than n^(O(1)) time—this being the total number of possible configurations. Given a parallel computer with a polynomial number of processors, any problem solvable on it in O(log n) time is in L, and any problem in L can be solved in O(log² n) time.

Open problems

Important unresolved questions include whether L = P and whether L = NL. It is also not known whether L = NP.

Related classes and variants

The related class of function problems is FL, which is often used to define logspace reductions.

Analogous to the randomized versions of P, there are several randomized versions of L:

  • BPL (Bounded-error Probability L): problems solvable with a logspace Turing machine that also has a read-only, one-way random tape, accepting with probability at least 2/3 for "yes" answers and rejecting with probability at least 2/3 for "no" answers.
  • BP•L: defined like BPL but allowing the machine to read the random tape both forwards and backwards; it contains BPL and equals the class of languages that are nearly logspace.
  • ZP•L: defined like BP•L but the machine may output "unknown" and must never make an error.
  • RL (Randomized L): the machine accepts "yes" with probability at least 1/2 and always rejects "no," always running in polynomial time; it is strongly suspected that RL = L.
  • PL (Probabilistic L): related to L in the same way that PP is related to P.

Additional properties

L is low for itself, meaning it can simulate log-space oracle queries in log space by reusing the same space for each query.

Practical significance

The logspace concept is useful for modeling computation where the input is too large to fit entirely in a computer's random-access memory. Long DNA sequences and large databases are examples where only a constant portion of the input resides in RAM at any given time, with pointers used to locate subsequent sections—thereby using only logarithmic memory.

Browse

More topics to explore

    Browse all articles