dynamic programming

dynamic programming - Dynamic Programming Dynamic...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
ynamic Programming Dynamic Programming Example - multi-stage graph 2 4 6 3 6 9 9 7 2 2 5 4 4 1 71 0 1 2 3 7 3 2 urce sink 4 81 1 2 11 8 1 5 6 5 source Data Structures &Algorithms II 5
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
labeled directed graph A labeled, directed graph Vertices can be partitioned into k disjoint sets   uv E u V v V i k VV ii k ,, || | | 1 1 1 1 (source) (sink) Find the min cost path from source to sink Data Structures &Algorithms II
Background image of page 2
Q: Will divide-and-conquer find the minimum cost path? A: Probably not best left-half path t ll th best overall path Data Structures &Algorithms II best right-half path
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
est paths found independently may not Best paths found independently may not form a path est overall paths may be suboptimal at Best overall paths may be suboptimal at different subproblem stages Divide-and-Conquer requires subproblems to be independent! Data Structures &Algorithms II
Background image of page 4
Q: Will the greedy method finds the minimum cost path? A: May not (if you are not Dijkstra) Choose the shortest link first Solve the problem stage-by-stage Cost may be very low minimum cost at stage 1 Data Structures &Algorithms II Cost may be very high
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
A low cost edge may be followed by paths of a very high cost A high cost edge may be followed by paths of a very low cost ased on local information (one stage at a Based on local information (one stage at a time) it might not be possible to “look- ead” ahead Picking the remaining lowest cost edge may ot generate a path not generate a path Data Structures &Algorithms II
Background image of page 6
: Is there an application? Q: Is there an application? A: Yes, e.g., resource allocation n units of resources to be allocated to r projects N(i,j) profit earned if j units of resources are allocated to project i goal is to maximize the profit earned Data Structures &Algorithms II
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
V(project being considered, resources committed) V(2,0) V(3,0) N(2,0) 3 projects 3 PCs N(1,0) V(2,1) V(3,1) N(2,1) N(1,1) V(1,0) V(4,3) N(2,2) N(1,2) V(2,2) V(3,2) (2 3) N(1,3) V(2,3) V(3,3) N(2,3) Data Structures &Algorithms II
Background image of page 8
Surface Generation in Tomography
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
p1 p2 m by n lattice Vertical edge: an upright triangle Horizontal edge: an inverted triangle Closed surfaces correspond to paths of length m+n Best path (surface) has the lowest cost
Background image of page 10
: What should we do? Q: What should we do? A: Enumerate all possibilities Q: How much is the cost of enumeration? A: High, for complete connection between two adjacent stages n stages m vertices per stages Om n () Data Structures &Algorithms II
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
S D 1 3 5 2 4 6 SD 135 S D 1 3 6 145 146 235 236 A lot of repetitions: build tables to remember artial solutions 245 246 partial solutions (reuse) 136 A lot of alternatives: build tables to remember ptimal partial solutions optimal partial solutions (principle of optimality)
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
: Is there a more efficient method of Q: Is there a more efficient method of enumeration?
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2012 for the course ENGR 361 taught by Professor Drexel during the Spring '12 term at Bloomsburg.

Page1 / 90

dynamic programming - Dynamic Programming Dynamic...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online