CSC 1700 Analysis of Algorithms: P and NP Problems Professor Henry Carter Fall 2016
Recap Algorithmic power is broad but limited Lower bounds determine whether an algorithm can be improved by more than a constant factor Established through input size, problem reduction, adversarial generation, and information-theoretic decision trees 2
Quantifying Difficulty Is the problem solvable? Is the problem solvable in polynomial time? Foundational questions in computational complexity 3
Decision Problems To simplify analysis, complexity questions are frequently applied to decision problems Examples: Does the program halt? Can the graph be colored with no more than m colors? Many problems in computing can be reduced to a series of decision problems Find the minimum number of colors needed to color a graph 4
Decidability Is the problem solvable? Many decision problems cannot be solved with any algorithm Alan Turing's halting problem is undecidable 5
Halting Problem 6
Tractability Is the problem solvable in polynomial time? Proof: give a (deterministic) polynomial time algorithm Abstractly represented as all problems in the set P Contains many of the problems we've already examined 7
NP Problems Problems with no known polynomial-time solution Specifically, problems solvable using the following nondeterministic algorithm: Randomly generate a solution Deterministically check the correctness of the solution P is a subset of NP How? 8
Examples Hamiltonian circuit Traveling Salesman Knapsack problem Partition problem Bin packing problem Graph-coloring problem Integer linear programming 9
NP-Complete Representative problems in NP Require two characteristics: A belongs to class NP All problems in NP are polynomially reducible to A How do we prove these characteristics? 10
CNF-SAT Conjunctive normal form satisfiability Problem Statement First NP-Complete problem to be proven Cook-Levin theorem proves all NP problems reduce to CNF-SAT using Turing machine notation (x 1 _ x 2 _ x 3 ) ^ (x 1 _ x 2 ) ^ (x 1 _ x 2 _ x 3 ) 11
P = NP? Most computer scientists believe P is a strict subset of NP If a polynomial solution is found for any NP-Complete problem, then P = NP A $1 million dollar reward for such an algorithm has been promised by the Clay Mathematics Institute 12
Practice A game of chess can be posed as the following decision problem: given a legal positioning of chess pieces and information about which side is to move, determine whether that side can win. Is this decision problem decidable? 13
Practice A certain problem can be solved using an algorithm whose running time is in O(n log n ). Is the problem tractable or not? Can we be certain? 14
Recap Computational complexity examines questions of whether problems can be solved and how fast P and NP represent problems that can be solved in polynomial time and problems that can be checked in polynomial time, respectively NP-Complete problems represent NP as all NP problems reduce to any NP-Complete problem A polynomial solution to an NP-complete problem will shatter the scientific community and probably earn you an instant doctorate 15
Next Time... Levitin Chapter 11.4 Remember, you need to read it BEFORE you come to class! Homework: 11.3: 6, 7, 8, 11 16