NL-Completeness and PSPACE-Completeness
Last Updated :
27 Jul, 2022
For solving complex problems we require efficient algorithm. We face so many problems and some of them can be solved by using an algorithm and every algorithm requires some space and time. For better performance of program we need to reduce space and time complexity of algorithm.
In this article we will discuss briefly about NL-completeness , PSPACE-Completeness with some basic definitions.
Examples which will take more memory: the web graph, genomes etc.
We want algorithm which uses small amount of memory, so that large amount of data can be manipulated without storing all data to computer hard-disk at a time. An algorithm take sub linear space because input n bits take linear space.
Two-tape Turing machine is used here-
- Read- only tape containing input
- Work-tape that can be freely used
Space acquired by work tape contribute to space complexity.
We have,
L = SPACE ( log n ) , and
NL = NSPACE ( log n )
SPACE COMPLEXITY :
It is defined as the amount of computer memory space required to solve any given computational problem as function of input or we can say that it is the amount of memory needed by an algorithm ,until its execution complete. An algorithm is called complete if it will terminates and if its solution exist.

NL-Completeness :
NL contains decision problem and solved by Non Deterministic Turing Machine. Before understanding NL-completeness first we understand Log space-Reducibility.
Log space-Reducibility :
A is log space reducible to B, if for all function f :
{0, 1}* → {0, 1}* such that x ∈ A if f (x) ∈ B for every x ∈ {0, 1}*
For defining NL completeness , we requires suitable reduction. Whether L = NL is the complexity theoretic question. Hence reduction is log space reduction, i.e. given an input string x , we have a function f(x) such that f(x) is computable by DTM by using at most O(log |x|) cells in the work tape.
A language “A” is NL-complete if it satisfy the two conditions below-
- “A” is in NL. (A ∈ NL)
- Language belong to NL can be log space reducible to “A”
(for all B in NL, there exist B ≤L A).
Applications :
- ST-connectivity
- Propositional Logic
- 2-satisfiability
PSPACE- completeness :
All the decision problems that can be solved in polynomial input length, and if every other problem solved in polynomial space can be converted to polynomial time. The “word problem” for deterministic context-sensitive grammars was the first PSPACE complete problem.
A language “A” is PSPACE-complete if it satisfy the two conditions below
- “A” is in PSPACE. (A ∈ PSPACE)
- Language belong to PSPACE can be polynomial time reducible to “A”
(for all B in PSPACE, there exist B ≤L A).
Note that if “A” is following only second condition then we say it is PSPACE-hard.
Applications :
- Hex(board game).
- First order logic of equality
- First order theory of well-ordered sets
- Lambda calculus etc.

Why log space reduction is used for NL-completeness while PSPACE reduction is not used for PSPACE-completeness?
As L ⊆ NL ⊆ P . therefore it doesn’t make sense to use polynomial time reduction for NL-completeness, since poly time reduction is more powerful than the class L. hence we use log space reduction for NL-completeness.
Completeness results are more impressive using weaker reduction since reduction is able to do less of the work ,hence reduction is actually doing all work hence we use polynomial time reduction instead of polynomial space-reduction.
Similar Reads
P, NP, CoNP, NP hard and NP complete | Complexity Classes
In computer science, problems are divided into classes known as Complexity Classes. In complexity theory, a Complexity Class is a set of problems with related complexity. With the help of complexity theory, we try to cover the following. Problems that cannot be solved by computers.Problems that can
5 min read
Set cover is NP Complete
Problem: Given a ground Set X, an integer k, and a collection of subsets Si of X, the problem is to identify if there exists a collection of subsets whose union is X, with size at most k. Proof: An instance of the problem is an input specified to the problem. An instance of the Set Cover problem is
3 min read
Difference between NP hard and NP complete problem
All NP Complete Problems are NP-Hard but vice versa is not true. NP-Complete problems are subset of NP Problems. NP Problems : NP problems are a class of computational problems that can be solved in polynomial time by a non-deterministic machine and can be verified in polynomial time by a determinis
2 min read
3-coloring is NP Complete
Prerequisite: NP-Completeness, Graph Coloring Graph K-coloring Problem: A K-coloring problem for undirected graphs is an assignment of colors to the nodes of the graph such that no two adjacent vertices have the same color, and at most K colors are used to complete color the graph. Problem Statement
5 min read
Double SAT is NP Complete
Problem Statement: Given a formula f, the problem is to determine if f has two satisfying assignments. Explanation: An instance of the problem is an input specified to the problem. An instance of Double Sat problem is a boolean formula f. Since an NP-complete problem is a problem which is both NP an
2 min read
Constant & Linear Space Complexity in Algorithms
Being a programmer, you might have solved a lot of programming challenges. In programming space and time complexity matters a lot when we need to execute a program. Our algorithm should be efficient, and it should take less time. Whenever you're writing a solution to a program, some memory is requir
5 min read
What does 'Space Complexity' mean?
The term Space Complexity is misused for Auxiliary Space at many places. Following are the correct definitions of Auxiliary Space and Space Complexity. Auxiliary Space is the extra space or temporary space used by an algorithm. The space Complexity of an algorithm is the total space taken by the alg
2 min read
Optimized Longest Path is NP Complete
Optimized Longest Path Problem: The optimized longest path problem states that given a graph G, of a set of vertices V and edges E, the task is to prove that there is a path of length at least K between a set of nodes Vs and Ve. Problem Statement: Given a graph G(V, E, K) and a set of nodes Vs and V
4 min read
What is the difference between Auxiliary space and Space Complexity?
Space complexity and Auxiliary space are two of the most often confused and interchangeably used terms when talking about the space complexity of a certain algorithm: Auxiliary Space: The extra space that is taken by an algorithm temporarily to finish its workSpace Complexity: Space complexity is th
4 min read
Introduction to NP-Complete Complexity Classes
NP-complete problems are a subset of the larger class of NP (nondeterministic polynomial time) problems. NP problems are a class of computational problems that can be solved in polynomial time by a non-deterministic machine and can be verified in polynomial time by a deterministic Machine. A problem
5 min read