11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

546 Chap. 17 Limits to Comput<strong>at</strong>ionTOHExponential time problemsNP problemsNP−complete problemsTRAVELING SALESMANP problemsSORTINGFigure 17.5 Our knowledge regarding the world of problems requiring exponentialtime or less. Some of these problems are solvable in polynomial time by anon-deterministic computer. Of these, some are known to be N P-complete, <strong>and</strong>some are known to be solvable in polynomial time on a regular computer.lem th<strong>at</strong> is N P-complete, then a polynomial solution can be found for all suchproblems. The implic<strong>at</strong>ion is th<strong>at</strong>,1. Because no one has yet found such a solution, it must be difficult or impossibleto do; <strong>and</strong>2. Effort to find a polynomial time solution for one N P-complete problem canbe considered to have been expended for all N P-complete problems.How is N P-completeness of practical significance for typical programmers?Well, if your boss dem<strong>and</strong>s th<strong>at</strong> you provide a fast algorithm to solve a problem,she will not be happy if you come back saying th<strong>at</strong> the best you could do wasan exponential time algorithm. But, if you can prove th<strong>at</strong> the problem is N P-complete, while she still won’t be happy, <strong>at</strong> least she should not be mad <strong>at</strong> you! Byshowing th<strong>at</strong> her problem is N P-complete, you are in effect saying th<strong>at</strong> the mostbrilliant computer scientists for the last 50 years have been trying <strong>and</strong> failing to finda polynomial time algorithm for her problem.Problems th<strong>at</strong> are solvable in polynomial time on a regular computer are saidto be in class P. Clearly, all problems in P are solvable in polynomial time ona non-deterministic computer simply by neglecting to use the non-deterministiccapability. Some problems in N P are N P-complete. We can consider all problemssolvable in exponential time or better as an even bigger class of problems becauseall problems solvable in polynomial time are solvable in exponential time. Thus, wecan view the world of exponential-time-or-better problems in terms of Figure 17.5.The most important unanswered question in theoretical computer science iswhether P = N P. If they are equal, then there is a polynomial time algorithm

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!