Friday, December 27, 2024
Google search engine
HomeData Modelling & AISubset Equality is NP Complete

Subset Equality is NP Complete

Subset Equality Problem: Given a set S of non-negative integer values, the problem is to identify if there is a partition of the set S into two sets X and Y, such that, the integer sum in X is equal to the sum of integers in Y.

Explanation:
An instance of the problem is an input specified to the problem. An instance of the Subset Equality Problem is a set S. Since an NP-Complete problem is a problem which is both in NP and NP-hard, the proof for the statement that a problem is NP-Complete consists of two parts:

  1. The problem itself is in NP class.
  2. All other problems in NP class can be polynomial-time reducible to that.(B is polynomial-time reducible to C is denoted as B ≤ PC)

If the 2nd condition is only satisfied then the problem is called NP-Hard.

But it is not possible to reduce every NP problem into another NP problem to show its NP-Completeness all the time. Therefore, to show a problem is NP-Complete, then proof that the problem is in NP and any NP-Complete problem is reducible to that i.e., if B is NP-Complete and B ≤ PC then for C in NP, then C is NP-Complete. Thus, it can be concluded that the Subset Equality Problem is NP-Complete using the following two propositions:

  1. Subset equality is in NP
  2. Subset equality is NP-Hard

This two proposition can be proved as the Subset Equality Problem is a special case of the Subset Sum Problem where the sum of each partition of subset X and Y in S can be set as: sum = \frac{1}{2}\sum_{x\epsilon S}x

Since the subset-sum is NP-Complete, the subset equality problem also becomes NP-Complete.

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

RELATED ARTICLES

Most Popular

Recent Comments