Skip to main content

Questions tagged [dynamic-programming]

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

0 votes
1 answer
115 views

To compute the $n$th Fibonacci number, a recursive algorithm is as follows: ...
Rma's user avatar
  • 163
1 vote
1 answer
129 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
161 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
78 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
32 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
236 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
242 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
28 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
53 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
35 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
106 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
44 views

I’m working on a problem involving dynamic programming in graphs. The sub-path (ABC) has vertex weights and edge lengths, and we are tasked with calculating the optimal cost of a (k)-center. Given (k =...
user21261788's user avatar
0 votes
0 answers
96 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
109 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
1 vote
1 answer
131 views

Let $G=(V,E)$ a directed graph with weight function $w:E \to R$. let $s \in V$ a vertex s.t it has path to any other vertex in $G$. Suppose that every negative vertex in this graph is bridge edge, ...
csmathstudent8's user avatar

15 30 50 per page
1
2 3 4 5
66