In computer science, parameterized complexity is a branch of computational complexity theory that focuses on classifying computational problems according to their inherent difficulty with respect to multiple parameters of the input or output. The complexity of a problem is then measured as a function of those parameters. This allows the classification of NP-hard problems on a finer scale than in the classical setting, where the complexity of a problem is only measured as a function of the number of bits in the input. This appears to have been first demonstrated in . The first systematic work on parameterized complexity was done by .
The existence of efficient, exact, and deterministic solving algorithms for NP-complete, or otherwise NP-hard, problems is considered unlikely, if input parameters are not fixed; all known solving algorithms for these problems require time that is exponential (so in particular super-polynomial) in the total size of the input. However, some problems can be solved by algorithms that are exponential only in the size of a fixed parameter while polynomial in the size of the input.
Under the assumption that P ≠ NP, there exist many natural problems that require super-polynomial running time when complexity is measured in terms of the input size only but that are computable in a time that is polynomial in the input size and exponential or worse in a parameter . Hence, if is fixed at a small value and the growth of the function over is relatively small then such problems can still be considered "tractable" despite their traditional classification as "intractable".
Such an algorithm is called a fixed-parameter tractable (FPT) algorithm, because the problem can be solved efficiently (i.e., in polynomial time) for constant values of the fixed parameter. A parameterized problem that allows for such an FPT algorithm is said to be a fixed-parameter tractable problem and belongs to the class , and the early name of the theory of parameterized complexity was fixed-parameter tractability.
Setup
Many problems have the following form: given an object and a nonnegative integer , does have some property that depends on ?
For instance, for the vertex cover problem, the parameter can be the number of vertices in the cover. The minimal vertex cover problem asks:
In many applications, for example when modelling error correction, one can assume the parameter to be "small" compared to the total input size. Then it is challenging to find an algorithm that is exponential only in , and not in the input size.
In this way, parameterized complexity can be seen as two-dimensional complexity theory. This concept is formalized as follows:
:A parameterized problem is a language <math>L \subseteq \Sigma^* \times \N</math>, where <math>\Sigma</math> is a finite alphabet. The second component is called the parameter of the problem.
:A parameterized problem is fixed-parameter tractable if the question "<math>(x, k) \in L</math>?" can be decided in running time <math>f(k) \cdot |x|^{O(1)}</math>, where is an arbitrary function depending only on . The corresponding complexity class is called FPT.
:A parameterized problem uses the natural parameter when its parameter is the size of the solution to the problem.
For example, there is an algorithm that solves the vertex cover problem in <math>O(kn + 1.274^k)</math> time, where is the number of vertices and is the size of the vertex cover. This means that vertex cover is fixed-parameter tractable with the size of the solution as the parameter (its natural parameter).
Complexity classes
FPT
FPT (fixed parameter tractable) is the class of decision problems decidable in deterministic time <math>f(k) \cdot {|x|}^{O(1)}</math>, where is a computable function. Typically, this function is thought of as single exponential, such as <math>2^{O(k)}</math>, but the definition admits functions that grow even faster. This is essential for a large part of the early history of this class. The crucial part of the definition is to exclude functions of the form <math>f(n,k)</math>, such as <math>k^n</math>.
The class FPL (fixed parameter linear) is the class of problems solvable in time <math>f(k) \cdot |x|</math> for some computable function . FPL is thus a subclass of FPT. An example is the Boolean satisfiability problem, parameterised by the number of variables. A given formula of size with variables can be checked by brute force in time <math>O(2^km)</math>. A vertex cover of size in a graph of order can be found in time <math>O(2^kn)</math>, so the vertex cover problem is also in FPL.
An example of a problem that is thought not to be in FPT is graph coloring parameterised by the number of colors. It is known that 3-coloring is NP-hard, and an algorithm for graph -coloring in time <math>f(k)n^{O(1)}</math> for <math>k=3</math> would run in polynomial time in the size of the input. Thus, if graph coloring parameterised by the number of colors were in FPT, then P = NP.
There are a number of alternative definitions of FPT. For example, the running-time requirement can be replaced by <math>f(k) + |x|^{O(1)}</math>. Also, a parameterised problem is in FPT if it has a so-called kernel. Kernelization is a preprocessing technique that reduces the original instance to its "hard kernel", a possibly much smaller instance that is equivalent to the original instance but has a size that is bounded by a function in the parameter.
FPT is closed under a parameterised notion of reductions called fpt-reductions. We say that one parameterized problem <math>L</math> fpt-reduces to <math>L'</math> iff there exists two functions <math>(x, k) \mapsto x', k \mapsto k' </math>, such that
- <math>(x, k) \in L </math> iff <math>(x', k') \in L' </math>
- <math>(x, k) \mapsto x'</math> is itself fixed parameter tractable.
- That is, there exists a constant <math>c </math>, and a function <math>k \mapsto k </math>, such that <math>(x, k) \mapsto x'</math> is computable in time <math>\leq k|x|^c </math>
Obviously, FPT contains all polynomial-time computable problems. Moreover, it contains all optimisation problems in NP that allow an efficient polynomial-time approximation scheme (EPTAS).
XP
XP is the class of parameterized problems that can be solved in time <math>n^{f(k)}</math> for some computable function .
These problems are called slicewise polynomial, in the sense that each "slice" of fixed k has a polynomial-time algorithm, although with a possibly different exponent for each k. Compare this with FPT, which merely allows a different constant prefactor for each value of k.
XP strictly contains FPT by diagonalization.
para-NP
para-NP is the class of decision problems decidable in nondeterministic time <math>f(k) \cdot |x|^{O(1)}</math> for some computable function .
<math>\textsf{FPT}=\textsf{para-NP}</math> if and only if <math>\textsf{P}=\textsf{NP}</math>.
A problem is para-NP-hard if it is <math>\textsf{NP}</math>-hard already for a constant value of the parameter. That is, there is a "slice" of fixed that is <math>\textsf{NP}</math>-hard. A parameterized problem that is <math>\textsf{para-NP}</math>-hard cannot belong to the class <math>\textsf{XP}</math>, unless <math>\textsf{P}=\textsf{NP}</math>. A classic example of a <math>\textsf{para-NP}</math>-hard parameterized problem is graph coloring, parameterized by the number of colors, which is already <math>\textsf{NP}</math>-hard for <math>k=3</math> (see Graph coloring#Computational complexity).
Hierarchies
In the parameterized complexity theory, there are some hierarchies of complexity classes. Each such class is closed under fpt-reduction. The most important ones are the W hierarchy and the A hierarchy.
Preliminary definitions
In general, there are two ways to define a complexity class: machine-theoretically and logically. In machine theory, a class is defined as the set of decision problems solvable by a class of machines. In logic, a class is defined as the set of decision problems definable by a class of logical formulas.
Boolean circuits
The Hamming weight (weight for short) of a binary string is the number of ones appearing in it.
A Boolean circuit is an acyclic directed graph where the nodes are one of the following gates: AND, OR, NOT. A small gate is a gate with fan-in 0, 1, or 2. Other gates are big. The weft is the largest number of big gates achievable on any path from an input to the output. The depth is the largest number of gates (small or big) achievable on any path from an input to the output. By definition, weft ≤ depth.
A Boolean circuit is monotone iff it uses no NOT gate. A Boolean circuit is antimonotone iff it is of the form <math>\phi(\neg x_1, \dots, \neg x_n)</math> where <math>x_1, \dots, x_n</math> are all its inputs, and <math>\phi</math> is monotone.
Finite model theory
Given any:
- <math>\mathcal L</math>, a first-order logical language with a finite set of relation symbols,
- <math>\Gamma</math>, a set of first-order logical formulas in that language,
we define <math>\operatorname{p-MC}(\Gamma)</math> to be the parameterized model checking problem for this tuple. Each problem instance is:
- Input: <math>\phi \in \Gamma</math>, and a finite model <math>A</math> for the language <math>\mathcal L</math>
- Parameter: <math>|\phi|</math>
- Output: Whether <math>A \models \phi</math>
A <math>\Sigma_t</math> formula is of the form <math>\exists x_{1,1:m_1}\forall x_{2,1:m_2}\dots Q x_{t,1:m_t} \psi(x)</math>, such that the quantifiers are alternating between existence and for-all, and the formula inside <math>\psi(x)</math> is quantifier-free (that is, written with just variables, Boolean connectives, and relations).
A <math>\Sigma_{t, s}</math> formula is of the form <math>\exists x_{1,1:m_1}\forall x_{2,1:m_2}\dots Q x_{t,1:m_t} \psi(x)</math>, with the extra condition that <math>m_2 \leq s, m_3 \leq s, \dots, m_t \leq s</math>.
Definition
Machine-theoretically, a parameterized problem is in the class W[w][d], if there is a fpt-reduction of the problem as follows:
- There exists constant integers <math>w, d </math>, such that
- every instance <math>(x, k)</math> is transformed in fpt-time to a Boolean circuit that has weft at most w, and depth at most d,
- <math>(x, k)\in L</math> if and only if the circuit has a satisfying assignment of weight k.
Here we see that "W" stands for "weight". Note that in the above definition, <math>w, d </math> are independent of <math>(x, k) </math>, but the circuit itself depends on <math>(x, k) </math>, and may change if one changes either <math>x </math> or <math>k </math>.
The class W[w] is then defined as their union:<math display="block">W[w][1] \subset W[w][2]\subset \dots \subset W[w] := \bigcup_{d \geq 1} W[w][d]</math>More succinctly, W[w] is the set of problems fpt-reducible to a family of instance-specific Boolean circuits with weft <math>\leq w </math> and depth bounded by some problem-specific constant.
A normalized circuit of weft w and depth d is a circuit, where the first <math>d-w </math> layers contain only small gates, and the last <math>w </math> layers contain alternating big gates of AND and OR. One can iterate the associative laws and de Morgan distribution laws to normalize the circuit in fpt-time. Therefore, without loss of generality, we can consider only normalized circuits.
Model-theoretically, the class W[t] is defined as the class of problems fpt-reducible to <math>\operatorname{p-MC}(\Sigma_{t, 1})</math>.
While the W hierarchy is a hierarchy contained in NP, the A hierarchy more closely mimics the polynomial-time hierarchy from classical complexity. Machine-theoretically, the A hierarchy of problems are defined as problems that are fpt-reducible to computations by certain kinds of alternating Turing machines. The "A" stands for "alternating".
Examples of W[1]-complete problems include:
Note on the nondeterministic Turing machine. The machine may be specified by one of any of the standard formulations. One usually considers the one-tape Turing machine, but the short Turing machine problem remains W[1] even if we allow with f(k) tapes and even f(k) of f(k)-dimensional tapes, but even with this extension, the restriction to f(k) tape alphabet size is FPT. Crucially, because the machine M itself is part of the problem input, the input size n is bigger than the number of states of M. In this way, the Turing machine can take one of <math>n</math> possible computation paths per step, accessing <math>n^{O(k)}</math> steps in total within time k. Thus, we see that W[1] is not obviously contained within FPT.
The independent set problem can be encoded thus. Given each graph <math>(V, E)</math>, its independent set problem is encoded by the following weft-1 Boolean circuit:<math display="block">\Phi_{\text{IS(V, E) := \bigwedge_{\{u, v\}\in E} (\neg x_u \or \neg x_v)</math>where <math>E</math> is the set of edges in the graph. The graph has an independent set of size k iff there is a weight-k input to its Boolean circuit, such that it outputs 1.
The clique problem can be coded as <math display="block">\Phi_{\text{clique(V, E) := \bigwedge_{\{u, v\} \subset V, u \neq v, \{u, v\}\not\in E} (\neg x_u \or \neg x_v)</math>It checks that any pair vertices that don't make an edge cannot be chosen, so any chosen set of vertices is forced to be a clique.
The short Turing machine problem can be converted to a Boolean formula using the same proof idea as of the Cook–Levin theorem, which shows SAT is NP-complete by coding Turing machine computational traces as Boolean formulas. The following proof is from . Specifically, define the propositional variables:
- <math>s_{t, i, j, a, b}</math>: at time t, the Turing machine is in state i, and transitions to state j, reading a, and writing b,
- <math>y_{t, p, a, b}</math>: at time t, the tape position p has symbol a, and at time (t+1) has symbol b.
Of the indices, time t and tape position p range over 1:k, The ranges of the indices to the Turing machine state i, j, transition m, and symbols a, b are determined by the description of the machine M, but they are both bounded within 1:n.
Then, the formula <math>\Phi_{\text{STM}, k}(M, x)</math> is a conjunction of clauses enforcing the following constraints:
- Every Turing machine state transition is not disallowed by the nondeterministic transition rule. These look like <math>s_{t, i, j, a, b} \to \neg s_{t+1, i', j', a', b'}</math>, in other words, <math>\neg s_{t, i, j, a, b} \or \neg s_{t+1, i', j', a', b'}</math>. There are <math>O(kn^4)</math> such clauses.
- The Turing machine cannot be at two positions at a time, and cannot make two transitions at a time.
- Every tape cell state transition is not disallowed by the nondeterministic transition rule.
- Every tape cell state cannot have two symbols at a time.
- At time 0, the Turing machine is not out of its initial state and position, and x is not unwritten on the tape.
- The Turing machine is not in an unaccepting state at time k.
A computational trace through the Turing machine is then fully specified by setting k variables of <math>s_{t, i, j, a, b}</math> to True to indicate the Turing machine state transitions at each time, and setting <math>k^2 </math> variables of <math>y_{t, p, a, b}</math> to True to indicate the tape state transition at each time. This reduces the short Turing machine problem to a problem of finding a weight-<math>(k+k^2) </math> satisfying assignment to a weft-1, depth-2, antimonotone Boolean circuit.
W[2]
W[2] problems are intuitively of the form: Guess an object of size k, perform some local processing on the object, then perform one global processing.
Examples of W[2]-complete problems include
- deciding if a given graph contains a dominating set of size k.
- deciding if a given nondeterministic multi-tape Turing machine accepts within k steps ("short multi-tape Turing machine acceptance" problem). Crucially, the branching is allowed to depend on n (like the W[1] variant), as is the number of tapes. An alternate W[2]-complete formulation allows only single-tape Turing machines, but the alphabet size may depend on n.
The dominating set problem has formula <math>\Psi_{\text{dom(V, E) = \bigwedge_{u \in V} \bigvee_{v \in \operatorname{Neighbor}[u]} x_v</math>.
W[i]
Some problems are known to be W[i]-complete, though they are in a computationally generic form, and are usually studied within parameterized complexity theory itself. Empirically, as of 2013, almost all naturally-occurring parameterized problems that they have studied, turned out to be W[0]-complete, W[1]-complete, or W[2]-complete. The following are usually used:
W[SAT]
W[SAT] is the class of problems fpt-reducible to weighted SAT problems:
- Input: a Boolean formula
- Parameter: k
- Output: Whether the formula has a weight-k satisfying assignment.
It contains all W[t].
W[P]
W[P] is the class of problems fpt-reducible to the problem of weighted Boolean circuit problems:
