Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
NP-equivalent
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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]]
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Garey-Johnson
(
edit
)
Template:Harvtxt
(
edit
)
Template:OEIS link
(
edit
)
Template:Reflist
(
edit
)
Search
Search
Editing
NP-equivalent
Add topic