cse p521: applied algorithms - homes.cs.washington.edu

24
CSE P521: Applied Algorithms Instructor: Prof. James R. Lee TAs: Evan McCarty (head), Jeffrey Hon Office hours: TBA Grading: 5-6 Homeworks (60%), Project (40%) Homework will be assigned on Thursdays; due next Thursday There will be a homework out tomorrow. Collaboration policy on website; all homework submitted electronically [Prefer typeset solutions; scans of neat handwriting acceptable] Project will be described in 3 rd lecture; must work in pairs Class e-mail list: Sign up at course site if you didnโ€™t receive โ€œhelloโ€ email Discussion board: Accessible from course homepage; intended for โ€œunsupervisedโ€ discussion of course topics

Upload: others

Post on 01-Dec-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

CSE P521: Applied Algorithms

Instructor: Prof. James R. LeeTAs: Evan McCarty (head), Jeffrey Hon

Office hours: TBA

Grading: 5-6 Homeworks (60%), Project (40%)

Homework will be assigned on Thursdays; due next ThursdayThere will be a homework out tomorrow.Collaboration policy on website; all homework submitted electronically

[Prefer typeset solutions; scans of neat handwriting acceptable]

Project will be described in 3rd lecture; must work in pairs

Class e-mail list: Sign up at course site if you didnโ€™t receive โ€œhelloโ€ email

Discussion board: Accessible from course homepage; intended for โ€œunsupervisedโ€ discussion of course topics

CSE P521: Applied Algorithms

Instructor: Prof. James R. LeeTAs: Evan McCarty (head), Jeffrey Hon

Office hours: TBA

Expected background: discrete math (CSE 311)basic probability theory (CSE 312)undergrad algs & data structures (CSE 332)โ€œmathematical maturityโ€ [this is a theory course]

Course materials: There is no textbookLecture notes and supplementary reading posted on course siteSome lectures will have required preparatory reading [will send email]

Questions?

what is this course about?

Modern algorithms

Inputs are huge, noisy, dynamic, incomplete, high-dimensional, arrive online

Approximation, randomization

Nuanced tradeoffs: Efficiency, profit, correctness

Tools of algorithmic analysis

Course cannot be comprehensive

Goal is exposure to a sample of key ideas, techniques, philosophies

Mathematical explanations

Prove that things work when we can

Develop a theoretical framework for understanding/designing solutions

what is this course about?

HashingUniversal and perfect hashingLoad balancing, the power of two choicesStreaming algorithmsLocality sensitive hashing, high-dimensional search

Spectral algorithmsSingular-value decomposition (SVD)Principal component analysisSpectral partitioning

Linear programmingFormulating LPs; relaxations and approximationDuality theoryGradient descent

Online optimizationRegret minimizationBoosting, multiplicative weights

Algorithmic game theoryAlgorithms in the face of economic incentivesExploiting selfish agents

Kargerโ€™s randomized min cuts

The Global Min-cut problem

Input: An undirected graph ๐บ = (๐‘‰, ๐ธ)

Output: A partition of the graph into two pieces ๐‘‰ = ๐‘† โˆช าง๐‘†so the number of cut edges is minimized

Contraction operation:For an edge ๐‘’ โˆˆ ๐ธ, write ๐บ/๐‘’ for the new graph formed by contracting the edge ๐‘’.

โ‡’

Kargerโ€™s randomized min cuts

Contraction operation:For an edge ๐‘’ โˆˆ ๐ธ, write ๐บ/๐‘’ for the new graph formed by contracting the edge ๐‘’.

โ‡’

Kargerโ€™s randomized min cuts

Kargerโ€™s randomized min cuts

How many times does the while loop execute?

๐‘‰ โˆ’ 2 times

Kargerโ€™s randomized min cuts

Kargerโ€™s randomized min cuts

analysis

analysis

analysis

Theorem: For any min-cut ๐‘†, าง๐‘† , Kargerโ€™s algorithm returns ๐‘†, าง๐‘† with probability at least1๐‘›2

=2

๐‘› ๐‘› โˆ’ 1

Corollary: Any graph has at most ๐‘›2

global min-cuts.

analysis

Theorem: For any min-cut ๐‘†, าง๐‘† , Kargerโ€™s algorithm returns ๐‘†, าง๐‘† with probability at least1๐‘›2

=2

๐‘› ๐‘› โˆ’ 1

If we run the algorithm ๐พ times and output the smallest cut from all ๐พ runs, the probability we fail to find a min cut is at most:

analysis

Theorem: If we run the algorithm ๐พ โ‰ˆ ๐‘›2 log ๐‘› times, then

Pr find a min cut โ‰ฅ 1 โˆ’ 1/๐‘›2

Total running time?One run can be implemented to run in time ๐‘‚(๐‘›2), so the total running time is ๐‘‚ ๐‘›4 log ๐‘› [pretty slow]

one way to implement

For fans of undergraduate algorithms:Can use Kruskalโ€™s algorithm for minimum spanning trees.

one way to implement

For fans of undergraduate algorithms:Can use Kruskalโ€™s algorithm for minimum spanning trees.

analysis

Theorem: If we run the algorithm ๐พ โ‰ˆ ๐‘›2 log ๐‘› times, then

Pr find a min cut โ‰ฅ 1 โˆ’ 1/๐‘›2

Total running time?One run can be implemented to run in time ๐‘‚(๐‘›2), so the total running time is ๐‘‚ ๐‘›4 log ๐‘› [pretty slow]

Improvement:There is an algorithm that runs in time ๐‘‚ ๐‘›2 log ๐‘› 3 and finds a global min-cut with probability close to 1.

EXERCISE

For any ๐‘˜ < ๐‘›: Pr ยฌ๐’œ1 โˆง ยฌ๐’œ2 โˆง โ‹ฏโˆง ยฌ๐’œ๐‘˜ โ‰ฅ

๐‘˜2๐‘›2

Observation:

Therefore if ๐‘˜ โ‰ˆ ๐‘›/ 2, then the probability a min-cut ๐‘†, าง๐‘†

remains after ๐‘˜ steps is at least

๐‘˜ ๐‘˜ โˆ’ 12

๐‘› ๐‘› โˆ’ 12

โ‰ˆ

๐‘›

2

2

๐‘›2=1

2

Kargerโ€™s randomized min cuts

EXERCISE

Therefore if ๐‘˜ โ‰ˆ ๐‘›/ 2, then the probability a min-cut ๐‘†, าง๐‘†

remains after ๐‘˜ steps is at least

๐‘˜ ๐‘˜ โˆ’ 12

๐‘› ๐‘› โˆ’ 12

โ‰ˆ

๐‘›

2

2

๐‘›2=1

2

So things are going better early onโ€ฆ

How to exploit this for a much faster algorithm?

For any ๐‘˜ < ๐‘›: Pr ยฌ๐’œ1 โˆง ยฌ๐’œ2 โˆง โ‹ฏโˆง ยฌ๐’œ๐‘˜ โ‰ฅ

๐‘˜2๐‘›2

Observation:

Karger-Stein algorithm

Probability we find a specific min-cut ๐‘†, าง๐‘† is given by the recurrence relation:

๐‘ ๐‘› = 1 โˆ’ 1 โˆ’1

2๐‘ 1 +

๐‘›

2

2

Running time of fastmincut:

๐‘‡ ๐‘› = 2๐‘‡ 1 +๐‘›

2+ ๐‘‚ ๐‘›2

after the break: hashing and sketching

โ‡’