1 / 12

Lecture 35

Lecture 35. CSE 331 Nov 28, 2016. Quiz 2 next Monday. Comments on Feedback. Official Feedback forms. CS Ed week (Dec 5). We need volunteers!. We need demos!. When to use Dynamic Programming. There are polynomially many sub-problems. OPT(1) , …, OPT(n). Richard Bellman.

tommie
Download Presentation

Lecture 35

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 35 CSE 331 Nov 28, 2016

  2. Quiz 2 next Monday

  3. Comments on Feedback

  4. Official Feedback forms

  5. CS Ed week (Dec 5) We need volunteers! We need demos!

  6. When to use Dynamic Programming There are polynomially many sub-problems OPT(1), …, OPT(n) Richard Bellman Optimal solution can be computed from solutions to sub-problems OPT(j) = max {vj + OPT( p(j) ), OPT(j-1)} There is an ordering among sub-problem that allows for iterative solution OPT (j) only depends on OPT(j-1), …, OPT(1)

  7. Scheduling to min idle cycles n jobs, ith job takes wi cycles You have W cycles on the cloud What is the maximum number of jobs you can schedule?

  8. Subset sum problem n integers w1, w2, …, wn Input: bound W Output: • subset S of [n] such that • sum of wi for all i in S is at most W • w(S) is maximized

  9. Recursive formula OPT(j, W’) = max value out of w1,..,wj with bound W’ If wj > W’ OPT(j, W’) = OPT(j-1, W’) else OPT(j, W’) = max { OPT(j-1, W’), wj+ OPT(j-1,W’-wj) }

  10. Today’s agenda Dynamic Program for Subset Sum problem

  11. Shortest Path Problem Input: (Directed) Graph G=(V,E) and for every edge e has a cost ce (can be <0) t in V Output: Shortest path from every s to t Assume that G has no negative cycle 1 1 t s Shortest path has cost negative infinity 899 100 -1000

  12. May the Bellman force be with you

More Related