cs 473: algorithms - university of illinois · 2 broadly applicable techniques in algorithm design...

24
CS 473: Algorithms Ruta Mehta University of Illinois, Urbana-Champaign Spring 2018 Ruta (UIUC) CS473 1 Spring 2018 1 / 20

Upload: others

Post on 15-Jun-2020

17 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

CS 473: Algorithms

Ruta Mehta

University of Illinois, Urbana-Champaign

Spring 2018

Ruta (UIUC) CS473 1 Spring 2018 1 / 20

Page 2: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

CS 473: Algorithms, Spring 2018

Administrivia, IntroductionLecture 1Jan 16, 2018

Some of the slides are courtesy Prof. Chekuri

Ruta (UIUC) CS473 2 Spring 2018 2 / 20

Page 3: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Part I

Administrivia

Ruta (UIUC) CS473 3 Spring 2018 3 / 20

Page 4: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Instructional Staff

1 Instructors: Ruta Mehta

2 Teaching Assistants: Shant Boodaghian and Vasilis Livanos

3 Graders: TBD

4 Office hours: See course webpage

5 Email: Use private notes on Piazza to reach course staff.

Ruta (UIUC) CS473 4 Spring 2018 4 / 20

Page 5: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Online resources

1 Webpage: General information, lecture schedule/slides/notes,homeworks, course policiescourses.engr.illinois.edu/cs473

2 Gradescope: HW submission, grading, regrade requests

3 Moodle: HW solutions, grades

4 Piazza: Announcements, online questions and discussion,contacting course staff (via private notes)

See course webpage for links

Important: check Piazza/course web page at least once each day

Ruta (UIUC) CS473 5 Spring 2018 5 / 20

Page 6: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Prerequisites

1 Prerequisites: CS 173 (discrete math), CS 225 (data structures),CS 374 (algorithms and models of computation) or sufficientmathematical maturity

2 Concretely:1 Good ability to write formal proofs of correctness2 Comfort with recursive thinking/algorithms, reductions3 Comfort with basic data structures: balanced binary search

trees, priority queues, heaps, etc.4 Basic graph algorithms: reachability (DFS/BFS), undirected vs

directed, strong connected components, shortest paths andDijkstra’s algorithm, minimum spanning trees

5 Probability: random variables, expectation, variance6 Exposure to models of computation and NP-Completeness

(optional but will help)

Ruta (UIUC) CS473 6 Spring 2018 6 / 20

Page 7: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Textbooks and Resources

No one specific textbook for the course.

1 Recommended books: (not required)1 Algorithms by Dasgupta, Papadimitriou & Vazirani.

Available online for free!2 Algorithm Design by Kleinberg & Tardos

2 Lecture notes/slides/pointers: available on course web-page3 Additional References

1 Lecture notes of Jeff Erickson, Timothy Chan, Sariel HarPeled,and others

2 Computers and Intractability: Garey and Johnson.

Ruta (UIUC) CS473 7 Spring 2018 7 / 20

Page 8: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Grading Policy: Overview

1 Homeworks: 25%

2 Midterms: 45% (2× 22.5%)

3 Finals: 30% (covers the full course content)

Midterms dates:

1 Midterm 1: Mon, Feb 26, 7–9pm, 1320 DCL

2 Midterm 2: Mon, Apr 9, 7–9pm, 1320 DCL

3 Final Exam: Fri, May 11

No conflict exam offered unless you have a valid reason (see coursewebpage).

Ruta (UIUC) CS473 8 Spring 2018 8 / 20

Page 9: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Homeworks

1 One homework every week: Due on Wednesday at 8pm. To besubmitted electronically in pdf form in Gradescope. Assigned atleast a week in advance.

2 Homeworks can be worked on in groups of up to 3 and eachgroup submits one written solution (except Homework 0).

3 Important: academic integrity policies. See course web page.

Ruta (UIUC) CS473 9 Spring 2018 9 / 20

Page 10: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

More on Homeworks

1 No extensions or late homeworks accepted.

2 To compensate, five problems will be dropped. Homeworkstypically have three problems each.

3 Important: Read homework faq/instructions on website.

Ruta (UIUC) CS473 10 Spring 2018 10 / 20

Page 11: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Advice

1 Attend lectures, please ask plenty of questions.

2 Don’t skip homework and don’t copy homework solutions.

3 Study regularly and keep up with the course.

4 This is a course on problem solving. Solve as many as you can!Books/notes have plenty.

5 Ask for help promptly. Make use of office hours/Piazza.

6 This is an optional mixed undergrad/grad course.(Mathematical) maturity and independence are expected.

Ruta (UIUC) CS473 11 Spring 2018 11 / 20

Page 12: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Homework 0

1 HW 0 is posted on the class website.

2 HW 0 due on Wednesday Jan 24 at 8pm

3 HW 0 to be done and submitted individually.

Ruta (UIUC) CS473 12 Spring 2018 12 / 20

Page 13: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Miscellaneous

Please contact instructors if you need special accommodations.

Lectures are being taped. A link to the videos will be put up oncourse webpage.

Emergencies: see information at link http://police.illinois.

edu/dpsapp/wp-content/uploads/2017/12/CEOP-2017.pdf

Ruta (UIUC) CS473 13 Spring 2018 13 / 20

Page 14: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Part II

Course Goals and Overview

Ruta (UIUC) CS473 14 Spring 2018 14 / 20

Page 15: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Course Structure

Course divided into four parts:

1 Recursion, dynamic programming.

2 Randomization in algorithms

3 Combinatorial and Discrete Optimization: flows/cuts,matchings, introduction to linear and convex programming

4 Intractability and heuristics

Ruta (UIUC) CS473 15 Spring 2018 15 / 20

Page 16: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Course Goals

Mostly algorithms:1 Some fundamental problems and algorithms

1 FFT, Hashing, Flows/Cuts, Matchings, LP, approximation, . . .

2 Broadly applicable techniques in algorithm design1 Recursion, Divide and Conquer, Dynamic Programming2 Randomization in algorithms and data structures3 Optimization via convexity and duality4 Approximation and heuristics5 Role of mathematics in algorithm design: graph theory, (linear)

algebra, geometry, convexity · · ·

Ruta (UIUC) CS473 16 Spring 2018 16 / 20

Page 17: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

P: class of problems that can solved in polynomial time

EXP: class of problems that can be solved in exponential time

NP: non-deterministic polynomial-time.

DECIDABLE : class of problems that have an algorithm

TheoremThere exist (many) undecidable problems.

TheoremP is a strict subset of EXP.

P ⊆ NP ⊆ EXP. Major open problem: Is P = NP?Many useful and important problems are intractable: NPComplete,EXPComplete, UNDECIDABLE .

Ruta (UIUC) CS473 17 Spring 2018 17 / 20

Page 18: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

P: class of problems that can solved in polynomial time

EXP: class of problems that can be solved in exponential time

NP: non-deterministic polynomial-time.

DECIDABLE : class of problems that have an algorithm

TheoremThere exist (many) undecidable problems.

TheoremP is a strict subset of EXP.

P ⊆ NP ⊆ EXP. Major open problem: Is P = NP?Many useful and important problems are intractable: NPComplete,EXPComplete, UNDECIDABLE .

Ruta (UIUC) CS473 17 Spring 2018 17 / 20

Page 19: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

P: class of problems that can solved in polynomial time

EXP: class of problems that can be solved in exponential time

NP: non-deterministic polynomial-time.

DECIDABLE : class of problems that have an algorithm

TheoremThere exist (many) undecidable problems.

TheoremP is a strict subset of EXP.

P ⊆ NP ⊆ EXP. Major open problem: Is P = NP?Many useful and important problems are intractable: NPComplete,EXPComplete, UNDECIDABLE .

Ruta (UIUC) CS473 17 Spring 2018 17 / 20

Page 20: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

P: class of problems that can solved in polynomial time

EXP: class of problems that can be solved in exponential time

NP: non-deterministic polynomial-time.

DECIDABLE : class of problems that have an algorithm

TheoremThere exist (many) undecidable problems.

TheoremP is a strict subset of EXP.

P ⊆ NP ⊆ EXP. Major open problem: Is P = NP?

Many useful and important problems are intractable: NPComplete,EXPComplete, UNDECIDABLE .

Ruta (UIUC) CS473 17 Spring 2018 17 / 20

Page 21: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

P: class of problems that can solved in polynomial time

EXP: class of problems that can be solved in exponential time

NP: non-deterministic polynomial-time.

DECIDABLE : class of problems that have an algorithm

TheoremThere exist (many) undecidable problems.

TheoremP is a strict subset of EXP.

P ⊆ NP ⊆ EXP. Major open problem: Is P = NP?Many useful and important problems are intractable: NPComplete,EXPComplete, UNDECIDABLE .

Ruta (UIUC) CS473 17 Spring 2018 17 / 20

Page 22: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Complexity and Algorithms

Goals of algorithm desgin.

find the “best” possible algorithm for some spefic problems ofinterest

develop broadly applicable techniques for algorithm design

Goals of complexity:

prove lower bounds for specific problems

develop broadly applicable techniques for proving lower bounds

develop complexity classes to characterize many problems

Rich interplay between the two areas.

Ruta (UIUC) CS473 18 Spring 2018 18 / 20

Page 23: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Important Ingredients in Algorithm Design

1 What is the problem (really)?1 What is the input? How is it represented?2 What is the output?

2 What is the model of computation? What basic operations areallowed?

3 Algorithm designUnderstand the structure of the problemRelate it to standard and known problems via reductionsTry algorithmic paradigms: recursion, divide and conquer,dynamic programming, greedy, convex optimization, · · ·Failing, try to prove a lower bound via reduction to existinghard problems or settle for approximation, heuristics.

4 Proving correctness of algorithm5 Analysis of time and space complexity6 Algorithmic engineering

Ruta (UIUC) CS473 19 Spring 2018 19 / 20

Page 24: CS 473: Algorithms - University Of Illinois · 2 Broadly applicable techniques in algorithm design 1 Recursion, Divide and Conquer, Dynamic Programming 2 Randomization in algorithms

Recall: Time (Space) Complexity and Notations

Representing running time of an algorithm on an n sized input:

Upper bound O(f (n)): Takes at most c · f (n) time for someconstant c ∈ R+.

Lower bound Ω(f (n)): Takes at least c · f (n) time for someconstant c ∈ R+.

Tight bound Θ(f (n)): Takes at least c · f (n) and at mostc ′ · f (n) time for some c, c ′ ∈ R+.

Ruta (UIUC) CS473 20 Spring 2018 20 / 20