4 ms·
Your previous comment: dynamic programming will keep around previous subproblem solutions Your comment here: Dynamic programming does not mean saving the resul
by CyberDildonics 3y ago
Your previous comment: dynamic programming will keep around previous subproblem solutions
Your comment here: Dynamic programming does not mean saving the results of computations
indiscriminately storing the results of computations
This is not something that happens. No is out there storing a bunch of stuff they don't need on purpose, running out of memory, then calling it a day. That's like saying "some people walk straight into walls, but in dynamic walking we go around walls!".
it is about saving the _minimal_ number of results, without having to recompute already solved subproblems later on.
Again, this is just what programming is some times. You save results instead of recomputing stuff.
- 317070 3y ago> No is out there storing a bunch of stuff they don't need on purpose, running out of memory, then calling it a day. There are a lot of people (such as my students) that would take a DP problem, solve with recursion, throw some caching [0] in and call it a day. They are often surprised by the 1000x speedups using a DP algorithm instead, no caching needed. [0] https://docs.python.org/3/library/functools.html#functools.cache https://docs.python.org/3/library/functools.html#functools.c... > Again, this is just what programming is some times. You save results instead of recomputing stuff. I'm sorry, but I still don't get the argument you are making. That DP is part of programming? Well, yes?
- CyberDildonics 3y agoThat DP is part of programming? Dynamic programming was a made up nonsense term from the 50s to be opaque and vague so they wouldn't be bothered. It doesn't mean anything, but people try to make up some backwards rationalization. Computing a factorial by recursively computing all the other previous factorials if you have any of them already done is an insane way to work. Doing something straightforward and sane like saving some results is like walking on broken glass then calling putting something over your feet "shoe walking". There is no special fancy label for doing the simple sane version of something.