Reference articles on history, science, culture and more
Encyclopedia

Function problem

Type of computational problem

In computational complexity theory, a function problem is a computational problem where a single output is expected for every input, but the output is more complex than that of a decision problem. For function problems, the output is not simply 'yes' or 'no'.

01Definition

A function problem P is defined by a relation R over strings of an arbitrary alphabet \Sigma:

R\subseteq \Sigma ^{*}\times \Sigma ^{*}.

Note that R does not have to be a functional binary relation.

An algorithm solves P if for every input x such that there exists a y satisfying (x,y)\in R, the algorithm produces one such y, and if there are no such y, it rejects.

A promise function problem permits the algorithm to do anything (thus may not terminate) if no such y exists.

02Examples

A well-known function problem is given by the functional Boolean satisfiability problem, FSAT for short. The problem, which is closely related to the SAT decision problem, can be formulated as follows:

Given a propositional formula \varphi with variables x_{1},\ldots ,x_{n}, find an assignment x_{i}\rightarrow \{{\text{TRUE}},{\text{FALSE}}\} such that \varphi evaluates to {\text{TRUE}} or decide that no such assignment exists.

In this case the relation R is given by pairs of suitably encoded propositional formulas and satisfying assignments. While a SAT algorithm, fed with a formula \varphi, only needs to return "unsatisfiable" or "satisfiable", an FSAT algorithm needs to return some satisfying assignment in the latter case.

Other notable examples include the travelling salesman problem, which asks for the route taken by the salesman, and the integer factorization problem, which asks for the list of factors.

03Relationship to other complexity classes

Consider an arbitrary decision problem L in the class NP. By the definition of NP, there is a system of certificates such that each problem instance x that is answered 'yes' has a polynomial-size certificate y that serves as a proof for the 'yes' answer (and problem instances answered 'no' have no such certificates). Thus, the set of these pairs (x,y) forms a relation, representing the function problem "given x in L, find a certificate y for x". This function problem is called a function variant of L; it belongs to the class FNP.

Conversely, every problem R in FNP induces a (unique) corresponding decision problem: given x, decide if there exists some y such that R(x,y) holds.

FNP can be thought of as the function class analogue of NP, in that solutions of FNP problems can be efficiently (i.e., in polynomial time in terms of the length of the input) verified, but not necessarily efficiently found. In contrast, the class FP, which can be thought of as the function class analogue of P, consists of function problems for which solutions can be found in polynomial time.

04Self-reducibility

Observe that the problem FSAT introduced above can be solved using only polynomially many calls to a subroutine that decides the SAT problem: An algorithm can first ask whether the formula \varphi is satisfiable. After that the algorithm can fix variable x_{1} to TRUE and ask again. If the resulting formula is still satisfiable the algorithm keeps x_{1} fixed to TRUE and continues to fix x_{2}, otherwise it decides that x_{1} has to be FALSE and continues. Thus, FSAT is solvable in polynomial time using an oracle deciding SAT. In general, a problem in FNP is called self-reducible if it can be solved in polynomial time using an oracle for its induced decision problem. Every function variant of every NP-complete problem is self-reducible. There are several (slightly different) notions of self-reducibility.

05Reductions and complete problems

Function problems can be reduced much like decision problems: Given function problems R and S we say that R reduces to S if there exist polynomially-time computable functions f and g such that for all instances x of R and possible solutions y of S, it holds that

  • If x has an R-solution, then f(x) has an S-solution.
  • (f(x),y)\in S\implies (x,g(x,y))\in R.

It is therefore possible to define FNP-hard problems analogous to NP-hard problems:

A problem R is FNP-hard if every problem in FNP can be reduced to R. A problem R is FNP-complete if it is FNP-hard and in FNP. The problem FSAT is an FNP-complete problem, and hence by self-reducibility of FSAT it holds that \mathbf {P} =\mathbf {NP} if and only if \mathbf {FP} =\mathbf {FNP}.

06Total function problems

The relation R(x,y) used to define function problems has the drawback of being possibly incomplete: Not every input x necessarily has a counterpart y such that (x,y)\in R. Therefore the question of computability of outputs is not separated from the question of their existence. To overcome this problem it is convenient to consider the restriction of function problems to total relations yielding the class TFNP as a subclass of FNP. This class contains problems such as the computation of pure Nash equilibria in certain strategic games where a solution is guaranteed to exist. In addition, if TFNP contains any FNP-complete problem it follows that \mathbf {NP} ={\textbf {co-NP}}.

Watch videos about Function problemExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Function problem, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.