NP-Overrated

Aug 14, 2026 03:14 AM - 3 hours ago 1

If you learned astir NP-hard problems successful university, your takeaway was astir apt this:

NP-hard problems are solvable successful mentation but it's hopelessly costly successful practice. It's basically proven that nary bully algorithms exist.

At slightest that's what I took away. And almost everyone I've talked to. And galore group online. I support seeing "No you can't do it. It's NP-hard. Blah blah" discussions. The story is pervasive but these problems are not intractable.

At the time, my professor closed the last speech pinch melodramatic words (I'm paraphrasing slightly):

And now you've learned that almost each absorbing problems are undecidable and of the remaining ones, almost each are NP-hard. For the task of machine science, that puts the last nail successful the coffin.

Sheesh. Not judge if everyone sewage specified a dire framing but that would explain.

The mentation is not wrong, but successful believe it's often irrelevant. Sure, immoderate algorithm you tin travel up pinch will rustle up connected immoderate inputs. But you mightiness get a accelerated solution connected 99.9% of inputs. Or 100% of the remotely applicable inputs. The mentation does not norm that out.

In theory, location is nary quality betwixt mentation and practice. But successful practice, location is.

-- Benjamin Brewster

A fewer salient NP-hard problems:

  1. Dependency solution (in package managers)
  2. Type checking (not each type systems)
  3. Scheduling
  4. Traveling Salesman
  5. Boolean Satisfiability (SAT)

For (1) and (2), the worst-case conscionable doesn't occur. I mean, installing packages and type checking tin surely beryllium slow. But, astatine slightest successful my career, I've ne'er seen a galactic blow-up.

(3) and (4) are technically optimization problems. Everyone knows you tin tackle those pinch heuristics, but you don't person to sacrifice optimality. We absolutely have tools that tin find provably optimal solutions successful reasonable time. There's nary magic. No quantum computers. Just reasoning harder and coming up pinch amended algorithms. And that's what group person done. In fact, algorithmic speedup has outpaced hardware gains successful the past decades. Taken together, this paper cites a 450-billion-fold speedup betwixt 1991 and 2015.

Last but not least: moreover (5), the archetype of NP-hard problems, is routinely solved astatine scale. Amazon is solving a cardinal SMT problems a day. SMT is an moreover harder type of SAT. The SAT algorithms person gotten truthful good, it's now considered the easy part.

But what if you tally into the worst-case? You don't person to hold for the heat-death of the universe. An HTTP petition besides doesn't travel backmost sometimes. Add a timeout, show an correction message, ... you cognize the drill.

More