<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Function_problem</id>
	<title>Function problem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Function_problem"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Function_problem&amp;action=history"/>
	<updated>2026-06-20T23:26:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Function_problem&amp;diff=396821&amp;oldid=prev</id>
		<title>~2025-34236-95: Deleted problematic/erroneous statement. There is no reason for integer factorization and prime checking to be related here. Integer factorization is not the function class analogue of prime checking (we&#039;re computing a composite number). Prime factorization is possibly the the function class analogue of composite checking (the complement of prime checking). It is critical to distinguish between complexity classes and their complements, otherwise, we would regard NP and coNP as the same class.</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Function_problem&amp;diff=396821&amp;oldid=prev"/>
		<updated>2025-11-17T21:35:41Z</updated>

		<summary type="html">&lt;p&gt;Deleted problematic/erroneous statement. There is no reason for integer factorization and prime checking to be related here. Integer factorization is not the function class analogue of prime checking (we&amp;#039;re computing a composite number). Prime factorization is possibly the the function class analogue of composite checking (the complement of prime checking). It is critical to distinguish between complexity classes and their complements, otherwise, we would regard NP and coNP as the same class.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{short description|Type of computational problem}}&lt;br /&gt;
In [[computational complexity theory]], a &amp;#039;&amp;#039;&amp;#039;function problem&amp;#039;&amp;#039;&amp;#039; is a [[computational problem]] where a single output (of a [[total function]]) 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 &amp;#039;yes&amp;#039; or &amp;#039;no&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== Definition ==&lt;br /&gt;
A function problem &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is defined by a [[Relation (mathematics)|relation]] &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; over [[String (computer science)|strings]] of an arbitrary [[Alphabet (computer science)|alphabet]] &amp;lt;math&amp;gt;\Sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;R \subseteq \Sigma^* \times \Sigma^*.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An algorithm solves &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; if for every input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; such that there exists a &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; satisfying &amp;lt;math&amp;gt;(x, y) \in R&amp;lt;/math&amp;gt;, the algorithm produces one such &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;, and if there are no such &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;, it rejects.&lt;br /&gt;
&lt;br /&gt;
A promise function problem permits the algorithm to do anything (thus may not terminate) if no such &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; exists.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
A well-known function problem is given by the Functional Boolean Satisfiability Problem, &amp;#039;&amp;#039;&amp;#039;FSAT&amp;#039;&amp;#039;&amp;#039; for short. The problem, which is closely related to the [[Boolean satisfiability problem|&amp;#039;&amp;#039;&amp;#039;SAT&amp;#039;&amp;#039;&amp;#039;]] decision problem, can be formulated as follows:&lt;br /&gt;
&lt;br /&gt;
:Given a boolean formula &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt; with variables &amp;lt;math&amp;gt;x_1, \ldots, x_n&amp;lt;/math&amp;gt;, find an assignment &amp;lt;math&amp;gt;x_i \rightarrow \{ \text{TRUE}, \text{FALSE} \}&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt; evaluates to &amp;lt;math&amp;gt;\text{TRUE}&amp;lt;/math&amp;gt; or decide that no such assignment exists.&lt;br /&gt;
&lt;br /&gt;
In this case the relation &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; is given by pairs of suitably encoded boolean formulas and satisfying assignments.&lt;br /&gt;
While a SAT algorithm, fed with a formula &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt;, only needs to return &amp;quot;unsatisfiable&amp;quot; or &amp;quot;satisfiable&amp;quot;, an FSAT algorithm needs to return some satisfying assignment in the latter case.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Relationship to other complexity classes ==&lt;br /&gt;
Consider an arbitrary [[decision problem]] &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; in the class [[NP (complexity)|&amp;#039;&amp;#039;&amp;#039;NP&amp;#039;&amp;#039;&amp;#039;]]. By the definition of &amp;#039;&amp;#039;&amp;#039;NP&amp;#039;&amp;#039;&amp;#039;, each problem instance &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; that is answered &amp;#039;yes&amp;#039; has a polynomial-size certificate &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; which serves as a proof for the &amp;#039;yes&amp;#039; answer. Thus, the set of these pairs &amp;lt;math&amp;gt;(x,y)&amp;lt;/math&amp;gt; forms a relation, representing the function problem &amp;quot;given &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, find a certificate &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;&amp;quot;. This function problem is called the &amp;#039;&amp;#039;function variant&amp;#039;&amp;#039; of &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;; it belongs to the class &amp;#039;&amp;#039;&amp;#039;[[FNP (complexity)|FNP]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;FNP&amp;#039;&amp;#039;&amp;#039; can be thought of as the function class analogue of &amp;#039;&amp;#039;&amp;#039;NP&amp;#039;&amp;#039;&amp;#039;, in that solutions of &amp;#039;&amp;#039;&amp;#039;FNP&amp;#039;&amp;#039;&amp;#039; problems can be efficiently (i.e., in [[polynomial time]] in terms of the length of the input) &amp;#039;&amp;#039;verified&amp;#039;&amp;#039;, but not necessarily efficiently &amp;#039;&amp;#039;found&amp;#039;&amp;#039;. In contrast, the class &amp;#039;&amp;#039;&amp;#039;[[FP (complexity)|FP]]&amp;#039;&amp;#039;&amp;#039;, which can be thought of as the function class analogue of &amp;#039;&amp;#039;&amp;#039;P&amp;#039;&amp;#039;&amp;#039;, consists of function problems whose solutions can be found in polynomial time.&lt;br /&gt;
&lt;br /&gt;
== Self-reducibility ==&lt;br /&gt;
Observe that the problem &amp;#039;&amp;#039;&amp;#039;FSAT&amp;#039;&amp;#039;&amp;#039; introduced above can be solved using only polynomially many calls to a subroutine which decides the &amp;#039;&amp;#039;&amp;#039;SAT&amp;#039;&amp;#039;&amp;#039; problem: An algorithm can first ask whether the formula &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt; is satisfiable. After that the algorithm can fix variable &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; to TRUE and ask again. If the resulting formula is still satisfiable the algorithm keeps &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; fixed to TRUE and continues to fix &amp;lt;math&amp;gt;x_2&amp;lt;/math&amp;gt;, otherwise it decides that &amp;lt;math&amp;gt;x_1&amp;lt;/math&amp;gt; has to be FALSE and continues. Thus, &amp;#039;&amp;#039;&amp;#039;FSAT&amp;#039;&amp;#039;&amp;#039; is solvable in polynomial time using an [[Oracle machine|oracle]] deciding &amp;#039;&amp;#039;&amp;#039;SAT&amp;#039;&amp;#039;&amp;#039;. In general, a problem in &amp;#039;&amp;#039;&amp;#039;NP&amp;#039;&amp;#039;&amp;#039; is called &amp;#039;&amp;#039;self-reducible&amp;#039;&amp;#039; if its function variant can be solved in polynomial time using an oracle deciding the original problem. Every &amp;#039;&amp;#039;&amp;#039;[[NP-complete]]&amp;#039;&amp;#039;&amp;#039; problem is self-reducible.&lt;br /&gt;
There are several (slightly different) notions of self-reducibility.&amp;lt;ref&amp;gt;{{cite journal |first= K.|last= Ko|title= On self-reducibility and weak P-selectivity|journal= [[Journal of Computer and System Sciences]]|volume= 26|issue=2|pages=209–221|year=1983|doi= 10.1016/0022-0000(83)90013-2}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite journal |first= C.|last=Schnorr|title=Optimal algorithms for self-reducible problems|journal=In S. Michaelson and R. Milner, Editors, Proceedings of the 3rd International Colloquium on Automata, Languages, and Programming|pages=322–337|year=1976}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite journal |first=A.|last=Selman|title=Natural self-reducible sets|journal=[[SIAM Journal on Computing]]|volume=  17|issue=5|pages=989–996|year=1988|doi=10.1137/0217062 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reductions and complete problems ==&lt;br /&gt;
Function problems can be [[Reduction (complexity)|reduced]] much like decision problems: Given function problems &amp;lt;math&amp;gt;\Pi_R&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Pi_S&amp;lt;/math&amp;gt; we say that &amp;lt;math&amp;gt;\Pi_R&amp;lt;/math&amp;gt; reduces to &amp;lt;math&amp;gt;\Pi_S&amp;lt;/math&amp;gt; if there exists polynomially-time computable functions &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;g&amp;lt;/math&amp;gt; such that for all instances &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; and possible solutions &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;, it holds that&lt;br /&gt;
&lt;br /&gt;
*If &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; has an &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt;-solution, then &amp;lt;math&amp;gt;f(x)&amp;lt;/math&amp;gt; has an &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;-solution.&lt;br /&gt;
*&amp;lt;math&amp;gt;(f(x), y) \in S \implies (x, g(x,y)) \in R.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is therefore possible to define &amp;#039;&amp;#039;&amp;#039;FNP-complete&amp;#039;&amp;#039;&amp;#039; problems analogous to the NP-complete problem:&lt;br /&gt;
&lt;br /&gt;
A problem &amp;lt;math&amp;gt;\Pi_R&amp;lt;/math&amp;gt; is &amp;#039;&amp;#039;&amp;#039;FNP-complete&amp;#039;&amp;#039;&amp;#039; if every problem in &amp;#039;&amp;#039;&amp;#039;FNP&amp;#039;&amp;#039;&amp;#039; can be reduced to &amp;lt;math&amp;gt;\Pi_R&amp;lt;/math&amp;gt;. The complexity class of &amp;#039;&amp;#039;&amp;#039;FNP-complete&amp;#039;&amp;#039;&amp;#039; problems is denoted by &amp;#039;&amp;#039;&amp;#039;FNP-C&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;FNPC&amp;#039;&amp;#039;&amp;#039;. Hence the problem &amp;#039;&amp;#039;&amp;#039;FSAT&amp;#039;&amp;#039;&amp;#039; is also an &amp;#039;&amp;#039;&amp;#039;FNP-complete&amp;#039;&amp;#039;&amp;#039; problem, and it holds that &amp;lt;math&amp;gt;\mathbf{P} = \mathbf{NP}&amp;lt;/math&amp;gt; if and only if &amp;lt;math&amp;gt;\mathbf{FP} = \mathbf{FNP}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Total function problems ==&lt;br /&gt;
The relation &amp;lt;math&amp;gt;R(x, y)&amp;lt;/math&amp;gt; used to define function problems has the drawback of being possibly incomplete: Not every input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; necessarily has a counterpart &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;(x, y) \in R&amp;lt;/math&amp;gt;. 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 &amp;#039;&amp;#039;&amp;#039;[[TFNP]]&amp;#039;&amp;#039;&amp;#039; as a subclass of &amp;#039;&amp;#039;&amp;#039;FNP&amp;#039;&amp;#039;&amp;#039;. 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 &amp;#039;&amp;#039;&amp;#039;TFNP&amp;#039;&amp;#039;&amp;#039; contains any &amp;#039;&amp;#039;&amp;#039;FNP-complete&amp;#039;&amp;#039;&amp;#039; problem it follows that &amp;lt;math&amp;gt;\mathbf{NP} = \textbf{co-NP}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Decision problem]]&lt;br /&gt;
*[[Search problem]]&lt;br /&gt;
*[[Counting problem (complexity)]]&lt;br /&gt;
*[[Optimization problem]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
{{more footnotes|date=October 2015}}&lt;br /&gt;
{{refbegin}}&lt;br /&gt;
* Raymond Greenlaw, H. James Hoover, &amp;#039;&amp;#039;Fundamentals of the theory of computation: principles and practice&amp;#039;&amp;#039;, Morgan Kaufmann, 1998, {{ISBN|1-55860-474-X}}, p.&amp;amp;nbsp;45-51&lt;br /&gt;
* [[Elaine Rich]], &amp;#039;&amp;#039;Automata, computability and complexity: theory and applications&amp;#039;&amp;#039;, Prentice Hall, 2008, {{ISBN|0-13-228806-0}}, section 28.10 &amp;quot;The problem classes FP and FNP&amp;quot;, pp.&amp;amp;nbsp;689–694&lt;br /&gt;
{{refend}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Computational problems]]&lt;br /&gt;
[[Category:Functions and mappings]]&lt;/div&gt;</summary>
		<author><name>~2025-34236-95</name></author>
	</entry>
</feed>