Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 21 CSE 331 Oct 20, 2009. Announcements Graded mid-term exams at the END of the lecture Sign up for blog posts/group scribe leader No more than.

Similar presentations


Presentation on theme: "Lecture 21 CSE 331 Oct 20, 2009. Announcements Graded mid-term exams at the END of the lecture Sign up for blog posts/group scribe leader No more than."— Presentation transcript:

1 Lecture 21 CSE 331 Oct 20, 2009

2 Announcements Graded mid-term exams at the END of the lecture Sign up for blog posts/group scribe leader No more than 3 volunteers/lecture

3 Some serious stuff 7 students’ HW 5 were very similar to some other students Yes, we do look for similarities in the submitted HWs Collaboration is only allowed to the extent of discussing ideas Your submission must be in your OWN words You can only use outside sources for better understanding Copying solutions from other sources is most definitely NOT OK

4 Read the HW policy document LAST WARNING: Not following the policies will be considered as cheating

5 Questions?

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

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

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

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

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

11 Greedily solve your blues! MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term paper Arrange tasks in some order and iteratively pick non- overlapping tasks

12 Ordering is crucial MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term paper Order by starting time Algo =1

13 Another attempt MondayTuesdayWednesdayThursdayFriday Order by duration Algo =1 Ordering by least conflicts doesn’t work

14 The final algorithm MondayTuesdayWednesdayThursdayFriday Project 331 HW Exam study Party! Write up a term paper Order tasks by their END time

15 Questions?

16 Today’s agenda Prove the correctness of the algorithm

17 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 21 CSE 331 Oct 20, 2009. Announcements Graded mid-term exams at the END of the lecture Sign up for blog posts/group scribe leader No more than."

Similar presentations


Ads by Google