Dynamic Programming: Solving Assembly-Line Scheduling with Dynamic Programming - Prof. Mic, Study notes of Algorithms and Programming

In this lecture, the instructor introduces the concept of dynamic programming and its application to the assembly-line scheduling problem. The lecture explains how dynamic programming allows building up larger solutions from smaller ones, using a table or recursive algorithm to store and calculate intermediate answers. The document also discusses the difference between solving the problem on a nondeterministic machine and a deterministic machine.

Typology: Study notes

Pre 2010

Uploaded on 08/01/2009

koofers-user-1cd
koofers-user-1cd 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Algorithm Design and Analysis 3/13/2008
Lecture 22: Dynamic Programming
Instructor: Mike Kowalczyk
1 Dynamic Programming
Today we consider the assembly-line scheduling problem from section 15.1 in the textbook.
What happens if we try to solve this with a nondeterministic machine? First, we make this a
decision version of the problem (i.e. can we get better than a certain given cost). We can branch
off into enough machines so that each one is for a different path through the assembly lines. Then
each one checks to see if its permutation is less than the required time cost, and if so, it accepts,
otherwise it rejects. This way the whole machine accepts as long as there is a single assembly-line
path that meets the desired schedule. Think in terms of nwhere nis the number of stations in
the asssembly line. It only takes nsteps to branch into the 2nnondeterministic branches, and then
another Θ(n) steps to figure out if that path is less than the desired time cost. So this problem is
in NP. So we can solve it efficiently on such a make-believe machine.
But what about a real computer (a deterministic machine)? We could brute force all possible
solutions. We have 2ndifferent permutations to consider. Hmmm. . . that’s got to take some time.
But it’s interesting to note that a deterministic machine can simulate any nondeterministic machine;
it just takes a lot of time.
Now let’s use a new algorithm design idea: Dynamic Programming. There is more than just one
way to conceptualize this process, but for now, we will view dynamic programming as: “buildling up
bigger and bigger solutions from the bottom-up, using a table to jot down intermediate answers”.
The bottom line with dynamic programming is to build up larger and larger sub-solutions to the
problem in such a way that you eventually get the whole thing. Although you usually end up using
some kind of table to store the solutions in, it isn’t always the case. In the assembly-line example,
we didn’t need the whole table (only the last column of it), so we built this in as a return call
in a recursive algorithm. In our program, we merged a couple of the nodes together without loss
of generality, because this way the arrays are all of the same size and at the starting point those
choices are compulsary anyway. See the program source code and visual aid.
1

Partial preview of the text

Download Dynamic Programming: Solving Assembly-Line Scheduling with Dynamic Programming - Prof. Mic and more Study notes Algorithms and Programming in PDF only on Docsity!

Algorithm Design and Analysis 3/13/

Lecture 22: Dynamic Programming

Instructor: Mike Kowalczyk

1 Dynamic Programming

Today we consider the assembly-line scheduling problem from section 15.1 in the textbook. What happens if we try to solve this with a nondeterministic machine? First, we make this a decision version of the problem (i.e. can we get better than a certain given cost). We can branch off into enough machines so that each one is for a different path through the assembly lines. Then each one checks to see if its permutation is less than the required time cost, and if so, it accepts, otherwise it rejects. This way the whole machine accepts as long as there is a single assembly-line path that meets the desired schedule. Think in terms of n where n is the number of stations in the asssembly line. It only takes n steps to branch into the 2n^ nondeterministic branches, and then another Θ(n) steps to figure out if that path is less than the desired time cost. So this problem is in NP. So we can solve it efficiently on such a make-believe machine. But what about a real computer (a deterministic machine)? We could brute force all possible solutions. We have 2n^ different permutations to consider. Hmmm... that’s got to take some time. But it’s interesting to note that a deterministic machine can simulate any nondeterministic machine; it just takes a lot of time. Now let’s use a new algorithm design idea: Dynamic Programming. There is more than just one way to conceptualize this process, but for now, we will view dynamic programming as: “buildling up bigger and bigger solutions from the bottom-up, using a table to jot down intermediate answers”. The bottom line with dynamic programming is to build up larger and larger sub-solutions to the problem in such a way that you eventually get the whole thing. Although you usually end up using some kind of table to store the solutions in, it isn’t always the case. In the assembly-line example, we didn’t need the whole table (only the last column of it), so we built this in as a return call in a recursive algorithm. In our program, we merged a couple of the nodes together without loss of generality, because this way the arrays are all of the same size and at the starting point those choices are compulsary anyway. See the program source code and visual aid.