I’ve always wondered how bad could an exponential-time algorithm be? Why are polynomial-time algorithms usually considered tractable compared to exponential- and factorial-time ones? I was recently reviewing Introduction to Algorithms when I came across the only problem in Chapter 1. It asks for the largest size of a problem that can be solved in unit time by an algorithm that takes microseconds to run, where a unit of time could be a second, a minute, and so on. Here are the numbers I got:
|1 second||1 minute||1 hour||1 day||1 month|
|1 year||1 century|
A picture is worth a thousand words! It’s always useful seeing the numbers than hearing stories about how slow an exponential-time algorithm could be.
This also illustrates how interesting NP-complete problems are. The fact that these seemingly simple problems are exponentially hard and that finding an efficient solution to one of them gives a solution to them all, makes them the most exciting riddles in the history of computer science. What’s more exciting is that while many researchers believe no efficient solution exists for this class of problems, no one has ever been able to prove it! This also reveals why P vs. NP was chosen to be the first of Clay Institue’s seven problems of the millennium.