dynamic programming

dynamic programming - Dynamic Programming Dynamic...

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

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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
: 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

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

View Full Document
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
Surface Generation in Tomography

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

View Full Document
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
: 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

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

View Full Document
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)

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

View Full Document
: Is there a more efficient method of Q: Is there a more efficient method of enumeration?
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
Ask a homework question - tutors are online