4
$\begingroup$

I was reading about dynamic programming and I understood that we should not be using dynamic programming approach if the optimal solution of a problem does not contain the optimal solution of the subproblem.

The Longest path problem is very clear example on this and I understood why.

But I am not able to find out any other problem which is similar to longest path problem, where the subproblems's solution cannot be used for solving the optimal solution of parent. Can some one guide me?

asked Oct 12, 2015 at 18:22
$\endgroup$
3
  • 3
    $\begingroup$ You shouldn't use dynamic programming if it doesn't work. Here are a few examples: linear programming, linear equations, maximum matching, maximum flow. $\endgroup$ Commented Oct 12, 2015 at 18:32
  • $\begingroup$ @YuvalFilmus thanks. what i really wanted was an example in which the subproblem fails, i will try too solve the examples you gave through dynamic programming and see if it fails (if i am able to split the above problems into subproblems) $\endgroup$ Commented Oct 13, 2015 at 0:00
  • $\begingroup$ Is longest path an instance where you can or cannot use DP? $\endgroup$ Commented Sep 1, 2021 at 20:44

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.