Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6721725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:21:47+00:00 2026-05-26T09:21:47+00:00

If dynamic programming is used to obtain some optimum solution for a problem. How

  • 0

If dynamic programming is used to obtain some optimum solution for a problem. How do you reconstruct the actual steps that lead to that solution?

For example, in the 0-1 knapsack problem you use the recurrence

      enter image description here

Using this we can get the maximum value that can be present in the knapsack. How do you find the actual items present.

Can this be generalized for any dynamic programming solution. For eg. To find the actual nos that are part of the longest increasing subsequence whose solution has been obtained using dynamic programming.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:21:48+00:00Added an answer on May 26, 2026 at 9:21 am

    Can this be generalized for any dynamic programming solution.

    No, you can’t in general find the actual solution by inspecting the final values in the DP-table.

    If the algorithm simply looks for some optimum value, it will typically discard information regarding how each value was computed.

    In a DP-solution the cell on row R could for instance depend on the maximum value in row R-1. Unless the algorithm records which cell was chosen, it will not be possible to reconstruct the actual solution based on the resulting table.

    You should however always be able to attach additional information to each cell describing where the value comes from, for instance by references to previously computed cells which the current cell depends upon, and use this information to reconstruct the actual solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that solves the weighted interval scheduling problem using dynamic programming
I was running some dynamic programming code (trying to brute-force disprove the Collatz conjecture
I'm reviewing some old notes from my algorithms course and the dynamic programming problems
In an ACM example, I had to build a big table for dynamic programming.
I am trying to do some dynamic programming based on the number of characters
this is another algorithms problem related to dynamic programming Here is the problem :
Can anyone help me find an optimal Dynamic programming algorithm for this problem On
I am trying to solve one of the classic dynamic programming problems. The problem
I am trying to solve this problem from SPOJ, it's a dynamic programming problem,
I wonder if the objective function of a general dynamic programming problem can always

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.