Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
NP-equivalent
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
In [[computational complexity theory]], the [[complexity class]] '''NP-equivalent''' is the set of [[function problem]]s that are both [[NP-easy]] and [[NP-hard]].<ref>{{harvtxt|Garey|Johnson|1979}}, p. 117, 120.</ref> NP-equivalent is the analogue of [[NP-complete]] for [[function problem]]s. For example, the problem FIND-SUBSET-SUM is in NP-equivalent. Given a set of [[integer]]s, 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). This [[optimization problem]] is similar to the [[decision problem]] [[subset sum problem|SUBSET-SUM]]. Given a set of integers, SUBSET-SUM is the problem of finding whether there exists a subset summing to zero. SUBSET-SUM is NP-complete. To show that FIND-SUBSET-SUM is NP-equivalent, we must show that it is both NP-hard and NP-easy. Clearly it is NP-hard. If we had a [[Black box (systems)|black box]] that solved FIND-SUBSET-SUM in unit time, then it would be easy to solve SUBSET-SUM. Simply ask the black box to find the subset that sums to zero, then check whether it returned a nonempty set. It is also NP-easy. If we had a black box that solved SUBSET-SUM in unit time, then we could use it to solve FIND-SUBSET-SUM. If it returns ''false'', we immediately return the empty set. Otherwise, we visit each element in order and remove it provided that SUBSET-SUM would still return ''true'' after we remove it. 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. 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''. 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]]. ==Clarification== In this context ''NP'' stands for ''[[NP (complexity)|nondeterministic polynomial time]]''.<br> There are also NP-equivalence classes of [[Boolean function]]s, where ''NP'' stands for ''negation'' and ''permutation''. <ref>See e.g. the sequence {{OEIS link|A000616}} in the [[OEIS]]. Often used in the context of NPN-equivalence classes. (E.g. in [https://www.mdpi.com/2073-8994/11/1/27 A New Pairwise NPN Boolean Matching Algorithm...].)</ref> ==Notes== {{reflist}} ==References== * {{Garey-Johnson}}. {{DEFAULTSORT:Np-Equivalent}} [[Category:Complexity classes]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Garey-Johnson
(
edit
)
Template:Harvtxt
(
edit
)
Template:OEIS link
(
edit
)
Template:Reflist
(
edit
)