This course studies the major algorithmic design paradigms and
mathematical tools for analyzing the running times of algorithms and
detecting computational problems for which no efficient deterministic
algorithm. Topics include: basics of analysis of algorithms; general
algorithmic paradigms: (i) divide and conquer; (ii) greedy algorithms;
(iii) dynamic programming; and (iv) graph algorithms; NP-completeness
and its implications; and undecidability.
The course material includes:
Tuesday and Thursday from 11am-12:30pm online through Zoom. See Piazza
announcements for more information. Recorded lecture videos are
available on Learn for viewing any day/time.
We are not following the text exactly but we will suggest readings from the text book CLRS. This is an excellent text book and we highly recommended doing the suggested readings to supplement the lecture material. Below are the suggested readings, lecture notes from the recorded videos, and slides. We often do not use slides in lecture videos and instead provide them as an alternative set of notes.
|Week 1||L1||May 12||Introduction and Overview of Topics||PDF
||PDF, PPT||CLRS Ch. 1|
|L2||May 14||Analyzing Algorithms, Introduction to Divide-and-Conquer Algorithms, MergeSort||PDF,
||CLRS Ch. 2.2|
|Week 2||L3||May 19||Asymptotic notation, growths of runtime functions, and important summation||---||CLRS Ch. 3|
|L4||May 21||Mathematical tools for Analyzing Divide and Conquer Algorithms, Recursion Tree and Substitution Methods, Recurrences and the Master Theorem||---||CLRS Ch. 4.3-4.5 (Optional 4.6)|
|Week 3||L5||May 26||2-D Maxima & Closest Pair||PDF, PPT||CLRS Ch. 33.4|
|L6||May 28||Integer Multiplication & Strassen's Matrix Multiplication||PDF, PPT||CLRS Ch 4.2|
|Week 4||L7-8||June 2, 4||Greedy Algorithms 1 & 2: Activity Selection and Scheduling||PDF (L7), PDF (L8)||PDF, PPT||CLRS Ch. 16.1-16.2|
|Week 5||L9||June 9||Greedy Algorithms 3: Stable Matching||PDF, PPT|
|L10||June 11||Dynamic Programming 1||PDF, PPT||CLRS Ch 15.1-15.3|
|Week 6||L11||June 16||Dynamic Programming 2: Weighted Activity Selection and Sequence Alignment||PDF, PPT||CLRS 15.4, 15.5|
|L12||June 18||Dynamic Programming 3: Matrix Multiplication Order, 0/1 Integer Weight Knapsack||PDF, PPT||CLRS 15.4-15.5|
|Week 7||L13||June 23||Dynamic Programming 5: 0/1 Integer Knapsack and Intro to Graphs||PDF, PPT||CLRS 22.1-22.3|
|L14||June 25||BFS/DFS/Connectivity/Topological Sort||---||PDF, PPT||CLRS 22.1-22.3|
|Week 8||L15||June 30||Topological Sort, SCC||---||PDF, PPT||CLRS 22.4, 22.5|
|L16||July 2||Minimum Spanning Tree||PDF, PPT||CLRS 23.1, 23.2|
|Week 9-10||L17||July 7||MST||PDF (same as L16)||---||CLRS 23.1, 23.2|
|L18, 19, 20||July 9, 14, 16||Kruskal's Algorithm and Shortest Paths||PDF (L18), PDF (L19-L20)||PDF, PPT||CLRS 24.1-24.3, 25.1-25.2|
|Week 11-12||L21||July 21||Intractability 1: Introduction to Theory of NP-Completeness||PDF, PPT||CLRS 34.1-34.2|
|L22, 23||July 23, 28||Intractability 2: Reductions||PDF (L22),PDF (L23)||PDF, PPT||CLRS 34.3-34.4|
|Week 12||L24||July 30||Intractability 3: Undecidability||PDF, PPT||CLRS 34.1-34.2|
Hand in a PDF file with your solutions via CrowdMark. We encourage you to prepare your solutions using LaTeX but you can use other software or submit handwritten assignments as long as they are legible. We have the right to take marks off for illegible answers.
When the CrowdMark instance is ready, all students enrolled in the class will receive an email with a link to their individual submission site. In order to submit, upload a separate PDF file (multiple pages are allowed) to each question. You may resubmit as often as necessary until the due date. (More detailed CrowdMark information is available at https://crowdmark.com/help/completing-and-submitting-an-assignment/.)
Marmoset will be used for the programming questions, and is available at https://marmoset.student.cs.uwaterloo.ca.
Assignments will be handed out and due as follows (dates are tentative and may change):
|Assignment Number||Due (midnight EST)||Hand In Via||Markers||Solutions|
|May 24||CrowdMark|| Q1: Utsav
|See A1.1 solution sketch under "Assignments" in Learn.|
|May 31||CrowdMark|| Q1: Vikash
|See A1.2 solution sketch under "Assignments" in Learn.|
PDF, LaTeX, PNG files
|June 21||CrowdMark||Q1: Catherine
Q3 (a, b, c): Vijay
Q4 (a, b): Stavros
|See A2 solution sketch under "Assignments" in Learn.|
|July 1||CrowdMark and Marmoset||Q1 (Programming): Stavros
Q2 (a, b, c): Krishna
|See A3 solution sketch under "Assignments" in Learn.
|July 12||CrowdMark||Q1: Mahdi
|See A4 solution sketch
under "Assignments" in Learn.
PDF, LaTeX, PNG file
|July 22||CrowdMark|| Q1: Krishna
Q2 (a, b, c): Catherine
Q2 (d, e, f): Stavros
Q3 (a, b): Vikash
Q3 (c): Utsav
Q4 (a, b): Vijay
|See A5 solution sketch under "Assignments" in Learn.|
PDF, LaTeX, JPG file
|July 31||CrowdMark||Q1: Stavros
Q2 (a): Mahdi
Q2 (b, c): Utsav
Q3 (a): Vijay
Q3 (b): Utsav
|See A6 solution sketch under "Assignments" in Learn.|
Instructions for Assignments: Your written solutions will be judged not only for correctness but also for the quality of your presentation and explanations. In questions that involve designing an algorithm, (i) describe the main idea first, (ii) present clearly written pseudocode (e.g., at a level of details mimicking the style of the lectures, the model solutions, or the textbook), (iii) give a correctness proof/argument if it is not immediately obvious, and (iv) include an analysis (usually, of the running time). In all assignments, unless otherwise directed, you are expected to justify any claims that you make. The level of explanation we generally expect is "enough to convince a skeptical TA". Usually this means that a complete formal proof from first principles is not needed (unless we say so). Furthermore, since this course is essentially all about efficient use of time and space, strive to make your solutions as efficient as possible. Solutions that are technically correct, but extremely wasteful in terms of time and space, will not receive full credit.
Collaboration Policy: The work you hand in must be your own. Unless specified otherwise, you can always use any result from the textbook, notes, or previous assignment just by citing it. You may discuss the assignment questions verbally with others, but you should come away from these discussions with no written or electronic records and you must acknowledge the discussion. Acknowledge any sources you have used. Any assistance received (from human or nonhuman sources) that is not given proper citation may be considered a violation of the university policies.
Late Policy: Late assignments will not be accepted and no extensions will be granted under any circumstances. Solutions will be posted almost immediately online on Learn.
Programming Questions: There will be several assignments that contain a programming question, where we ask you to code an algorithm. However, this is not a software engineering course. We will not test your code for trivial edge cases (such as the case of empty input), or inputs that do not match our specifications. However, your program should take care of the edge cases that are crucial to the algorithm's correctness or analysis. For example, unless the problem states so, you should not usually assume that the input size is a power of 2. We will send out detailed instructions about how to submit programming questions.
We will use Piazza for all course announcements and as a forum for students to ask and answer questions. So you should enroll yourself at your earliest convenience. During Piazza discussions, please do not reveal the solutions to the assignments by requesting or offering detailed advice. We'll delete comments that reveal too much. Violations can result in academic sanctions.
Similarly, do not solicit hints or provide hints about how to solve the homework problems on other bulletin boards, such as Facebook. Violations can result in academic sanctions.
Piazza is not the place to dispute how assignments are marked. If you have a complaint, please follow the process given below.
|Instructor||Email (at school name dot ca)||Office Hours|
|Semih Salihoglu||ssalihog||Tue: 1-2pm and Th: 8-9pm through Zoom. See Piazza announcements for Zoom links.|
|Teaching assistant||Email (at school name dot ca)|
|Utsav Tushar Das||utdas|
|Krishna Teja Reddy Vemula||ktrvemul|
We plan to hold 2 TA Office Hours per week through Zoom. See Piazza announcements for Zoom links.
|Instructional support coordinator||Email (at school name dot ca)|
The mark is based on 7 assignments (percentage of each will roughly be between 14-16%).
Note: If you decide to e-mail the course staff, you must use your uwaterloo Quest e-mail account (WatIAM/Quest userID @uwaterloo.ca); otherwise we cannot verify who you are and are limited on what we can accept and respond to.
|Assignment, Missed Deadline:||We do not accept late or emailed assignments. The last files
submitted before the deadline will be marked (submit early and
often, even if not finished).
If the deadline is missed due to illness or other valid, verifiable reason, see Missed Work Due To Illness below.
|Assignment Marking Error:||Re-mark request, due within one week of release of marks on CrowdMark/Marmoset. Contact the TA who marked the specific question and submit a written request. See TAs for contact information.|
|Assignment Recording Error:||Grades will be made available through https://www.student.cs.uwaterloo.ca/~cs341/cgi-bin/displayMarks.cgi. If you notice an error in the recorded value, please contact Caroline Kierstead (CS 341 ISC).|
|Course Website Error:||Email CS341 course account|
|Handouts Error:||Instructors - email or check consulting hours listed at Instructors|
|Enrollment:||If Quest won't let you enroll or switch LEC or TUT sections without a permission/override number: Instructors and course staff are unable to help you—you must see a CS academic advisor.|
|General Course Help:||TA office hours or instructor office hours.|
|Lecture Questions:||TA office hours or instructor office hours.|
|Missed Work Due To Illness/Valid, Verifiable Reason (Assignments, Exams):||Assignments, midterms, final exam: Validation required (see Verification of Illness Services at https://uwaterloo.ca/campus-wellness/health-services/student-medical-clinic but substitute Caroline Kierstead (CS 341 ISC) for references to instructor. Make sure you also read the Math Faculty document on the consequences of submitting a VIF.|
|AccessAbility Services (AAS) exam accommodation forms (request to write at AAS):||Submit to AAS at least 3 weeks before exam|
This book is available electronically through the UW library catalog.
Additional reference: [DPV], Dasgupta, Papadimitriou, Vazirani, Algorithms, available here.
The following resource is also useful for the course but more importantly for technical interviews you may have:
Mental Health: If you or anyone you know experiences any academic stress, difficult life events, or feelings like anxiety or depression, we strongly encourage you to seek support.
Diversity: It is our intent that students from all diverse backgrounds and perspectives be well served by this course, and that students’ learning needs be addressed both in and out of class. We recognize the immense value of the diversity in identities, perspectives, and contributions that students bring, and the benefit it has on our educational environment. Your suggestions are encouraged and appreciated. Please let us know ways to improve the effectiveness of the course for you personally or for other students or student groups. In particular:
MOSS (Measure of Software Similarities) is used in this course as a means of comparing students' assignments to ensure academic integrity. We will report suspicious activity, and penalties for plagiarism/cheating are severe. Please read the available information about academic integrity very carefully.
Discipline cases involving any automated marking system such as Marmoset include, but are not limited to, printing or returning values in order to match expected test results rather than making an actual reasonable attempt to solve the problem as required in the assignment question specification.