Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dealing with “intractability” (con’t) (PS98, chapt. 16-18) PARTITION is NP-complete: Given integers c 1,c 2,…,c n is there a subset S such that Σ S c i.

Similar presentations


Presentation on theme: "Dealing with “intractability” (con’t) (PS98, chapt. 16-18) PARTITION is NP-complete: Given integers c 1,c 2,…,c n is there a subset S such that Σ S c i."— Presentation transcript:

1 Dealing with “intractability” (con’t) (PS98, chapt. 16-18) PARTITION is NP-complete: Given integers c 1,c 2,…,c n is there a subset S such that Σ S c i = ½ Σ c i ? Known to be NP-complete. Here’s an algorithm: Let K= ½ Σ c i. Make an array 1…K. Mark location c 1. Then location c 2, c 1 +c 2. … Then c i and x+c i for all previously marked locations x, all i. If K gets marked, YES, else NO.

2 Proof: induction, assume all possible sums are marked for i-1. Then true for i. Complexity: Initialize: K. Then triangular sum = O(n 2 ). Total complexity is O(K+n 2 ), assuming constant-time for access. Appears to be polynomial…? But PARTITION is NP-complete! Explain. This can be a practical approach to some NP- complete problems---if the numbers involved are not too big.

3 Other approaches to “intractable” problems Branch-and-bound Ad-hoc approximation algorithms; sometimes quality is provable Dynamic programming “New-age” algorithms: simulated annealing, genetic algorithms, neural networks, etc.

4 Branch-and-Bound Reingold, Nievergelt, Deo 77


Download ppt "Dealing with “intractability” (con’t) (PS98, chapt. 16-18) PARTITION is NP-complete: Given integers c 1,c 2,…,c n is there a subset S such that Σ S c i."

Similar presentations


Ads by Google