{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

UIUClecture13

# UIUClecture13 - CS 473 Algorithms Chandra Chekuri...

This preview shows pages 1–15. Sign up to view the full content.

CS 473: Algorithms Chandra Chekuri [email protected] 3228 Siebel Center University of Illinois, Urbana-Champaign Fall 2008 Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Part I Recap Chekuri CS473ug
Weighted Interval Scheduling Input A set of jobs with start times, ﬁnish times and weights (or proﬁts) Goal Schedule jobs so that total weight of jobs is maximized Two jobs with overlapping intervals cannot both be scheduled! 2 1 2 3 1 4 10 10 1 1 Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Weighted Interval Scheduling Input A set of jobs with start times, ﬁnish times and weights (or proﬁts) Goal Schedule jobs so that total weight of jobs is maximized Two jobs with overlapping intervals cannot both be scheduled! 2 1 2 3 1 4 10 10 1 1 Chekuri CS473ug
Conventions Deﬁnition Let the requests be sorted according to ﬁnish time, i.e., i < j implies f i f j Deﬁne p ( j ) to be the largest i (less than j ) such that job i and job j are not in conﬂict Example 1 2 3 4 5 6 v 1 = 2 v 2 = 4 v 3 = 4 v 4 = 7 v 5 = 2 v 6 = 1 p (1) = 0 p (2) = 0 p (3) = 1 p (4) = 0 p (5) = 3 p (6) = 3 Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Towards a Recursive Solution Observation Consider an optimal schedule O Case n ∈ O None of the jobs between n and p ( n ) can be scheduled. Moreover O must contain an optimal schedule for the ﬁrst p ( n ) jobs. Case n 6∈ O O is an optimal schedule for the ﬁrst n - 1 jobs! Chekuri CS473ug
A Recursive Algorithm Notation: O i value of an optimal schedule for the ﬁrst i jobs. Recursively compute O p ( n ) Recursively compute O n - 1 If ( O p ( n ) + v n < O n - 1 ) then O n = O n - 1 else O n = O p ( n ) + v n Output O n Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Memo(r)ization Observation Number of diﬀerent sub-problems in recursive algorithm is n; they are O 1 , O 2 , . . . , O n - 1 , O n Exponential time of naive recursive algorithm is due to recomputation of solutions to sub-problems Solution Store optimal solution to diﬀerent sub-problems, and perform recursive call only if not already computed. Chekuri CS473ug
Maximum Independent Set in a Graph Deﬁnition Given undirected graph G = ( V , E ) a subset of nodes S V is an independent set (also called a stable set) if for there are no edges between nodes in S . That is, if u , v S then ( u , v ) 6∈ E . A B C D E F In above graph: { A , C } , { A , C , F } , { B , E , F } are independent. Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Maximum Independent Set Problem Input Graph G = ( V , E ) Goal Find maximum sized independent set in G A B C D E F Chekuri CS473ug
Maximum Independent Set Problem Input Graph G = ( V , E ) Goal Find maximum sized independent set in G A B C D E F MIS in above graph has size 3: { B , E , F } or { A , C , F } Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Maximum Weight Independent Set Problem Input Graph G = ( V , E ) and weights w ( v ) 0 for each v V Goal Find maximum weight independent set in G A B C D E F 20 5 2 2 10 15 Chekuri CS473ug
Maximum Weight Independent Set Problem Input Graph G = ( V , E ) and weights w ( v ) 0 for each v V Goal Find maximum weight independent set in G A B C D E F 20 5 2 2 10 15 Maximum weight independent set in above graph: { B , D } Chekuri CS473ug

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Interval Scheduling and Independent Set Claim: (Weighted) Interval Scheduling is a special case of Maximum (Weight) Independent Set.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 78

UIUClecture13 - CS 473 Algorithms Chandra Chekuri...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online