Image

Dynamic programming (DP)

Linux Operating System and Programming Languages. C, C++, Python
User avatar
Shahram
Posts: 276
Joined: Sun Feb 05, 2017 8:31 am

Dynamic programming (DP)

Postby Shahram » Mon Jan 29, 2018 3:18 pm

In computer science, mathematics, management science, economics and bioinformatics, dynamic programming (also known as dynamic optimization) is a method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions. The next time the same subproblem occurs, instead of recomputing its solution, one simply looks up the previously computed solution, thereby saving computation time at the expense of a (hopefully) modest expenditure in storage space. (Each of the subproblem solutions is indexed in some way, typically based on the values of its input parameters, so as to facilitate its lookup.) The technique of storing solutions to subproblems instead of recomputing them is called "memoization".

Dynamic programming algorithms are often used for optimization. A dynamic programming algorithm will examine the previously solved subproblems and will combine their solutions to give the best solution for the given problem. In comparison, a greedy algorithm treats the solution as some sequence of steps and picks the locally optimal choice at each step. Using a greedy algorithm does not always guarantee an optimal solution ,when a dynamic programming algorithm does, because picking locally optimal choices may result in a bad global solution. One advantage of a greedy algorithm over a dynamic programming algorithm is that the greedy algorithm is often faster and simpler to calculate. Some greedy algorithms (such as Kruskal's or Prim's for minimum spanning trees) are known to lead to the optimal solution.


https://en.wikipedia.org/wiki/Dynamic_programming



User avatar
Shahram
Posts: 276
Joined: Sun Feb 05, 2017 8:31 am

Re: Dynamic programming (DP)

Postby Shahram » Mon Jan 29, 2018 3:20 pm

"Introduction to Algorithms" MIT open course
There are few lectures on dynamic programming.

https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/
Image




Return to “Programming and Linux”

Who is online

Users browsing this forum: No registered users and 1 guest