4005-800-01: Homework, Quizzes, Reading and Slides
Week 1
- Slides for this week: pdf,
ppt
Slides for Wednesday: pdf,
ppt
-
Monday, Dec 3
- Practice homework: click here
- Covered in class: Course logistics, see the main course website
- Covered in class: Introduction to Algorithms and asymptotic analysis (slides have been updated, read Chapter 1 and Sections 2.1
and 2.2 in the book)
- A note for students with disabilities:
RIT is committed to providing reasonable accommodations to students with disabilities.
If you would like to request accommodations such as special seating, testing modifications,
or note taking services due to a disability, please contact the Disability Services Office.
It is located in the Eastman Building, Room 2342; the Web site is www.rit.edu/dso.
After you receive accommodation approval, it is imperative that you see me during office hours
so that we can work out whatever arrangement is necessary.
Wednesday, Dec 5
- Covered in class: Survey of common running times (Section 2.4)
- Covered in class: Some geometric algorithms: point inside a polygon,
area of a polygon, convex hull (not in the book)
- Covered in class: Mergesort and introduction to recurrences (Section 5.1); all slides have been updated
Homework 1, due 12/14 10:00am: click here
Week 2
- Slides for this week: we will continue with last week's slides; after that
pdf /
ppt and
pdf /
ppt
-
Monday, Dec 10
- Covered in class: Our first recurrence (Section 5.1)
- Covered in class: A lower-bound on comparison-based sorting Omega(n log n) (not in the book)
- Covered in class: HeapSort (Section 2.5); slides have been updated
- Recall: next class, quiz 1 on material covered in week 1. Study asymptotic notation (you should be able to say,
for two given functions f and g, if f=O(g), f=Omega(g) or f=Theta(g)), and the algorithms that were covered in the
first week (you should be able to trace them for a given input).
-
Wednesday, Dec 12
- In class: quiz 1.
- Covered in class: RadixSort (not in the book)
- Covered in class: GrahamScan and a lower bound on convex hull algorithms Omega (n log n) (not in the book)
- Covered in class: Median/Select (the worst-case O(n) is not in the book but the randomized version is in Section 13.5)
- A note from our graders: please name your homework source files exactly as specified in the posted guidelines.
For the practice homeworks, typical mis-namings included source files named "factorial.java" or "Problem2_Smith.java"
where in the second case an upper-case 'P' was used instead of the specified lower-case 'p' (I know that according to
Java standards, class names start with upper-case letters - please make an exception in this course).
Finally, if you are working in a pair: suppose that your and your partner's names are Smith and Apple and you submit
a problem with the name "problem2_SmithApple.java". Then, for all your future submissions, please continue using the name
combination "SmithApple" (i.e. do not switch it to "AppleSmith") - this will help us with recognizing your submissions and
grading them properly.
- Recall that there is no class on Wednesday, Dec 19. Also, I will not be able to hold office hours on Dec 18 and Dec 20 (I will
hold office hours on Dec 17). Please use the tutoring center for getting help and/or send me an e-mail with your questions
(I should be able to reply to your e-mails within 24 hours, more frequently on Thursday Dec 20,
less frequently over the winter break).
- Homework 2, due 12/21 10:00am: click here
- Project is now posted.
Week 3
- Slides for this week: we will continue with last week's slides, after that
pdf /
ppt
-
Monday, Dec 17
- Covered in class: solutions of hw1
- Covered in class: analysis of the Select algorithm (not in the book)
- Covered in class: Huffman Coding (Section 4.8)
- Recall that there is no class on Wednesday, Dec 19, and no office hours on Dec 18 and Dec 20.
- Have a nice winter break.
- Homework 3, due 1/11 10:00am: click here
Week 4
- Slides for this week:
pdf /
ppt
-
Monday, Jan 7
- Covered in class: solutions of hw2
- Covered in class: proof of correctness of the Huffman Algorithm (Section 4.8)
- Covered in class: Knapsack, divisible version and an introduction to the indivisible version (Section 6.4)
- Recall: next class quiz 2, on material from week 3 (Select, Huffman) and Homework 2.
-
Wednesday, Jan 9
- In class: quiz 2.
- Covered in class: Knapsack, indivisble version (Section 6.4)
- Covered in class: Longest Increasing Subsequence (not in the book)
- Covered in class: introduction to Interval Scheduling (Sections 4.1 and 6.1-2)
- Many of you asked about the test inputs for homework 1. You can find the tests for this homework
(as well as future homeworks) here.
- Homework 4, due 1/18 2:00pm: click here
Week 5
- Slides for this week: pdf,
ppt
-
Monday, Jan 14
- Covered in class: solutions of hw3
- Covered in class: variants of Interval Scheduling (Sections 4.1 and 6.1-2)
- Covered in class: Longest Common Substring/subsequence (not in the book but a similar problem is discussed in Section 6.6)
- Next class: quiz 3 on topics covered in week 4 (Huffman coding, Knapsack, Longest Increasing Subsequence,
the first variant of Interval Scheduling) and in hw3.
- Next week: midterm
-
Wednesday, Jan 16
- In class: quiz 3.
- Covered in class: Longest Common Subsequence/Substring (a similar problem discussed in Section 6.6)
- Covered in class: Matrix Chain Multiplication (not in the book)
- Recall: midterm, next Wednesday. The midterm will take place in room 70-1400 (the big auditorium on the first floor).
- No homework due next week.
Week 6
- Slides for this week: pdf,
ppt
-
Monday, Jan 21
- Covered in class: solutions of hw4.
- Covered in class: midterm review.
- Covered in class: introduction to graph algorithms (Chapter 3)
- Next class: midterm, in room 70-1400, 10:00-11:40am.
-
Wednesday, Jan 23
- Homework 5, due 2/1 2:00pm: click here
Week 7
- Slides for this week: pdf,
ppt
-
Monday, Jan 28
- Covered in class: solutions of the midterm
- Covered in class: basic graph algorithms: BFS, DFS, find connected components, topological sort, find strongly
connected components (Chapter 3)
- Next class: quiz 4, study topics covered in the last two weeks (Variants of Interval Scheduling, Longest Common Substring,
Matrix Chain Multiplication, introduction to graphs, and DFS) and on hw4.
-
Wednesday, Jan 30
- In class: quiz 4.
- Covered in class: Minimum Spanning Trees, Union-Find (Sections 4.5 and 4.6)
- There is no homework due next week - work on the project that is due next Saturday.
Week 8
- Slides for this week: pdf,
ppt
-
Monday, Feb 4
- Covered in class: solutions of hw5
- Covered in class: discussion of the project that is due this Saturday. If you want to submit any extra files,
you are welcome to do so but make sure to name them with "_LastName(s)" appended to the end so that the file name
is unique.
- Covered in class: configuration graphs and BFS (the Sokoban example)
- Covered in class: Prim's algorithm revisited - proof of correctness (Section 4.5)
- Covered in class: Dijkstra's algorithm (Section 4.4)
- Next class: quiz 5 on topics covered in week 7 (BFS, connected components, topological sort, strongly connected components,
and minimum spanning trees) and on hw5 (excluding the bonus problem).
-
Wednesday, Feb 6
- Covered in class: the Floyd-Warshall's algorithm (not in the book)
- Covered in class: the Bellman-Ford's algorithm (Sections 6.8-6.10)
- Covered in class: introduction to Flow Networks (Chapter 7)
- This is the end of week 8 - please keep in mind that the last chance to withdraw from the class is this Friday.
- Homework 6, due 2/15 2:00pm: click here
Week 9
- Slides for this week: pdf,
ppt
-
Monday, Feb 11
- Covered in class: two solutions of the bonus problem from hw5 (we also discussed a third solution but have
not finished its proof - we will get back to it on Wednesday)
- Covered in class: Ford-Fulkerson, Edmonds-Karp algorithms (Chapter 7)
- Next class: quiz 6 on topics covered in week 8 (shortest paths algorithms).
- Date and time of the final review: our final review has been preliminarily scheduled for Monday,
Feb 25, 2-4pm, in room 70-1400. If you cannot make this time, there will be another final review for
the evening section on Monday, Feb 25, 6-8pm in room 70-1445. Please contact me if you have an exam
during both of these times.
-
Wednesday, Feb 13
- In class: quiz 6.
- Covered in class: Ford-Fulkerson revisited (we saw a "bad example" where the algorithm goes
through as many iterations as is the value of a maximum flow)
- Covered in class: Applications of Flow Networks (multiple sources/sinks, finding a minimum cut,
maximum number of edge-disjoint s-t paths, maximum bipartite matching - see Chapter 7 for these and more applications)
- Covered in class: Introduction to polynomial-time reductions and the class P (Chapter 8)
- Final review will take place on Monday, Feb 25, 2-4pm, in room 70-1400.
If you cannot make this time, there will be another final review for
the evening section on Monday, Feb 25, 6-8pm in room 70-1445. Bring your questions
(and we will go over the solutions of Hw7).
- Homework 7, due 2/22 2:00pm: click here
Week 10
- Slides for this week: pdf,
ppt
-
Monday, Feb 18
- Covered in class: solutions of Hw6, except for the bonus problem
- Covered in class: P, NP, NP-complete and some more reductions (Chapter 8)
- Take-home points related to P, NP, NP-complete (and useful things to remember for the final):
- Definition of classes P, NP, and NP-complete.
- Looking at a problem, you should be able to recorgnize basic problems from P (like the decision versions of most of
the problems from class).
- You should be able to sketch the proof that a problem is in NP - state the solution you are looking for (for people
who have gone through the "theory" class, this is your nondeterministic guess), then describe how you verify
(in polynomial time) that the solution is indeed correct.
- You should be able to do reductions of about the same difficulty as the problem on the homework - we will discuss
the solution during the review session on Monday.
- Big open problem: P = NP (we do NOT know if P=NP).
- NP-complete problems are the "hardest" problems in NP.
- If somebody finds a polynomial-time algorithm for an NP-complete problem, then P=NP.
- If somebody shows that there does not exist a polynomial-time algorithm for an NP-complete problem, then P is not equal
to NP.
- If somebody finds an easy polynomial-time algorithm for an NP-complete problem,
then this algorithm probably does not work :)
- You should recognize basic NP-complete problems (discussed in class).
- Next class: quiz 7 on topics covered in week 9 (flow networks and their applications,
introduction to reductions and the class P), and on hw6.
- Office hours during finals week: Monday, Feb 25, 4-5pm and 8-9pm. There will be no office hours on Tuesday but it is possible
that the tutoring center will be open during finals week - please check the
website for latest information.
-
Wednesday, Feb 20
- In class: quiz 7.
- Covered in class: finished NP-completeness (Chapter 8)
- Covered in class: introduction to linear programming (Section 11.6)
- Take-home points related to linear programming
- Linear programming can be solved in polynomial time (quite fast, actually, and many solvers are available for free download).
- We can phrase a lot of problems as integer programs (where we restrict our variables to integer values).
- I hoped we would see that the vertex cover problem can be expressed as an integer program. (If you are interested,
this is described very nicely in the book in Section 11.6 - and the section is quite short!)
Thus, INTEGER PROGRAMMING is NP-hard.
- Sometimes we are lucky and our linear programming solution has integer values and we are ok (like for the matching example).
- Most of the time we are not this lucky but we can always try to round our solution to integer values.
For example, in the case of vertex cover, we would round x smaller than 0.5 to 0 and
x greater than or equal to 0.5 to 1.
- For some of these roundings we can prove that we actually get a meaningfull solution - for example in the case
of vertex cover, the solution we get is not bigger than twice the size of the minimum vertex cover. This is called
a 2-approximation (again, see Section 11.6).
- Final review: Monday, Feb 25, 2-4pm in room 70-1400 (or 6-8pm in room 70-1445). We will go over the solutions of Hw7 and
the bonus problems from Hw6 and Hw7. Other than that, bring your questions. If there are no questions, I might do a quick
introduction to approximation algorithms.
- Office hours and tutoring during the final week: I will hold two office hours on Monday, 4-5pm and 8-9pm. The tutoring center will
be open on Saturday through Wednesday - please the website for specific times.
- Information about the final exam is here.