Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3.

Similar presentations


Presentation on theme: "CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3."— Presentation transcript:

1 CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3

2 Five Representative Problems Show the types of problems we will be considering in the class Similar looking problems with very different characteristics Problems –Scheduling –Weighted Scheduling –Bipartite Matching –Maximum Independent Set –Competitive Facility Location

3 Interval Scheduling Input: Set of jobs with start and finish times Goal: Find maximum cardinality subset of mutually compatible jobs Time 01234567891011 f g h e a b c d h e b jobs don't overlap

4 Interval Scheduling n log n greedy algorithm

5 Suppose We Add Values? 251 1241 316

6 Weighted Interval Scheduling Input: Set of jobs with start, finish, and weights Goal: Find maximum weight subset of mutually compatible jobs Time 01234567891011 20 11 16 13 23 12 20 26 n log n dynamic programming algorithm

7 Bipartite Matching Input: Bipartite graph –A graph G = (V, E) is bipartite if V can be partitioned into sets X and Y such that every edge in E has one end in X and the other end in Y Goal: Find maximum cardinality matching –A matching is M  E with property that each node in V appears in at most one edge of M C 1 5 2 A E 3 B D4 professors courses can teach

8 Bipartite Matching C 1 5 2 A E 3 B D4

9 Find a Maximum Matching n k max-flow based algorithm

10 Independent Set Input: Graph Goal: Find maximum cardinality independent set 6 2 5 1 7 3 4 6 5 1 4 subset of nodes such that no two joined by an edge

11 Find a Maximum Independent Set NP-complete No efficient algorithm is known, and it is conjectured that no such algorithm exists

12 Key characteristics Hard to find a solution Easy to verify a solution once you have one Other problems like this –Hamiltonian circuit –Clique –Subset sum –Graph coloring

13 NP-Completeness Theory of Hard Problems A large number of problems are known to be equivalent Very elegant theory

14 Are There Even Harder Problems? Simple game: –Players alternating selecting nodes in a graph Score points associated with node Remove node’s neighbors –When neither can move, player with most points wins

15 Competitive Facility Location For a particular player P i, is there a strategy so that, no matter how the other players play, P i will be able to select a set of nodes with a total value of at least X? Hard to convince someone of the answer to this question (i.e., no short proof, lengthy case-by-case analysis), compare with Independent Set Problem PSPACE-complete


Download ppt "CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3."

Similar presentations


Ads by Google