Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.

Similar presentations


Presentation on theme: "1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014."— Presentation transcript:

1 1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014

2 2 Course Outline Introduction and basic concepts Asymptotic notation Greedy algorithms Graph theory Amortized analysis Recursion Divide-and-conquer algorithms Randomized algorithms Dynamic programming algorithms NP-completeness

3 3 Schedule Monday: BC Day, no classes Wednesday: Quiz 5 (NP and NP completeness) Review: Amortized Analysis Friday: Survey (bonus marks) Review: probably Graph Theory and Dynamic Programming

4 4 NP Completeness

5 5 Recap We are working on problems, not algorithms Our focus now is on decision problems (yes/no), not optimization problems We distinguish “finding” a solution and “checking” a solution Classes: P: decision problems that are solvable in polynomial time NP: decision problems for which a given certificate can be checked in polynomial time NP hard: at least as “hard” as any problem in NP NP complete (NPC): both NP and NP hard

6 6 NP complete NPC problems: have no known algorithm that runs in polynomial time There is no proof that such an algorithm doesn’t exist Examples: Hamiltonian path: path that traverses all nodes exactly once 3-SAT: assign values to Boolean variables that satisfy a set of clauses Graph coloring: assign colors to graphs, adjacent nodes have different colors Cook’s theorem (paraphrased): if the satisfiability problem can be solved in polynomial time, any problem in NP can be solved in polynomial time

7 7 NP complete Why is it useful to know a problem is NP complete? So you can stop looking for trivial answers Focus on heuristics or local optimality Evaluate pseudo-polynomial options

8 8 NPC Proof

9 9 Clique

10 10 Clique – NPC proof

11 11 Clique – NPC proof

12 12 Hamiltonian Path

13 13 Hamiltonian Path – NPC proof

14 14 Hamiltonian Path – NPC proof

15 15 Traveling Salesman Problem

16 16 Traveling Salesman Problem

17 17 Traveling Salesman Problem

18 18 Subset Sum


Download ppt "1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014."

Similar presentations


Ads by Google