1 / 4

Dealing with “intractability” (con’t) (PS98, chapt. 16-18)

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.

gray-rhodes
Download Presentation

Dealing with “intractability” (con’t) (PS98, chapt. 16-18)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dealing with “intractability” (con’t) (PS98, chapt. 16-18) • PARTITION is NP-complete: Given integers c1,c2,…,cnis there a subset S such that ΣS ci = ½Σci ? Known to beNP-complete. Here’s an algorithm: Let K= ½Σci . Make an array 1…K. Mark location c1. Then location c2, c1+c2. … Then ciand x+ci 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(n2). Total complexity is O(K+n2), 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

More Related