{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 310 Exam 3 Review - CS 310 Exam 3 Review Furman Haddix...

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

View Full Document Right Arrow Icon
CS 310 Exam 3 Review Furman Haddix Ph.D. Assistant Professor Minnesota State University, Mankato Spring 2008
Background image of page 1

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

View Full Document Right Arrow Icon
Dynamic Programming Objectives What is Dynamic Programming Fibonacci algorithm top-down, bottom- up, memoized Factory Example Matrix Multiplication Example Memoization Example Text, Chapter 15.1-15.3
Background image of page 2
Dynamic Programming Dynamic programming is a methodology rather than an algorithm Like Divide and Conquer, dynamic programming is a means of solving problems efficiently and effective Dynamic Programming is generally concerned with optimization problems Dynamic Programming applications have two characteristics: Overlapping subproblems: subproblem a is used in solving both subproblem b and subproblem c. A recursive solution will contain many instances of the same subproblem. The (optimal) solution contains (optimal) solutions to a subset of subproblems BEWARE the fallacy of suboptimization: Not all problems can be decomposed into subproblems for which optimal subproblem solutions are parts of the optimal problem solution Where applicable, dynamic programming may provide a more efficient solution than divide and conquer because it avoids repetitive subproblem solution
Background image of page 3

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

View Full Document Right Arrow Icon
An Approach to Dynamic Programming 1. Characterize the structure of an optimal solution (Return the n th Fibonacci number) 2. Recursively define the value of an optimal solution (Recursive definition of Fibonacci series) 3. Compute the value of an optimal solution in bottom-up fashion (Convert top-down solution to bottom-up solution) 4. Construct an optimal solution from computed information (Solution of subproblems is solution to problem) Although Fibonacci problem is not seeking an optimal solution it has many of the characteristics of the class of problem for which dynamic programming provides good solutions.
Background image of page 4
Factory Production Line Example Factory has two production lines composed of multiple stations Each station performs the same function Production lines were established at different times with different technologies Over time, some stations have been replaced For each station, the faster production method may be on a different line Because of different technologies employed, production times differ at each station In general, transfer times between stations of the same line are insignificant; however, transfer times between stations of different lines are not insignificant. Also, the entry times and exit times are different for the two production lines because of their physical locations.
Background image of page 5

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

View Full Document Right Arrow Icon
Factory Production Line Example Mathematically, we can represent the production time on a line i, as follows: P i = E i + Σ S ij + X i where E refers to entry time, S is station time, X is exit time, and j is one of n stations On occasion, it may be important to have a production run that is the fastest possible.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}