14
Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Embed Size (px)

Citation preview

Page 1: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Dynamic Programming

Part 1: intro and the assembly-line scheduling problem

Page 2: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

What is dynamic programming

• Is an algorithm method that solves a problem by combining solutions of subproblems

• This sounds similar to divide-and-conquer• However, there’s a difference between the two:

– In divide-and-conquer, the subproblems don’t overlap– In dynamic programming, the subproblems overlap

• Subproblems share sub-subproblems!

Page 3: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Dynamic programming may be good for these problems

• Dynamic programming is typically applied to optimization problems

• These optimization problems may have many possible solutions

• Each solution has a value associated with it• We want a solution with the optimal (min or max)

value– We say “a solution,” not “the solution,” because there

may be more than 1 solution with the same, best value

Page 4: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Sequence in the development of a dynamic programming algorithm

1. Characterize the structure of an optimal solution

2. Recursively define the value of an optimal solution

3. Compute the value of an optimal solution in a bottom-up fashion (smaller subproblems first)

4. Construct an optimal solution from computed information

• Step 4 omitted if only the value of the best solutions is required

Page 5: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Assembly line scheduling

• 2 assembly lines at an auto assembly plant

• Normally they operate independently and concurrently

• But when there is a rush job the manager halts the assembly lines and use stations in both assembly lines in an optimal way, to be explained next

Page 6: Dynamic Programming Part 1: intro and the assembly-line scheduling problem
Page 7: Dynamic Programming Part 1: intro and the assembly-line scheduling problem
Page 8: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Step 1: structure of fastest way: What’s the fastest way through station S(1,j)?

• First suppose the fastest way through station S(1,j) is though S(1,j-1)

• Key observation: the chassis must have taken a fastest way from the starting point through station S(1,j-1)

• Why? If there had been a faster way to get through station S(1,j-1), we could have substituted this faster way to yield a faster way through station S(1,j): a contradiction

Page 9: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Dynamic optimality or Optimal substructure property

An optimal solution to a problem (finding the fastest way through station S(i,j) contians within it an optimal solution to subproblems (finding the fastest way through either S(1,j-1) or s(2,j-1)).

Page 10: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Step 2: a recursive solutionLet fi[j] = fastest possible time to get a chassis from the starting point through station S(i,j)

Ultimate goal: compute fastest time to get a chassis all the way through the factory

Denote this time by f*

We have…

)][,][min(* 2211 xnfxnff

Page 11: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Equations for the first stations on each assembly line

1,222

1,111

][

][

aenf

aenf

Page 12: Dynamic Programming Part 1: intro and the assembly-line scheduling problem
Page 13: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Step 3: computing the fastest times

Page 14: Dynamic Programming Part 1: intro and the assembly-line scheduling problem

Step 4: constructing the fastest way