Spring 2018 CS231

This is a course about algorithms and their analysis

About CS231

The language of computer science is to a great extent the language of algorithms. Although there are many thousands of algorithms, there are relative few basic design techniques. These include: divide-and-conquer, greedy, dynamic programming, and network flow. We will illustrate these techniques by studying a few fundamental algorithms of each type. In addition to helping us understand classic solution techniques, these algorithms have proven very useful in practice. Their names and the names of the problems they solve have become a standard part of the language of computer science.

Unfortunately, there is rarely a best algorithm to solve a given problem. Each approach involves a series of tradeoffs. Therefore, we will also study methods for evaluating the usefulness of an algorithm in a given situation. Among the various competing measures, we will focus primarily on the anal- ysis of time and space complexity. However, a number of other issues will also be discussed.

Meet your instructors & tutors

Click here for CS231 drop-in calendar

CS231 Spring 2018 schedule

Note that all readings are required to be done before class, except for the first lecture :)
Please check this page frequently, as it is subject to change.
To use late passes for assignments, please fill out this form.






Jan 29

Jan 30

Lecture 1: Introduction

Reading (not required): Chapter 1

Jan 31

Feb 1

Feb 2

No Class

Feb 5

Feb 6

Part I - Basics

Lecture 2: Tractability and Asymptotic order or growth

Reading: Sections 2.1 and 2.2

Feb 7

Feb 8

Feb 9

Lecture 3: Data structures

Reading (not required): Review ideas from CS230

Assignment 1 due in class

Feb 12

Feb 13

Lecture 4: The Stable Matching problem

Reading: Sections 1.1 and 1.2

Feb 14

Feb 15

Feb 16

Lecture 5: More on stable matching

Reading: Sections 1.1 and 1.2

Assignment 2 due in class

Feb 19

Presidents Day

Feb 20

No class - Monday Schedule

Feb 21

Feb 22

Feb 23

Exam 1

Assignment 3 due in class

Feb 26

Feb 27

Part II - Graphs

Lecture 6: Graphs - An Intro

Reading: Section 3.1 and 3.2

Feb 28

Mar 1

Mar 2

Lecture 7: Traversals

Reading: Sections 3.2 and 3.3

Mar 5

Mar 6

Lecture 8: Directed Graphs

Reading: Sections 3.5 and 3.6

Mar 7

Mar 8

Mar 9

Part III - Greedy algorithms

Lecture 9: Interval Scheduling

Reading: Section 4.1

Assignment 4 due in class

Mar 12

Mar 13

Lecture 10: Snow Day!

Mar 14

Mar 15

Mar 16

Lecture 11: Scheduling continued

Reading:Sections 4.1 and 4.2

Assignment 5 due in class

Mar 19

Mar 20

Exam 2

Mar 21

Mar 22

Spring Break

Mar 23

Spring Break

Mar 26

Spring Break

Mar 27

Spring Break

Mar 28

Spring Break

Mar 29

Spring Break

Mar 30

Spring Break

Apr 2

Apr 3

Lecture 12: More on Greedy algorithms

Reading: 4.1 and 4.2
Final paper: Phase 1 due

Apr 4

Apr 5

Apr 6

Lecture 13: More on Graphs

Reading: Sections 4.4 and 4.5

Apr 9

Apr 10

Lecture 14: Graphs again!

Reading: Sections 4.4 and 4.5

Apr 11

Apr 12

Apr 13

Part IV - Divide & Conquer

Lecture 15: Merge Sort and Recurrences

Reading: Sections 5.1 and 5.2

Assignment 6 due in class

Apr 16

Apr 17

Lecture 16: Recurrences and Counting Inversions

Reading: Sections 5.2 and 5.3
Final paper: Phase 2 due

Apr 18

Apr 19

Apr 20

Part V - Dynamic Programming

Lecture 17: Weighted Interval Scheduling

Reading: Sections 6.1 and 6.2

Assignment 7 due in class

Apr 23

Apr 24

Lecture 17: Weighted Interval Scheduling (2)

Reading: Section 6.1 and 6.2

Apr 25

Apr 26

Apr 27

Lecture 18: Graphs yet again!

Reading: 6.8 and 6.9

Assignment 8 due in class

Apr 30

May 1

Exam 3

May 2

May 3

May 4

Part VI - Advanced Topics

Lecture 19: Network Flow

Reading: Sections 7.1 and 7.2

May 7

May 8

Lecture 21: NP and Computational Intractability

Reading: Sections 8.1-8.4

May 9

May 10

May 11

Lecture 22: TBD

Reading: TBD

Assignment 9 due in class

May 14

Reading Period

May 15

Reading period

May 16

Final exams

May 17

Final exams

May 18

Final exams

May 21

Final exams

May 22

Final paper due

May 16

Enjoy your summer :)

May 17

May 18

Administrative details of CS231

Course Overview

Prerequisites The prerequisite for CS231 is CS230, and Math 225. Students with significant mathematical experience (writing and understanding proofs), or those who have not taken Math 225 need the permission of the instructor.

Textbook - Very Important!! The textbook for this semester is Regular readings will be assigned from the required text, Algorithm Design, by by Jon Kleinberg and Eva Tardos, 1st edition. It is required that you read the relevant sections every lecture.

Computers No programming will be done as part of this course. You will need your computers, however, to type your assignments. You are expected to use Latex for typesetting all assignments in this course.

Course Directory The CS231 course directory is located at /home/cs231 on tempest. You will be submitting your assignments, in pdf format, in that directory. Any required material, if any, of the course will be placed in the download folder inside the /home/cs231 directory, and you can access it using an ftp program (like Fetch on a Mac).

Course Group Please add yourself to the cs231-spring2017 google group. This group has several purposes. We will use it to make class announcements, such as corrections to assignments and clarifications of material discussed in class. We encourage you to post questions or comments that are of interest to students in the course.
The instructors and TAs will read messages posted in the group on a regular basis and post answers to questions found there. If you know the answer to a classmate's question, feel free to post a reply yourself. The course group is also a good place to find people to join a study group. You should plan on reading group messages on a regular basis.

Course Requirements

Lectures There are two 70-minute lectures each week that will introduce the main content of the course. Lectures are held on Tuesdays and Fridays at 1:30pm-2:40pm in E111.

Final Poster and Paper: During the last few weeks of the semester, teams of 2-3 students work on a short survey paper. After choosing an interesting algorithmic problem, you will first read related literature on the topic, and summarize your findings into a short scientific paper (5 pages). Each team will present their work in a poster session during reading period, and will prepare a short paper to be submitted by the last day of exams.

Exams: There will be three in-term, in-class, non-collaborative exams that are open book and open notes. There will be no final exam, as there will be a final poster and paper instead. The dates of the exams are listed on the schedule. Please mark the exam dates in your calendars as they are not flexible.

Grading Policy

Final Grades Your final grade for the course will be computed as a weighted average of several components. The relative weight of each component is shown below:

This course complies with the Wellesley College grading policy. While that policy asks faculty to hold each 100- and 200-level course with 10 or more students to an average of no higher than 3.33, it does not require faculty to grade on a "curve." There is no arbitrary limit on the number of A's, B's, C's etc., and every student will be assigned the grade they earn and deserve according to the grading standards of the college.

Assignments in CS231

There will be weekly assignments in which you will analyze algorithmic problems, using concepts and techniques discussed in class. Assignments are due as indicated on the class schedule. You are required to complete the assignments on your own. You can discuss the problems with the CS231 team members and classmates, but you must write your own solutions.


A softcopy of the assignments must be submitted to the /home/cs231/ directory, in pdf format, before class. It is required that you typeset the assignment using Latex. You can find some good tutorials here, and here, and a complete book here. A hard copy of the assignment must be submitted at the beginning of class on the day corresponding to the due date of the assignment (usually Friday).

Late Assignment Passes

In the first week of the semester, you will be given 4 late assignment passes, with the following rules:

Late Assignment Policy

If you are out of late assignment passes, no late work will be accepted unless there are extenuating circumstances (e.g., sickness, personal crisis, family problems). In this case you may request an extension before the due date. The softcopy submission will be a dated file. If the formal solutions are distributed before you turn in a late assignment, you are bound by the Honor Code not to examine these solutions.

Course FAQs

Exam questions:

Q: How can we memorize all of these algorithms before the exam?
A: The exam is open book / notes. No need to memorize anything.

Q: How long will the exam be?
A: It's only 70 minutes long. Definitely shorter than the assignments!

Q: How will the questions look like?
A: A mix of things, but it'll never be a type of problem, in which you write the algorithm to solve a new problem, and analyze it.

Assignment questions:

Q: If the problem doesn't ask us to prove the correctness of the algorithm, then we don't have to write a proof. Right?
A: Yes, you don't have to write a proof. However, what if your algorithm was incorrect? Showing us your reasoning would give you partial credit. Just a simple explanation of your reasoning would suffice.

Q: Should I write the algorithm in English? Or do I have to explain the data structures that I am using?
A: If you are not required to show the data structures that you'll be using, then you can just explain the algorithm in English. Remember, if you are asked to analyze the running time complexity of the algorithm, thinking about which data structures to use matter.

Q: Do I have to use the latex template provided?
A: No, you don't, but you have to type it in latex, and submit a pdf. If you don't use the same template, you must at least copy the header of the assignment, to fill in the assignment meta data.