Dynamic Programming : Concept - algorithm

True or False:
Any problem that can be solved using dynamic programming has a polynomial time worst case time complexity with respect to its input size.
Are there any DP solutions which are not polynomial?
Thank you.

There is a dynamic programming algorithm for the Knapsack problem for which the worst-case complexity is O(Wn) where W is the capacity of the knapsack and n is the number of items. Such a runtime bound is termed as pseudo polynomial (as a value which is encoded in the instance occurs) and cannot be considered as polynomial in the input size. So, short answer: false.
Furthermore, the original question is formulated a bit misleading; the runtime complexity refers to a specific algorithm, not the problem itself.

There are many. The above example is one. Another popular example is dynamic programming solution of Traveling Salesman problem which runs in O(n2^n) time. Note that a brute force solution of Traveling Salesman takes O(n!) time, compared to that a dynamic programming solution is better.

Related

If we can prove that knapsack problem with limited capacity are solved in a polynomial time then all knapsack belongs to P

I found this question in my Optimization Algorithm course, the full question is this:
If we can prove all Knapsack problems with capacity limited to 100 can be solved in polynomial time, then all Knapsack problems belong to P. Is this sentence true or false? Justify.
With my book and some research I came out with something like this:
First of all KP is an NP-complete problem. With Dynamic programming it can reach a pseudopolynomial time, but it's not enough.
If, absurdly, we can prove that KP with capacity limited to 100 can be solved in polynomial time then we can assume that KP belongs to P.
What do you think about my answer? I think the absurd is not so right in the last sentence.
Proving that all knapsack problems with a limited capacity can be solved in polynomial time does not prove that all knapsack problems are in P. If a problem is in P, that means that it can be solved in polynomial time. This means that it can be solved in O(n^k) where k is some integer. Big O is an upper bound, meaning that, if an algorithm is O(n), as n approaches infinity, the time it takes to do the algorithms will never be longer than n. By proving that all problems with n<100 can be solved in polynomial time, this makes no guarantee for much larger n. Therefore we cannot say that there is an algorithm that runs in O(n^k) and is therefore in P.

What is complexity of simplex algorithm for binary integer programming?

What is complexity of simplex algorithm for binary integer programming problem? For worst case or average case?
I'm solving assignment problem.
References:
https://en.wikipedia.org/wiki/Integer_programming
https://en.wikipedia.org/wiki/Simplex_algorithm
Since it's for the assignment problem, that changes matters. In that case, as the wiki page notes, the constraint matrix is totally unimodular, which is exactly what you need to make your problem an instance of normal linear programming as well (that is, you can drop the integrality constraint, and the result will still be integral).
So, it can be solved in polynomial time. The Simplex algorithm doesn't guarantee that however.
Of course there are also other polynomial time algorithms to solve the assignment problem.
In a general sense, binary integer programming is one of Karp's 21 NP-complete problems, so assuming P!=NP it's safe to say that Simplex's worst-case running time is lower-bounded by Ω(poly(n)). Again, in general, similar to SAT solvers, the "average" case is going to be heavily dependent upon what you're taking the average across. Until you've got more specific information about the class of problems you're trying to solve with simplex, I don't think there is a good answer.
I'll do some more thinking and update when I have more information.

in a graph, is O(|E|*|V|) complexity considered polynomial or not?

Sorry for stupid question. I cannot jog my memory and googling did not help me answer this question.
So basically given a graph G(V,E), I know that O(|V|^2) or O(|E|^2 + |V|^2) is considered to be polynomial complexity, so is O(|E|*|V|) polynomial as well? If not, what kind of complexity is it? I believe it's not pseudo-polynomial either.
Another question is: is O(m*n) considered polynomial as well, given m and n are the sizes of two INDEPENDENT inputs to a problem? I just want to clarify the concept of polynomial time in here and want to know if O(m*n) has a different name for its type of complexity.
it is polynomial O(|V|^3) since the number of edges is bounded O(|V|^2)

Can 1 approximation algorithm be used for multiple NP-Hard problems?

Since any NP Hard problem be reduced to any other NP Hard problem by mapping, my question is 1 step forward;
for example every step of that algo : could that also be mapped to the other NP hard?
Thanks in advance
From http://en.wikipedia.org/wiki/Approximation_algorithm we see that
NP-hard problems vary greatly in their approximability; some, such as the bin packing problem, can be approximated within any factor greater than 1 (such a family of approximation algorithms is often called a polynomial time approximation scheme or PTAS). Others are impossible to approximate within any constant, or even polynomial factor unless P = NP, such as the maximum clique problem.
(end quote)
It follows from this that a good approximation in one NP-complete problem is not necessarily a good approximation in another NP-complete problem. In that fortunate world we could use easily-approximated NP-complete problems to find good approximate algorithms for all other NP-complete problems, which is not the case here, as there are hard-to-approximate NP-complete problems.
When proving a problem is NP-Hard, we usually consider the decision version of the problem, whose output is either yes or no. However, when considering approximation algorithms, we consider the optimization version of the problem.
If you use one problem's approximation algorithm to solve another problem by using the reduction in the proof of NP-Hard, the approximation ratio may change. For example, if you have a 2-approximation algorithm for problem A and you use it to solve problem B, then you may get a O(n)-approximation algorithm for problem B, since the reduction does not preserve approximation ratio. Hence, if you want to use an approximation algorithm for one problem to solve another problem, you need to ensure that the reduction will not change approximation ratio too much in order to get a useful algorithm. For example, you can use L-reduction or PTAS reduction.

Is there an algorithm to find the optimal value of k-tsp (traveling salesman) in polynomial time?

I read this article, it suggests (page 1025 last paragraph) that there is a polynomial time algorithm to find the optimum of a k-tsp problem using binary search.
Using binary search would suggest there exists an algorithm for checking if a solution exists with cost<X and this algorithm is used for the binary search.
I 'googled' around for this and the only algorithm i could find was a non deterministic one (which is pretty trivial), but obviously i'm looking for a deterministic one.
I am interested in this for learning purposes,
Any help/links would be appreciated.
EDIT
I am referring to finding the value of the optimal solution and not about finding the solution itself.
Since TSP is a special case of k-TSP where k = number of nodes in the graph. If you had a solution for "what's the cheapest k-TSP route" in polynomial in relation to graph size, then you'd have a polynomial solution to decision problem version of TSP which would imply that P = NP.
So the answer is no. Deterministic polynomial algorithm for both decision problem and optimization version (they're essentially the same) of k-TSP doesn't exist (yet).
The paper you mentioned proposes a polynomial-time approximation algorithm for the directed k-TSP problem.
Approximation algorithms are those which are guaranteed to yield solutions with a limited deviation from the optimal solution value. There are examples of polynomial-time approximation algorithms for NP-Hard problems: the Christofides Algorithm yields, in time O(n³), solutions to the metric TSP problem whose values are at most 3/2 the value of the optimal solution.
David Karger, in a lecture (link)
mentions a randomized algorithm for efficient k-TSP problem which runs in polynomial time in n (but exponential in k). It is based on the idea of color coding: color each of the node with a random color in [1..k], and find a shortest chromatic path (where each color appears exactly once). With a simple dynamic programming algorithm, this approach gives a runtime of O(n^2 2^k) and it succeeds (in finding the path with minimal cost) with probability e^{-k}. By repeating e^k times, one achieves an algorithm that finds the minimum k-TSP with high probability.

Resources