UIUClecture13 - CS 473: Algorithms Chandra Chekuri...

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

View Full Document Right Arrow Icon
CS 473: Algorithms Chandra Chekuri chekuri@cs.uiuc.edu 3228 Siebel Center University of Illinois, Urbana-Champaign Fall 2008 Chekuri CS473ug
Background image of page 1

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

View Full DocumentRight Arrow Icon
Part I Recap Chekuri CS473ug
Background image of page 2
Weighted Interval Scheduling Input A set of jobs with start times, finish times and weights (or profits) 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Weighted Interval Scheduling Input A set of jobs with start times, finish times and weights (or profits) 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
Background image of page 4
Conventions Definition Let the requests be sorted according to finish time, i.e., i < j implies f i f j Define p ( j ) to be the largest i (less than j ) such that job i and job j are not in conflict 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
Background image of page 5

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

View Full DocumentRight Arrow Icon
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 first p ( n ) jobs. Case n 6∈ O O is an optimal schedule for the first n - 1 jobs! Chekuri CS473ug
Background image of page 6
A Recursive Algorithm Notation: O i value of an optimal schedule for the first 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
Background image of page 7

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

View Full DocumentRight Arrow Icon
Memo(r)ization Observation Number of different 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 different sub-problems, and perform recursive call only if not already computed. Chekuri CS473ug
Background image of page 8
Maximum Independent Set in a Graph Definition 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
Background image of page 9

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

View Full DocumentRight Arrow Icon
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
Background image of page 10
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
Background image of page 11

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

View Full DocumentRight Arrow Icon
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
Background image of page 12
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
Background image of page 13

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

View Full DocumentRight Arrow Icon
Interval Scheduling and Independent Set Claim: (Weighted) Interval Scheduling is a special case of Maximum (Weight) Independent Set.
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online