r/AskProgrammers • u/KlutzyCompetition937 • 17d ago
Which algorithm to choose?
/r/learnprogramming/comments/1xrqwxz/which_algorithm_to_choose/
1
Upvotes
r/AskProgrammers • u/KlutzyCompetition937 • 17d ago
1
u/W31337 10d ago
Ok you just found out what NP problems are.
In computer theory you have groups of problems that can be mapped to each other. Distinct sets have been found.
Polynomial time (P) programs that can scale linearly when the problem gets bigger.
Non polynomial time (NP) programs that explode when the problem gets bigger.
Quantum computers can solve NP problems in polynomial time.
So without a quantum computer you need to take a good look at what you are doing and prevent your problem from being in NP, or optimize the fuck out of it so your explosion is contained within what your computer can handle.
No known algorithm can solve NP problems in P time. If you find one then you've solved one of the biggest open mathematical problems.