Many of the most useful problems in computing are NP-hard: as the input grows, every known method for finding the exact best answer blows up to astronomical running times. Routing fleets, placing cell towers, scheduling factories — the optimal solution is in there somewhere, but we cannot afford to wait centuries to find it.
So we change the question. Instead of "give me the perfect answer," we ask "give me an answer that is good, fast, and — crucially — that comes with a promise."
An approximation algorithm is a fast algorithm that returns a solution together with a proven guarantee about how far it can be from optimal. A "2-approximation", for example, never returns a result more than twice as costly as the very best possible — and it does so in a blink. You give up the last sliver of quality and, in exchange, you get speed plus a guarantee you can take to the bank.
Comments
Loading comments...