NP-equivalent
In computational complexity theory, the complexity class NP-equivalent is the set of function problems that are both NP-easy and NP-hard.[src] NP-equivalent is the analogue of NP-complete for function problems.[src] For example, the problem FIND-SUBSET-SUM is in NP-equivalent.[src] Given a set of integers, FIND-SUBSET-SUM is the problem of finding some nonempty subset of the integers that adds up to zero (or returning the empty set if there is no such subset).[src] This optimization problem is similar to the decision problem SUBSET-SUM.[src] Given a set of integers, SUBSET-SUM is the problem of finding whether there exists a subset summing to zero.[src] SUBSET-SUM is NP-complete.[src] To show that FIND-SUBSET-SUM is NP-equivalent, we must show that it is both NP-hard and NP-easy.[src] Clearly it is NP-hard.[src] If we had a black box that solved FIND-SUBSET-SUM in unit time, then it would be easy to solve SUBSET-SUM.[src] Simply ask the black box to find the subset that sums to zero, then check whether it returned a nonempty set.[src] It is also NP-easy.[src] If we had a black box that solved SUBSET-SUM in unit time, then we could use it to solve FIND-SUBSET-SUM.[src] If it returns false, we immediately return the empty set.[src] Otherwise, we visit each element in order and remove it provided that SUBSET-SUM would still return true after we remove it.…[src]
In computational complexity theory, the complexity class NP-equivalent is the set of function problems that are both NP-easy and NP-hard.[src] NP-equivalent is the analogue of NP-complete for function problems.[src] For example, the problem FIND-SUBSET-SUM is in NP-equivalent.[src] Given a set of integers, FIND-SUBSET-SUM is the problem of finding some nonempty subset of the integers that adds up to zero (or returning the empty set if there is no such subset).[src] This optimization problem is similar to the decision problem SUBSET-SUM.[src] Given a set of integers, SUBSET-SUM is the problem of finding whether there exists a subset summing to zero.[src] SUBSET-SUM is NP-complete.[src] To show that FIND-SUBSET-SUM is NP-equivalent, we must show that it is both NP-hard and NP-easy.[src] Clearly it is NP-hard.[src] If we had a black box that solved FIND-SUBSET-SUM in unit time, then it would be easy to solve SUBSET-SUM.[src] Simply ask the black box to find the subset that sums to zero, then check whether it returned a nonempty set.[src] It is also NP-easy.[src] If we had a black box that solved SUBSET-SUM in unit time, then we could use it to solve FIND-SUBSET-SUM.[src] If it returns false, we immediately return the empty set.[src] Otherwise, we visit each element in order and remove it provided that SUBSET-SUM would still return true after we remove it.[src] Once we've visited every element, we will no longer be able to remove any element without changing the answer from true to false; at this point the remaining subset of the original elements must sum to zero.[src] This requires us to note that later removals of elements do not alter the fact that removal of an earlier element changed the answer from true to false.[src] In pseudocode: function FIND-SUBSET-SUM(set S) if not(SUBSET-SUM(S)) return {} for each x in S if SUBSET-SUM(S – {x}) S := S – {x} return S Another well-known NP-equivalent problem is the traveling salesman problem.[src] ==Clarification== In this context NP stands for nondeterministic polynomial time.[src] There are also NP-equivalence classes of Boolean functions, where NP stands for negation and permutation.[src] ==Notes== ==References== .[src]
36 sentences · 36 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"NP-equivalent." encyclopegia.org, 2023, https://encyclopegia.org/wiki/np-equivalent. Accessed 28 November 2026.
Chicago
"NP-equivalent." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/np-equivalent.
APA
encyclopegia.org. (2023). NP-equivalent. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/np-equivalent
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON