COMP 482: Design and Analysis
of Algorithms
Spring 2012
Lecture 10
Prof. Swarat Chaudhuri
Q1:Topologicalordering
Giveanextensionofthetopologicalsortalgorithmthatwestudiedinclassthatdoesthe
following.TheinputofthealgorithmisanarbitrarydirectedgraphGthatmay
Lecture'6'
CSE'331'
Sep'14,'2015'
Homeworks
'
HW 1 posted online: see piazza
Pickup graded HW 0 in TA OHs/recitations
Mini'Project
'
Can'you'guess'the'correlaDon?
'
Another'comment
'
Discomfort with proofs
I will not cover proof basics in class
Please rea
Lecture'5'
CSE'331'
Sep'11,'2015'
Submit'the'form'
I ll'need'conrma>on'in'wri>ng.'No'graded'material'will'be'handed'back'>ll'
I'get'this'signed'form'from'you!'
SignGup'for'mini'projects
'
Email me your group (=7) composition + your chosen algorithm
Homewo
Lecture'7'
CSE'331'
Sep'16,'2015'
Read'the'rubric'for'HW'1
'
[email protected]'on'sources
'
Solutions from previous years are NOT OK
GaleDShapley'Algorithm'
[email protected]'all'men'and'women'are'free'
While'there'exists'a'free'woman'who'can'propose'
Let'w'be'such'a'woma
Lecture'13'
CSE'331'
Sep'30,'2015'
One'more'week'for'mini'project'
choice'
Connec<vity'Problem
'
Input: Graph G = (V,E) and s in V
Output: All t connected to s in G
Breadth'First'Search'(BFS)'
Build'layers'of'ver<ces'connected'to's'
L0'='cfw_s'
Assume'L0,
Lecture'9'
CSE'331'
Sep'21,'2015'
Solu5ons'to'HW1'
'
Feel free to pick them up from the desk upfront
Run'5me'of'an'algorithm
'
(Worst-case) run time T(N) for input size N
Maximum number of steps taken by the algorithm for
any input of size N
g(n)'is'O(f(n
Lecture'16'
CSE'331'
Oct'7,'2015'
MINI'PROJECT'GROUP/ALGO'DUE'
TONIGHT
'
Sample'midFterm'exams
'
A more detailed post over the weekend
Reading'Assignment'
Sec'3.3,'3.4'and'3.5'of'[KT]'
Directed'graphs'
Model'asymmetric'relaTonships'
Precedence'relaTonship
Lecture'11'
CSE'331'
Sep'25,'2015'
HW'2'due'today'
Place'Q1,'Q2'and'Q3'in'separate'piles!
Submit'your'HWs'to'the'side'of'the'table'
I'will'not'accept'HWs'[email protected]'1:15pm'
Other'HW'related'stu
'
HW 3 has been posted online: see piazza
Solutions to HW 2 at the
Lecture'8'
CSE'331'
Sep'18,'2015'
HW'1'due'today'
Place'Q1,'Q2'and'Q3'in'separate'piles!
I'will'not'accept'HWs'aAer'1:15pm'
Need'a'peer'noteEtaker
'
Other'HW'related'stu
'
HW 2 has been posted online: see piazza
Solutions to HW 1 at the END of the lecture
Lecture'14'
CSE'331'
Oct'2,'2015'
HW'3'due'today'
Place'Q1,'Q2'and'Q3'in'separate'piles!
Submit'your'HWs'to'the'side'of'the'table
'
I'will'not'accept'HWs'aBer'1:15pm'
Other'HW'related'stu
'
HW 4 has been posted online: see piazza
Solutions to HW 3 at the
Lecture'20'
CSE'331'
Oct'16,'2015'
HW'5'due'today'
Place'Q1,'Q2'and'Q3'in'separate'piles!
Submit'your'HWs'to'the'side'of'the'table'
I'will'not'accept'HWs'aBer'1:15pm'
Other'HW'related'stu
'
Solutions to HW 5 at the END of the lecture
Graded HW 4 available
Lecture'17'
CSE'331'
Oct'9,'2015'
HW'4'due'today'
Place'Q1,'Q2'and'Q3'in'separate'piles!
Submit'your'HWs'to'the'side'of'the'table'
I'will'not'accept'HWs'aDer'1:15pm'
Other'HW'related'stu
'
HW 5 has been posted online: see piazza
Solutions to HW 4 at the E
Lecture'19'
CSE'331'
Oct'14,'2015'
Feedback
'
Quiz'#1
'
Will hand them out at the END of lecture
Interval'Scheduling'Problem'
Input: n intervals [s(i), f(i) for 1 i n
Output: A schedule S of the n intervals
No two intervals in S conflict
|S| is maximized
Lecture 21
CSE 331
Oct 23, 2015
RSVP for Chunmings address!
Handing back HWs
Apologies for the mis-steps so far
TAs will ensure that if promised, HWs will be available for pickup
Have a more streamlined process for picking up HWs
Grad
1. (12 pts total) Solving Recurrences. Give tight asymptotic bounds for the following recur—
renms. Justify your answers by working out the details or by appealing to a, case of the master
theorem.
(3] (4 pts) Tm) = QT(n/4) + n2
r
:4 f.
h 4
1
I! “3": ﬂ _a
1. (3-0 pts total, 5 pts each) Graph Algorithms.
Consider the following undirected graph:
(a) Draw the breadth-ﬁret—semch (BFS) tree resulting from running; the BF 5 algorithm on the
graph above, starting with uncle :1. Assume that nodes are considered