Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 18 CSE 331 Oct 12, 2011.

Similar presentations


Presentation on theme: "Lecture 18 CSE 331 Oct 12, 2011."— Presentation transcript:

1 Lecture 18 CSE 331 Oct 12, 2011

2 Mid-term related stuff
Solutions will not be handed out Jesse will discuss them in his recitations We will write solution sketches on your graded mid terms

3 Questions?

4 Main Steps in Algorithm Design
Problem Statement Problem Definition n! Algorithm “Implementation” Data Structures Analysis Correctness+Runtime Analysis

5 A tool to define problems
Where do graphs fit in? Problem Statement A tool to define problems Problem Definition Algorithm “Implementation” Data Structures Analysis Correctness+Runtime Analysis

6 Three general techniques
Rest of the course Problem Statement Problem Definition Three general techniques Algorithm “Implementation” Data Structures Analysis Correctness+Runtime Analysis

7 Greedy algorithms Build the final solution piece by piece
Being short sighted on each piece Never undo a decision Know when you see it

8 End of Semester blues Can only do one thing at any day: what is the maximum number of tasks that you can do? Write up a term paper Party! 331 homework Exam study 331 HW Project Monday Tuesday Wednesday Thursday Friday

9 Greedily solve your blues!
Arrange tasks in some order and iteratively pick non-overlapping tasks Write up a term paper Party! Exam study 331 HW Project Monday Tuesday Wednesday Thursday Friday

10 Ordering is crucial Order by starting time Write up a term paper
Algo =1 Party! Exam study 331 HW Project Monday Tuesday Wednesday Thursday Friday

11 Ordering by least conflicts doesn’t work
Another attempt Order by duration Ordering by least conflicts doesn’t work Algo =1 Monday Tuesday Wednesday Thursday Friday

12 Order tasks by their END time
The final algorithm Order tasks by their END time Write up a term paper Party! Exam study 331 HW Project Monday Tuesday Wednesday Thursday Friday

13 Questions?

14 Today’s agenda Prove the correctness of the algorithm

15 Formal Algorithm R: set of requests Set A to be the empty set
While R is not empty Choose i in R with the earliest finish time Add i to A Remove all requests that conflict with i from R Return A


Download ppt "Lecture 18 CSE 331 Oct 12, 2011."

Similar presentations


Ads by Google