Exercises Videos Notes Multiple-choice questions

Related books

Algorithms Algorithm Design Introduction to Theory of Computation Theory of Computation Computational Complexity: A Modern Approach Algorithms Computational Complexity Computers and Intractability: A Guide to the Theory of NP-Completeness Suggest a Book
1

Subset Sum vs Partition

Level: unknown
 

posted Jun 12 '12

kintali gravatar image Shiva Kintali flag of United States
691 1 6 22
http://www.cs.princeton.e...

Consider the following problems :

Partition problem : Given a collection of $n$ integers $a_1, a_2, \ldots, a_n$, is there a subset $I~\subset~{1,2, \ldots, n }$ such that $\sum_{i~\in~I}a_i~=~\sum_{i~\not\in~I}a_i$ ?

Subset Sum problem : Given a collection of $n$ integers $a_1, a_2, \ldots, a_n$ and an integer $B$, is there a subset $I~\subseteq~{1,2, \ldots, n }$ such that $\sum_{i~\in~I}a_i~=B$ ?

  • Give a polynomial time reduction from the partition problem to the subset sum problem.

  • Give a polynomial time reduction from the subset sum problem to the partition problem.

Source: folklore
Printable version LaTeX source
delete flag offensive retag edit

Comments

1

This is a good exam problem.

JeffE (Jun 13 '12)edit

Stats

Posted: Jun 12 '12

Seen: 83 times

Last updated: Jun 12 '12