HeadlinesBriefing favicon HeadlinesBriefing.com

NP-Hard Problems: Practical Solvability Myths

Hacker News •
×

The common belief that NP-hard problems are hopelessly expensive in practice is a myth. While theory says they can blow up on some inputs, practical algorithms often solve them quickly on 99.9% of cases or all relevant inputs.

Consider dependency resolution and type checking: worst cases rarely occur. Traveling Salesman and Scheduling can be solved optimally with heuristics that find provably optimal solutions in reasonable time. Even Boolean Satisfiability (SAT), the archetype of NP-hardness, is solved at scale daily. Amazon processes a billion SMT problems each day.

Algorithmic improvements have outpaced hardware gains. One study cites a 450-billion-fold speedup between 1991 and 2015. For the occasional worst-case input, adding a timeout and error message suffices, just like handling HTTP request failures.