CS800: Homework and Reading Assigments
This webpage serves as an outline of the topics covered in each class.
You will also find links to the handouts here.
Announcements
-
The practice final solutions are now available. I did my best to fix
all the typos but I cannot guarantee that the solutions are completely typo-free. If you spot a problem, please send me an e-mail
and I'll notify the whole class of any changes to the practice final solutions.
-
I left your hw7 solutions in your mailfolders (with 2-person teams I chose one person at random - whoever's mailfolder
I could find first). For problem #2 there were quite a few solutions that first found the minimum cut (using the algorithm from class
as a subroutine), then increased the capacities of all edges in the cut by one and checked if the minimum cut changed.
This solution checks if there are two *edge-disjoint* minimal cuts. (As an example, think about a network on three vertices, s,u,t,
with edges (s,u), (s,t) and (u,t). There are two minimum cuts, namely {s} and {s,u} but the above solution thinks there
is only one minimum cut.) I did not subtract points for this but everybody should realize the distinction between the existence of two
minimal cuts and two edge-disjoint minimal cuts.
-
Additional information about the final:
-
Bring your hand-written letter-sized double-paged cheat sheet.
-
Two problems will cover graph algorithms, one problem NP-completeness (you will not be asked
to come up with a reduction on the spot but you should understand the reductions from class and know the NP-complete problems we
discussed in class or on the homeworks), one problem will cover integer/linear programming or approximation algorithms (you should
understand the two approximation algorithms we covered last class),
and one problem will go back to the first five weeks of the quarter (focus on algorithms discussed in class).
-
The practice final is available. I hope to post solutions by Sunday.
-
The tutoring center will be open on Monday 2:30-4pm. The tutors will be happy to answer any questions you might have
regarding material covered in class, on the homeworks, practice exercises, or the project algorithm(s).
-
I will hold office hours on Monday, 4-5pm.
-
Final will be held on Monday, Feb 26th, 2007, 6-7:40pm in room 70-1455.
-
The final will be of the same format as the midterm (5 problems, each worth 10 points and out of these five scores I will sum the
four highest scores to get your overall grade on the final).
-
Majority of the questions will cover areas discussed after the midterm (graph algorithms, linear & integer programming,
reductions, P, NP, NP-completeness, and basic ideas behind approximation algorithms) but you should also
have a reasonable understanding of the areas discussed in the first five weeks of the quarter.
-
I hope to post a practice final by Friday.
-
Final review will be held on Friday, Feb 23rd, 2007, 6-7:40pm in room 70-3455. Bring your questions.
I will go over answers to some of the homework problems in homeworks 5-8, and depending on your interest,
some of the practice exercises.
-
A typo in homework 8 has been corrected (MINIMUM VERTEX COVER instead of MAXIMUM),
plus I rephrased the third problem, allowing you to use the black box for HAMILTONIAN PATH several (polynomially many)
times.
-
Cancelled class material: ppt, do-exercises. I strongly recommend to
do the "do-exercises," they should help you to better understand Monday's class. I will not collect or grade those exercises,
we will go over the solutions on Monday.
-
Homework 8 has been posted, it is due Wednesday, February 21st, 2007, 6pm. We have already covered
all the material needed to finish the homework, except for the 5 points part in problem 3 (it is explained in the above slides
and we will go over this on Monday).
-
Input/output files for the project are now available.
Some explanation/comments are in order here:
- The output files contain an extra line specifying the distance. Your programs are free to do the same, as long as the first line
of your output contains only the numbers of the two closest points.
- The "equidistant" files are technically speaking not equidistant because of a precision issue. If you output any pair of points
with distance within an additive factor of EPS=10^(-6) of the minimal distance, I will accept your answer.
- I will use several extra test cases to test your programs. Those will be primarily generated at random, plus I will generate some
truly equidistant inputs (such as points at coordinates (0,i) for i=1,...,1000).
- Two of the inputs are larger. Your O(n log n) algorithm should run in a matter of seconds on both. It might be wise to write the trivial
O(n^2) algorithm to check if your O(n log n) algorithm works correctly. Try to run the O(n^2) algorithm on the larger inputs. What do you see?
-
- No test input will be larger than 10^6 points.
-
Homework 7 has been posted, it is due 02/14/07. (Please note that you do not have to do the homework on the
Valentine's day!)
-
The final will be held on Monday, February 26th, 2007, 6-7:40pm.
-
Homework 6 has been posted, it is due 02/07/07.
Change of rules: You may work individually or in pairs on homeworks 6-8.
Your homework partner is the only person (except for the intructor) with whom you may discuss the present homework assignment/solutions.
If you have any doubts, send an e-mail or come to talk to the instructor during office hours.
Each pair needs to submit only one copy of the solutions.
-
There is no partial credit for bonus problems.
-
A set of practice exercises has been posted. I will try to update the set regularly
(i.e. add more exercises).
-
Homework 5 has been posted, it is due 01/31/07.
- Additional information about the midterm:
- You may bring one hand-written (your own handwriting, no photocopies) letter-sized "help-sheet" (you may write on both sides).
- Solutions to the practice midterm are available here. Keep in mind that several of the problems
do not have a unique answer (in particular the ones that ask for a pseudocode, there are many possible ways how to design and
implement an algorithm which satisfied the specifications).
-
Midterm review, homework #3, problem #2 (knapsack): I realized we were discussing a different solution on the midterm review than in the class.
In class we defined the S[k,v] value to be the best value of a subset of the first k elements with total weight exactly v, whereas on the review
we were doing total weight at most v. Both of these approaches are ok but it is important to realize that the values in the S array will differ!
The algorithm from the ppt uses the "exactly" interpretation. (I corrected yet one more "<" for ">" in this ppt - I appologize for this,
this ppt suffers from loosing the hand-written annotation, I believe we corrected these signs in class.)
-
Midterm 1 will be held in class on Jan 22nd. Here are the topics for review.
-
Asymptotic notation, basic recurrences (recurrences that we discussed in class, e.g. for the running time of the Mergesort).
-
MergeSort, HeapSort, Select.
-
Greedy algorithms (activity select, Huffman, divisible knapsack).
-
Dynamic programming (indivisible knapsack, matrix chain multiplication, longest common subsequence, longest increasing subsequence).
-
Basic graph algorithms (BFS, DFS, topological sort).
Study the posted notes/ppt and make sure you understand the correct solutions to all homework problems. Check the relevant sections
in the book (section numbers are stated below in the respective weeks).
To practice: solve the practice midterm and the
non-starred exercises in the book (you do not have to provide proofs, though it certainly helps with understanding to know the proof!).
-
Midterm review will be held on Saturday Jan 20th, 4-5pm, in room 70-3455. Bring your questions. I will discuss the solutions to Hw3 and Hw4 (if
time permits I will also post them here but I cannot promise this).
-
Homework 4 has been posted, it is due 01/17/07, 6pm.
-
Two reminders: (1) If you are not doing the project individually, send me an e-mail with your partner's name by Jan 14th.
(2) Midterm will be in class on Jan 22nd.
-
Have a nice break.
-
Homework 3 has been posted, it is due 01/10/07, 6pm.
-
Here are solutions or sketches of solutions for most of the problems on HW1 and HW2.
If you need a more detailed solution feel free to go to the tutoring center to discuss it with our helpful tutors.
The same goes for any class material that you have any doubts about.
-
The project has been posted. You may work in pairs or as individuals, whichever
way you prefer. If you are working in pairs, send me your partner's name by e-mail by 01/14/07, otherwise
I will be assuming you are working individually.
-
Midterm will be in class on Monday 01/22/06 (notice the change
of date - you voted for 01/22 rather than the originally proposed date of
01/17). The midterm will cover
material from the first five and a half weeks (including material discussed
on 01/17/06). I will post a practice midterm along with the list of topics
and exercises of interest by 01/18/06.
-
No class on 01/08/07.
I will make up for this by having two exam reviews - one
for the midterm and one for the final.
-
Homework 2 has been posted. It is due Wednesday, 12/20/06, 6pm.
-
Homework 1 has been posted. It is due Wednesday, 12/13/06, 6pm.
Week 1
-
Monday, Dec 4th
- Buy the book, check the course website frequently.
- Covered in class: Asymptotic notation (Chapter 3.1: definition of O, Theta and Omega)
- Briefly discussed: Linear search, binary search (handout - in-class
exercise about binary search). To search for an element in an array of size n we need to use (in the worst case)
n comparisons. In other words, any search algorithm has running time Omega(n).
- Covered in class: several sorting algorithms (Selection sort, Insert sort, Merge sort - Chapter 2). Selection sort run on input array of size n always takes time
O(n^2). Insert sort could take time O(n) for some inputs, but in the worst case it needs O(n^2) operations.
We will analyze the running time of Mergesort on Wednesday.
-
Plan for Wednesday: Heapsort (Chapter 6), lower-bounds for sorting (Chapter 8.1), Radix-sort (Chapter 8.3).
-
Wednesday, Dec 6th
-
Covered in class: Mergesort revisited (Chapter 2), notes
-
Covered in class: Heapsort (Chapter 6), notes
-
Homework 1 has been posted, due 12/13/06, 6pm.
Week 2
-
Monday, Dec 11th
- Covered in class: Lower-bounds for sorting (Chapter 8.1), notes
- Covered in class: Linear-time sorts, specifically Radix-sort (Chapter 8.3), notes
- Covered in class: Linear median (Chapter 9.3), notes
- Disclaimer about the notes: These are my personal notes which might have an occasional error in it
(hopefully not conceptual, only typos) -
the notes are not a substitute for reading the relevant sections in the book. The notes are meant to serve as a guideline
for the topics covered in class (primarily for the instructor's use - they might not be written in the most pedagogical way).
-
Plan for Wednesday: Analysis of linear median (Chapter 9.3), Finding median in expected linear time (Chapter 9.2), Greedy algorithms
(Chapter 16.1).
-
Wednesday, Dec 13th
-
Covered in class: Analysis of linear median (Chapter 9.3),
notes (the same as for Monday)
-
Covered in class: Median in expected linear time (Chapter 9.2),
notes (Currently there is a typo in PARTITION - it needs to swap A[l] with A[r]
and return r. I'll post update on Thursday. Thanks to Joe for spotting this.)
-
Covered in class: Greedy algorithms - activity selection (Chapter 16.1),
notes
-
Homework 2 has been posted, due 12/20/06, 6pm.
-
Plan for next week: Greedy algorithms (Huffman codes, Chapter 16.3), Dynamic programming (Matrix-chain multiplication, Chapter 15.2;
Longest common subsequence, Chapter 15.4)
Week 3
-
Monday, Dec 18th
- Covered in class: Activity selection maximizing the total TIME selected - a dynamic programming solution,
ppt
- Introduced: Huffman coding (Chapter 16.3), we will cover the actual algorithm on Wednesday
-
Plan for Wednesday: Huffman continued (Chapter 16.3), Knapsack (end of Chapter 16.2),
More dynamic programming (Matrix-multiplication, Chapter 15.2; Longest common subsequence, Chapter 15.4).
We will probably not manage to cover all these topics, whatever is left will be covered on Wednesday after the break.
-
Wednesday, Dec 20th
- Covered in class: Huffman (see above ppt), KNAPSACK (end of chapter 16.2), ppt
(unfortunately I deleted the pen annotations from class - you will have to reconstruct them on your own)
- Introduced: Longest common subsequence problem (Chapter 15.4) - we went thourgh the heart of the algorithm, try to write the algorithm
without looking at the notes - that would be an excellent practice for any coming dynamic programming assignments
-
Homework 3 has been posted, it is due 01/10/07, 6pm.
-
Plan for Wednesday 01/10/07 (recall, no class on 01/08/06): More dynamic programming
(Matrix-multiplication, Chapter 15.2; Longest common subsequence, Chapter 15.4; Longest increasing subsequence).
Week 4
-
Monday, Jan 8th
-
Wednesday, Jan 10th
-
Covered in class: Longest common subsequence, Chapter 15.4, ppt
-
Covered in class: Longest increasing subsequence, see notes; Matrix chain multiplication, Chapter 15.2,
ppt
-
Homework 4 has been posted, it is due 01/17/07, 6pm.
-
Plan for next week: Graph algorithms (Chapters 22 and 23)
Week 5
-
Monday, Jan 15th
-
All RIT classes cancelled due to bad weather. Read chapter 22 in the book.
-
Wednesday, Jan 17th
-
Covered in class: BFS, DFS, Topological sort (Chapter 22), ppt
-
Midterm 1 is on Monday, Jan 22nd. On Wednesday, Jan 24th, we will continue with strongly connected components
(end of Chapter 22) and minimum spanning trees
(Chapter 23).
Week 6
-
Monday, Jan 22th
-
Wednesday, Jan 24th
-
Covered in class: solutions of the midterm problems
-
Covered in class: Strongly connected components (Chapter 22), ppt
-
Plan for next week: Minimum spanning trees (Chapter 23), namely the algorithms of Kruskal and Prim. Shortest paths in graphs (Chapters 24
and 25).
-
Homework 5 has been posted, it is due 01/31/07, 6pm.
Week 7
-
Monday, Jan 29th
-
Covered in class: Minimum spanning trees (Chapter 23), notes.
-
Wednesday, Jan 31th
-
Covered in class: shortest paths in graphs, specifically Dijkstra, Floyd-Warshall and Bellman-Ford (see the relevant
sections of Chapters 24 and 25), ppt.
-
Plan for next week: Flows in networks (Chapter 26), with emphasis on the Ford-Fulkerson algorithm and maximum bipartite matching problem.
After this topic we will cover NP-completeness (Chapter 34).
-
Homework 6 has been posted, it is due 02/07/07, 6pm.
Week 8
-
Monday, Feb 5th
-
Covered in class: Maximum flow algorithms (Ford-Fulkerson, Edmons-Karp)
and maximum bipartite matchings (Chapter 26), notes.
-
Wednesday, Feb 7th
-
Covered in class: continued Maximum flow algorithms.
-
Plan for next week: Introduction to linear programming (Chapter 29, mostly focusing only on sections 29.1-2).
NP-completeness (Chapter 34).
-
Homework 7 has been posted, it is due 02/14/07, 6pm.
Week 9
-
Monday, Feb 12th
-
Covered in class: Introduction to Linear programming (Sections 29.1-2), Polynomial-time reductions (see sections of Chapter 34).
-
Wednesday, Feb 14th
-
Class cancelled due to bad weather.
-
Plan for next week: NP-completeness (Chapter 34) - ppt, Introduction to approximation algorithms
(Chapter 35, mostly sections 35.1-2).
-
Homework 8 has been posted, it is due 02/21/07, 6pm.
Week 10
-
Monday, Feb 19th
-
Covered in class: NP and NP-completeness (see Chapter 34), ppt.
-
Wednesday, Feb 21th
-
Covered in class: Introduction to approximation algorithms (Chapter 35, mostly sections 35.1-2),
ppt.