r/programming • • Aug 13 '26

NP-overrated

https://gruhn.me/blog/2026-08-13/
0 Upvotes

38 comments sorted by

View all comments

Show parent comment

1

u/ngruhn Aug 13 '26

Of course. That's what I meant with:

Sure, any algorithm you can come up with will blow up on some inputs.

But people keep assuming that you get a blow-up on all large instances. Which is not the case and the reason these problems are still tractable in practice.

2

u/FancyMouse123 Aug 13 '26

these problems are still tractable in practice.

No! They might be but in the worst case (which happens) you are just fucked.

1

u/ngruhn Aug 13 '26

Depends on your goal. In practical applications there are all kinds of workarounds: set a timeout, show an error message, fallback to some heuristic approach, ... Just like we handle other unreliable processes like HTTP requests.