CS 373: Combinatorial Algorithms
CS 373: Combinatorial Algorithms
CS 373: Combinatorial Algorithms
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>CS</strong> <strong>373</strong>: <strong>Combinatorial</strong> <strong>Algorithms</strong><br />
University of Illinois, Urbana-Champaign<br />
Instructor: Jeff Erickson<br />
Teaching Assistants:<br />
• Spring 1999: Mitch Harris and Shripad Thite<br />
• Summer 1999 (IM<strong>CS</strong>): Mitch Harris<br />
• Summer 2000 (IM<strong>CS</strong>): Mitch Harris<br />
• Fall 2000: Chris Neihengen, Ekta Manaktala, and Nick Hurlburt<br />
• Spring 2001: Brian Ensink, Chris Neihengen, and Nick Hurlburt<br />
• Summer 2001 (I2<strong>CS</strong>): Asha Seetharam and Dan Bullok<br />
• Fall 2002: Erin Wolf, Gio Kao, Kevin Small, Michael Bond, Rishi Talreja, Rob Mc-<br />
Cann, and Yasutaka Furakawa<br />
c○ Copyright 1999, 2000, 2001, 2002, 2003 Jeff Erickson.<br />
This work may be freely copied and distributed.<br />
It may not be sold for more than the actual cost of reproduction.<br />
This work is distributed under a Creative Commons license; see http://creativecommons.org/licenses/by-nc-sa/1.0/.<br />
For the most recent edition, see http://www.uiuc.edu/ ∼ jeffe/teaching/<strong>373</strong>/.
For junior faculty, it may be a choice between a book and tenure.<br />
— George A. Bekey, “The Assistant Professor’s Guide to the Galaxy” (1993)<br />
I’m writing a book. I’ve got the page numbers done.<br />
About These Notes<br />
— Stephen Wright<br />
This course packet includes lecture notes, homework questions, and exam questions from the<br />
course ‘<strong>CS</strong> <strong>373</strong>: <strong>Combinatorial</strong> <strong>Algorithms</strong>’, which I taught at the University of Illinois in Spring<br />
1999, Fall 2000, Spring 2001, and Fall 2002. Lecture notes and videotapes lectures were also used<br />
during Summer 1999, Summer 2000, Summer 2001, and Fall 2002 as part of the UIUC computer<br />
science department’s Illinois Internet Computer Science (I2<strong>CS</strong>) program.<br />
The recurrences handout is based on samizdat, probably written by Ari Trachtenberg, based<br />
on a paper by George Lueker, from an earlier semester taught by Ed Reingold. I wrote most<br />
of the lecture notes in Spring 1999; I revised them and added a few new notes in each following<br />
semester. Except for the infamous Homework Zero, which is entirely my doing, homework and<br />
exam problems and their solutions were written mostly by the teaching assistants: Asha Seetharam,<br />
Brian Ensink, Chris Neihengen, Dan Bullok, Ekta Manaktala, Erin Wolf, Gio Kao, Kevin Small,<br />
Michael Bond, Mitch Harris, Nick Hurlburt, Rishi Talreja, Rob McCann, Shripad Thite, and Yasu<br />
Furakawa. Lecture notes were posted to the course web site a few days (on average) after each<br />
lecture. Homeworks, exams, and solutions were also distributed over the web. I have deliberately<br />
excluded solutions from this course packet.<br />
The lecture notes, homeworks, and exams draw heavily on the following sources, all of which I<br />
can recommend as good references.<br />
• Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman. The Design and Analysis of Computer<br />
<strong>Algorithms</strong>. Addison-Wesley, 1974. (This was the textbook for the algorithms classes<br />
I took as an undergrad at Rice and as a masters student at UC Irvine.)<br />
• Sara Baase and Allen Van Gelder. Computer <strong>Algorithms</strong>: Introduction to Design and Analysis.<br />
Addison-Wesley, 2000.<br />
• Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf. Computational<br />
Geometry: <strong>Algorithms</strong> and Applications. Springer-Verlag, 1997. (This is the required<br />
textbook in my computational geometry course.)<br />
• Thomas Cormen, Charles Leiserson, Ron Rivest, and Cliff Stein. Introduction to <strong>Algorithms</strong>,<br />
second edition. MIT Press/McGraw-Hill, 2000. (This is the required textbook for <strong>CS</strong> <strong>373</strong>,<br />
although I never actually use it in class. Students use it as a educated second opinion. I used<br />
the first edition of this book as a teaching assistant at Berkeley.)<br />
• Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide to the<br />
Theory of NP-Completeness. W. H. Freeman, 1979.<br />
• Michael T. Goodrich and Roberto Tamassia. Algorithm Design: Foundations, Analysis, and<br />
Internet Examples. John Wiley & Sons, 2002.<br />
• Dan Gusfield. <strong>Algorithms</strong> on Strings, Trees, and Sequences: Computer Science and Molecular<br />
Biology. Cambridge University Press, 1997.<br />
• Udi Manber. Introduction to <strong>Algorithms</strong>: A Creative Approach. Addison-Wesley, 1989.<br />
(I used this textbook as a teaching assistant at Berkeley.)
• Rajeev Motwani and Prabhakar Raghavan. Randomized <strong>Algorithms</strong>. Cambridge University<br />
Press, 1995.<br />
• Ian Parberry. Problems on <strong>Algorithms</strong>. Prentice-Hall, 1995. (This was a recommended<br />
textbook for early versions of <strong>CS</strong> <strong>373</strong>, primarily for students who needed to strengthen their<br />
prerequisite knowledge. This book is out of print, but can be downloaded as karmaware from<br />
http://hercule.csci.unt.edu/ ∼ ian/books/poa.html .)<br />
• Robert Sedgewick. <strong>Algorithms</strong>. Addison-Wesley, 1988. (This book and its sequels have by<br />
far the best algorithm illustrations anywhere.)<br />
• Robert Endre Tarjan. Data Structures and Network <strong>Algorithms</strong>. SIAM, 1983.<br />
• Class notes from my own algorithms classes at Berkeley, especially those taught by Dick Karp<br />
and Raimund Seidel.<br />
• Various journal and conference papers (cited in the notes).<br />
• Google.<br />
Naturally, everything here owes a great debt to the people who taught me this algorithm stuff<br />
in the first place: Abhiram Ranade, Bob Bixby, David Eppstein, Dan Hirshberg, Dick Karp, Ed<br />
Reingold, George Lueker, Manuel Blum, Mike Luby, Michael Perlman, and Raimund Seidel. I’ve<br />
also been helped immensely by many discussions with colleagues at UIUC—Ed Reingold, Edgar<br />
Raoms, Herbert Edelsbrunner, Jason Zych, Lenny Pitt, Mahesh Viswanathan, Shang-Hua Teng,<br />
Steve LaValle, and especially Sariel Har-Peled—as well as voluminous feedback from the students<br />
and teaching assistants. I stole the overall course structure (and the idea to write up my own<br />
lecture notes) from Herbert Edelsbrunner.<br />
We did the best we could, but I’m sure there are still plenty of mistakes, errors, bugs, gaffes,<br />
omissions, snafus, kludges, typos, mathos, grammaros, thinkos, brain farts, nonsense, garbage,<br />
cruft, junk, and outright lies, all of which are entirely Steve Skiena’s fault. I revise and update<br />
these notes every time I teach the course, so please let me know if you find a bug. (Steve is unlikely<br />
to care.)<br />
When I’m teaching <strong>CS</strong> <strong>373</strong>, I award extra credit points to the first student to post an explanation<br />
and correction of any error in the lecture notes to the course newsgroup (uiuc.class.cs<strong>373</strong>).<br />
Obviously, the number of extra credit points depends on the severity of the error and the quality<br />
of the correction. If I’m not teaching the course, encourage your instructor to set up a similar<br />
extra-credit scheme, and forward the bug reports to Steve me!<br />
Of course, any other feedback is also welcome!<br />
Enjoy!<br />
— Jeff<br />
It is traditional for the author to magnanimously accept the blame for whatever deficiencies<br />
remain. I don’t. Any errors, deficiencies, or problems in this book are somebody else’s fault,<br />
but I would appreciate knowing about them so as to determine who is to blame.<br />
— Steven S. Skiena, The Algorithm Design Manual, Springer-Verlag, 1997, page x.