{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

subsum

# subsum - The SUBSETSUM problem Consider the following...

This preview shows pages 1–3. Sign up to view the full content.

The SUBSETSUM problem Consider the following problem called the KNAPSACK problem: INPUT: n integer weights w 1 , w 2 , . . . , w n n integer values v 1 , v 2 , . . . , v n an integer weight capacity W an integer goal g PROBLEM: Is there I ⊆ { 1 , 2 , · · · , n } such that i I w i W and i I v i g ? Problems with constrained resources. n jobs with w i representing the bandwidth requirement of the i -th job, W representing the total bandwidth available. A simpler version, 0 / 1 SUBSET problem : v i = w i for all i and W = g . INPUT: n numbers a 1 , a 2 , · · · , a n , a target number B ; PROBLEM: Is there I ⊆ { 1 , 2 , · · · , n } such that i a i = B ?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Reduction from 3-CNFSAT to SUBSETSUM F be a 3-CNFSAT Boolean formula: m clauses C 1 , · · · , C m and n variables X 1 , · · · , X n . Construct 2 m + 2 n + 1 numbers with 2 m + n bits each: Variable-numbers XP ( i ) , XN ( i ) for 1 i n . Clause-numbers C ( j, 1) , C ( j, 2) for 1 j m .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

subsum - The SUBSETSUM problem Consider the following...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online