general_suggestion

general_suggestion - 4 When you are writing the recurrence...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
General suggestions to solve dynamic programming (DP) problem: 1. Modify the known solution to solve your new problem. For example, we can make use the solution of 0-1 knapsack problem to solve the minimum number of coins problem. (Example: Question 2b in tutorial 8) 2. Usually, we can write down your global optimal (goal) solution first. Then, try to generalize it into a general form, which cover all possible cases. For example, in our matrix chain multipication problem, we write the goal optimal as M [1 , N ], then generalize it to M [ i, j ]. (Example: Question 2a/b in tutorial 8) 3. Derive the boundary conditions (Example: Question 2a/b in tutorial 8 OR lecture sketches)
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4. When you are writing the recurrence, you may find it is difficult to fill it some parameters. Recall that you are often able to consider all possible cases on some parameters by brute force. (Example: Question 2a in tutorial 8) 5. Doing the running time analysis is simple. In general, you just need to consider how many time is spent on each entry. Then you count how many entries you have been filled. Multiplying them together gives you the total running time. (Example: Question 2a in tutorial 8) c ± 2006 Chung Kai Lun Peter. Comments are welcomed. Email: [email protected] 1...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern