Top "Dynamic-programming" questions

Dynamic programming is an algorithmic technique for efficiently solving problems with a recursive structure containing many overlapping subproblems.

How to compute optimal paths for traveling salesman bitonic tour?

UPDATED After more reading, the solution can be given with the following recurrence relation: (a) When i = 1 and j = 2, l(…

algorithm graph dynamic-programming
Printing Items that are in sack in knapsack

Suppose you are a thief and you invaded a house. Inside you found the following items: A vase that weights 3 …

algorithm dynamic-programming knapsack-problem
What is the difference between dynamic programming and branch and bound?

I only know that by branch and bound, one can REDUCE the procedure to obtain a solution, but that only …

dynamic-programming branch-and-bound
Finding longest common subsequence in O(NlogN) time

Is there any way of finding the longest common subsequence of two sequences in O(NlogN) time? I read somewhere …

algorithm dynamic-programming lcs
Can someone please explain optimal substructure in dynamic programing?

I have been trying to understand Dynamic Programming, and what i understood is that there are two parts of DP. 1. …

algorithm data-structures dynamic-programming
Coin change DP solution to keep track of coins

Trying to program a DP solution for the general coin-change problem that also keeps track of which coins are used. …

java algorithm dynamic-programming coin-change
Q-learning vs dynamic programming

Is the classic Q-learning algorithm, using lookup table (instead of function approximation), equivalent to dynamic programming?

machine-learning dynamic-programming reinforcement-learning q-learning
How to find which elements are in the bag, using Knapsack Algorithm [and not only the bag's value]?

Here I have code which calculates the optimal value using the knapsack algorithm (bin packing NP-hard problem): int Knapsack::knapsack(…

c++ algorithm dynamic-programming knapsack-problem
Distinct Subsequences DP explanation

From LeetCode Given a string S and a string T, count the number of distinct subsequences of T in S. …

algorithm dynamic-programming