Skip to main content

Questions tagged [dynamic-programming]

Questions about problems that can be solved by combining recursively obtained solutions of subproblems.

2 votes
1 answer
227 views

Consider an instance of the knapsack problem: there are some $n$ items, each with a value and a cost. We should choose a subset of items with total cost at most $C$, and subject to that, with a ...
Erel Segal-Halevi's user avatar
1 vote
2 answers
94 views

I would like to understand the structure of sequences whose consecutive XOR values increase strictly. The problem is as follows. Let integers $(l,r)$ be given with $1\le l\le r$. Consider all finite ...
Al Kaoser.'s user avatar
0 votes
1 answer
136 views

To compute the $n$th Fibonacci number, a recursive algorithm is as follows: ...
Rma's user avatar
  • 167
1 vote
1 answer
136 views

Consider the following problem: Let $G=(V, E)$ be a weighted undirected graph with nonnegative weights. Let $S_1, S_2, \ldots, S_k\subseteq V$ be disjoint subsets representing vertices where you can ...
A R's user avatar
  • 63
0 votes
0 answers
173 views

this is the problem statement (3-Partition Problem): Partition a set of integers into three subsets with equal sums. Input: a sequence of integers $v_1, v_2, ..., v_n$ Output: check if it is possible ...
DanxAG's user avatar
  • 1
1 vote
0 answers
81 views

Suppose we have a hitting set instance $(U, F)$ where $U$ is the universal set and $F$ is the family of subsets of $U$. $F$ has $k$ many sets $=\{f_1, f_2,...,f_k\}$ and $U$ has n many elements. Using ...
Diya Roy's user avatar
1 vote
0 answers
39 views

Given a simple unlabeled graph $G = (V,E)$ with vertices $V=\{1,\ldots,n\}$, let $L(G)$ a labeled graph obtained by labeling (with distinct labels) the vertices of $G$ through any $l: V \rightarrow V$ ...
Fabius Wiesner's user avatar
2 votes
1 answer
240 views

In dynamic programming, why does Levenshtein Distance algorithm take into account DP[i - 1][j - 1] when computing the minimum, but Longest Common Subsequence doesn'...
FlatAssembler's user avatar
2 votes
1 answer
320 views

I am given a directed acyclic graph and I want to find all paths from a starting node to an ending node such that all child nodes are connected to previous ancestors. I'm not even totally sure how to ...
AlphaCloud's user avatar
0 votes
0 answers
29 views

Find min edit distance given source and target string and costs to insert, del, subsitute, and transpose 2 adjacen character) reference: https://en.wikipedia.org/wiki/Damerau%E2%80%...
christain's user avatar
2 votes
0 answers
57 views

In the knapsack problem, we consider numbers ∈ Z+ which gives us a run time of $O(nW)$. To my understanding, this is pseudo-polynomial and the worse case runtime is $O(n*2^{log(w)})$ My question is, ...
user491234's user avatar
1 vote
0 answers
57 views

I have the following problem: Suppose I have n items and there is an exchange ratio for the items, $K_{ij}$ tells me how many items of type $j$ I will receive for $1$ unit of item $i$. Question: Is ...
Michal Dvořák's user avatar
0 votes
1 answer
115 views

I've recently begun studying about the dynamic programming paradigm, and came up across two variations of the coin change problem as described below: Given a set of coin values $C = \{c_1,c_2, ...\}$, ...
Cross's user avatar
  • 103
0 votes
0 answers
99 views

So there is this question : we are given a tree with n nodes. For each node, $i$ we are assigned two values : a $r_i$, that is the right boundary, and a $l_i$, which is the left boundary. We should ...
itspaspas's user avatar
0 votes
1 answer
131 views

I ran into a problem while solving this question and I am not sure about the approach of how to find the most efficient approach and time complexity for finding this optimal subsequence for this ...
Tung Son's user avatar

15 30 50 per page
1
2 3 4 5
66