# COMPSCI 311: Introduction to Algorithms

Welcome to the Spring 2024 homepage for COMPSCI 311: Introduction to Algorithms (section 2).

Class Location and Times
Lecture: ELAB 303, 4:00-5:15pm (Section 2)
Discussions: Agricultural Engineering 119, F 9:05am, 10:10am, 12:20pm, 1:25pm (50 min.)
Discussions are common with Section 1 (taught by Ghazaleh Parvini). Other points in this syllabus are specific to Section 2, though the material is similar in the two sections.

Course Staff

• Instructor: Marius Minea, LGRC A261 (marius at cs)
• TAs: Md. Abdul Aowal, Mahsa Sahebdel
• UCAs: Aditya Khurmi, Alec Kurth, Anish Mitagar, Iris Xia, Kyle Lee
Office hours: See schedule on Canvas and Campuswire. You are encouraged to attend office hours to discuss course material and get help and suggestions for solving problems.

Supplemental Instruction. The UMass Learning Resource Center provides a supplemental instruction program for this course. Your SI leader, Bret Hackenson, will hold review sessions twice a week and post worksheets on a separate Canvas course where you will be enrolled. Participating in SI sessions is optional but highly recommended.

Course Objectives, Prerequisites, and Learning Outcomes
Welome to COMPSCI 311 - Introduction to Algorithms. This course will introduce you to algorithms in a variety of areas of interest, including graph and network algorithms, scheduling, searching, sorting, and string processing. More than just a list of classic algorithms, in this course you will learn and practice algorithm design and problem solving. To implement in code solutions to complex problems, we must first design such algorithms. We will learn how to do this, typically using the following steps:

• formulating a clear problem definition
• proposing an algorithm
• proving that it correctly solves the problem
• analyzing its running time.
You will learn to perform this process of algorithm design using several algorithmic paradigms, including greedy algorithms, divide and conquer, dynamic programming, and network flow. Finally, you will learn to recognize when no efficient algorithm solves the problem, understand NP-completeness and computational intractability, and see how approximation or randomized algorithms provide alternatives.

Prerequisites: COMPSCI 187 and either COMPSCI 250 or MATH 455. Mathematical experience (as provided by COMPSCI 250) is required. You should also be able to program in Java, C, Python, or some other closely related language.

Learning Management Systems and Communication We use Canvas to post course material and quizzes, and Gradescope for submission and grading of homework.
We use Campuswire for course communication, including any announcements, see the communication policy below for more details.

Resources

• Required Textbook: Algorithm Design by Jon Kleinberg and Éva Tardos.
You are encouraged and expected to read the book sections corresponding to each lecture, which present how to come up with individual algorithms, how to reason about them, construct proofs, and analyze their complexity. This will help you perform the same steps when solving problems.
• Optional: Companion slides for Kleinberg and Tardos
• Optional: Jeff Erickson. Algorithms
• Optional: Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein
Grading, requirements, exam schedule, and make-up policies (tentative, to be confirmed in the first lecture)
• Homework -- Individual mastery of learning goals (12%)
• Challenge Problems (21% + 2% self-assessment)
• Canvas quizzes for each topic (11%)
• Discussion participation (8%)
• Lecture questions (2%)
• Midterm 1 (13%), Tue 12 March, 7-9pm, ILC S331 Focus on first third of the class.
• Midterm 2 (13%), Thu 18 April, 7-9pm, ILC S331 Focus on second third of the class.
• Final (18%), Monday 13 May, 3:30-5:30pm (see Spring Final Exam Matrix) Covers all course material.
Homework exercises (biweekly) evaluate mastering the main learning goals and topics of the course. They should be done individually. You are of course encouraged to seek help from course staff if needed, but should eventually complete the problems on your own. Homework exercises are due before challenge problems and prepare you for the latter.
Challenge problems (also biweekly) focus on algorithm design. You are encouraged to collaborate in small groups on finding ideas for the solution, but each student must write their own solution, and no collaboration is allowed while writing the solution (see also Academic Honesty and Collaboration Policy below). You should start challenge problems as soon as the course material is covered, not only after submitting the homework exercises. Tentative due dates (subject to change) are Thu Feb 22, Thu Mar 7, Mon Apr 1, Thu Apr 11, Thu Apr 25, Thu May 1.
Challenge problems will be graded with ✓+, ✓, ✓-, ✗, based on the EMRN rubric of R. Talbert:
• ✓+: The work meets or exceeds assignment expectations. Communication is clear and complete. Mastery of the concepts is evident. There are no non-trivial errors. This could be used as a classroom example.
• ✓: Understanding of the concepts is evident through correct work and clear explanations. Some revision or expansion is needed, but no significant gaps or errors are present. No additional instruction on the concepts is needed.
• ✓-: Partial understanding of the concepts is evident, but there are significant gaps that remain. Needs further work, more review, and/or improved explanations.
• ✗: There is not enough information to determine if there is understanding of the concepts. The work is fragmentary, has significant omissions, or too many issues to correct individually.
We will assign at least 24 challenge problems during the semester, with full credit for earning 21 points (no extra credit). A ✓+ earns 1 point, ✓ earns 0.9 points, and a ✓- earns 0.5 points. You are therefore encouraged to focus on writing high-quality solutions to the problems you feel confident about, rather than vague solution attempts.
Self-assessment Solutions to challenge problems will be typically posted within a day of the deadline. For each attempted challenge problem, you are expected to submit (typically within 3 days after solutions are posted) a brief self-assessment, including the expected mark, ✓+, ✓, ✓-, or ✗, and a reflection on why you earned that mark (solution was on point; I made the following error ...; I incorrectly assumed that ...; I did not consider the case ...; I was confused by ...; I could have improved my answer by ... etc.).
Learning Goal Quizzes will posted weekly on Canvas, usually Mondays, for the material of the preceding week. Each quiz consists of 5-7 questions, usually multiple choice. Most questions can be attempted twice, with 50% of the score for the second attempt. Quizzes are graded as passed or failed: a quiz is graded as passed if you earn at least 70%. You should pass 11 out of 12 quizzes for full credit (no extra credit). A second quiz version will be posted mid-week. You may retake at most 4 quizzes.
Discussion work will be submitted at the end of each discussion, and graded with 1 point for a good attempt towards a solution, and 0.5p for a fragmentary attempt. The lowest two discussion scores will be dropped.
Lecture Questions will be scored 70% for participation and 30% for correct answers. The highest 20 lecture scores will count towards your grade.

Exam schedule and makeup policy This course will have two midterm exams and one final exam. You must notify both instructors in advance if you are unable to take the exams at the scheduled time (e.g., due to illness). If a severe accident prevents you from communicating (or asking someone else to do it), you must notify the instructors as soon as you are able to. Failure to do this and missing the exam results in a grade of zero.

90: A
86: A-
82: B+
78: B
74: B-
70: C+
66: C
62: C-
58: D+
54: D
These thresholds may be adjusted based on the overall performance in the course, but will not be more strict.

Attendance and late work submission policy

Communication policy and response frequency
We use Campuswire for communication. We will attempt to answer all questions within 24 hours and often much sooner. However, you should not rely on last-minute questions for help on homework. When needed, use private instructor-only posts rather than e-mail, this will make them more readily seen, and any of the staff team can answer them. For sensitive private matters, email the instructor.

You are encouraged to form study groups, learn and discuss the course material jointly with others.
You must do learning assessment quizzes, homework assignments and exams on your own.
You may collaborate with a few other students on challenge problems, provided that (a) you indicate anyone with whom you worked and (b) the final presentation is entirely your own. As a guideline, to distinguish discussion from plagiarism, it is useful to divide work into an "ideas phase", in which you can discuss problems (verbally or perhaps using a whiteboard) but do not leave with shared written matter, and a "writeup phase", which you do entirely on your own. If you have questions about this matter, please ask.
You are encouraged to ask public questions, in office hours or on Campuswire. Your questions and the answers to them can be useful for others as well (and you are encouraged to help with answers). Public questions about homework should be of a general nature (clarification, applicable course material, asking for hints), and not involve details of your solution attempt. Use private questions otherwise if needed.
This course assumes that all work submitted by students will be generated by the students themselves, working individually or in groups. Students should not have another person/entity do the writing of any portion of an assignment for them, which includes hiring a person or a company to write assignments and using artificial intelligence tools like ChatGPT.

As members of the College of Information and Computer Sciences at UMass Amherst we expect everyone to behave responsibly and honorably. In particular, we expect each of you not to give, receive, or use aid in examinations, nor to give, receive, or use unpermitted aid in any academic work. Doing your part in observing this code, and ensuring that others do likewise is essential for having a community of respect, integrity, fairness, and trust.
If you cheat in a course, you are taking away from your own opportunity to learn and develop as a professional. You also hurt your colleagues, and this will hurt people you will work with in the future, who expect an honest and responsible professional.
As faculty, we pledge to use academic policies designed for fairness, avoiding situations that are conducive to violating academic honesty, as well as unreasonable or unusual procedures that assume dishonesty.
We will follow the university's Academic Honesty Policy and Procedures established by the university to ensure that the learning environment is both honest and fair. Integrity is essential in all aspects of higher education, academic dishonesty is prohibited in all university programs, including this course. Academic dishonesty as defined by the University's Academic Honesty Policy includes but is not limited to:

• Cheating - the intentional use or attempted use of trickery or deception in one's academic work.
• Fabrication - intentional falsification and/or invention of any information or citation
• Plagiarism - knowingly representing the words or ideas of another as one's own work
• Facilitating Dishonesty - knowingly helping or attempting to help another commit an act of academic dishonesty.
Any violation of the Academic Honesty Policy could result in a failing grade in the course and initiation of the formal Academic Honesty Procedures of the University. Students are expected to be familiar with these policies, if you have any questions please email the course instructors for clarification.
The College of Information and Computer Sciences explicitly forbids any redistribution (including publicly available posting on an internet site) of any CICS course materials (including student solutions to course assignments, projects, exams, etc.) without the express written consent of the instructor of the course from which the materials come. Violations of this policy will be deemed instances of “facilitating dishonesty” (since a student making use of such materials would be guilty of plagiarism) and therefore may result in charges under the Academic Honesty Policy.

Supplementary student support resources
CICS has its own tutoring program, which allows you to get help from students who have taken the course in the past. Submit a request here (usually available starting the second weel of the semester). Tutoring is also provided by the Learning Resource Center. More student support resources are provided by the CCPH. If you feel you are struggling, do not hesitate to reach out to any of the course staff and we will help you find the best solution.

Accomodations
Both the University of Massachusetts Amherst and your course staff are committed to providing an equal educational opportunity for all students. If you have a physical, psychological, or learning disability documented with Disability Services, please communicate your needs to us in the first two weeks of the semester so that we may make any necessary accommodations. If you are not sure if you qualify for an accommodation or if you have any questions on the topic of accommodations please contact Disability Services for more information.

Equity and Inclusion Statement
We are committed to fostering a culture of diversity and inclusion, where everyone is treated with dignity and respect. This course is for everyone. This course is for you, regardless of your age, background, citizenship, disability, sex, education, ethnicity, family status, gender, gender identity, geographical origin, language, military experience, political views, race, religion, sexual orientation, socioeconomic status, or work experience.
Because of that, we should realize that we will be bringing different skills to the course, and we will all be learning from and with each other. We may have different background and skills in courses taken, mathematical, algorithmic, coding or testing background, ways to communicate orally and in writing, working alone or in groups, or plans for professional careers.
Please be kind and courteous. Respect that people have differences of opinion, and work and approach problems differently. There is seldom a single right answer to complicated questions. Please keep unstructured critique to a minimum; any criticism should be constructive.
Disruptive behavior is not welcome, and insulting, demeaning, or harassing anyone is unacceptable. In particular, we don't tolerate behavior that excludes people in socially marginalized groups. If you feel you have been or are being harassed or made uncomfortable by someone in this class, please contact a member of the course staff immediately, or if you feel uncomfortable doing so, contact the Dean of Students office.
This course is for all of us. We will all learn from each other. Welcome!

Use of chosen names and pronouns
Everyone has the right to be addressed by the name and pronouns that they use for themselves. Students can indicate their preferred/chosen first name and pronouns on SPIRE, which appear on class rosters. Please let me know what name and pronouns I should use for you if they are not on the roster. A student’s chosen name and pronouns are to be respected at all times in the classroom.

Title IX Statement
Title IX of the Education Amendments of 1972 is a federal civil rights law that prohibits discrimination on the basis of sex in any education program or activity that receives federal funding. Sex discrimination includes sexual harassment, sexual battery, sexual assault, and rape. Title IX applies to all public and private educational institutions receiving federal financial assistance.
If you have been the victim of sexual violence, gender discrimination, or sexual harassment, the university can provide you with a variety of support resources and accommodations. UMass is committed to providing these resources with minimal impact and costs to survivors on a case-by-case basis. Resources are available to survivors with or without them filing a complaint. No upfront costs are charged to any currently enrolled students for University Health Services or the Center for Counseling and Psychological Health, and no fees exist for services in the Dean of Students Office, the Center for Women and Community, Student Legal Services, or by live-in residential staff.

Schedule
This is a tentative schedule which might suffer changes.

1 Introduction and Stable Matching Chapter 1.1
2 Algorithm Analysis and Asymptotics Ch 2.1, 2.2
3 Algorithm Analysis, Graphs Ch 3.1, 3.2
4 Graphs Ch 3.3, 3.4
5 Graphs Ch 3.5, 3.6
6 Greedy Algorithms Ch 4.1
7 Greedy Algorithms Ch 4.2, 4.3
8 Greedy Algorithms Ch. 4.4
9 Greedy Algorithms Ch. 4.5, 4.6
10 Divide and Conquer Ch. 5.1, 5.2
11 Divide and Conquer Ch. 5.2, 5.3
12 Divide and Conquer Ch. 5.4, 5.5
13 Dynamic Programming Ch. 6.1, 6.2
14 Dynamic Programming Ch. 6.3, 6.4
15 Dynamic Programming Ch. 6.6
16 Dynamic Programming Ch. 6.8
17 Network Flow Ch. 7.1, 7.2
18 Network Flow Ch. 7.2, 7.3
19 Network Flow Ch. 7.5
20 Intractability Ch. 8.1
21 Intractability Ch. 8.2, 8.3
22 Intractability Ch 8.3
23 Intractability Ch 8.4
24 Approximation Algorithms Ch 11.1, 11.2
25 Randomized Algorithms Ch 13.1, 13.2, 13.4
26 Approximation/Randomization/Review