Lecture 24-26

# Introduction to Algorithms, Second Edition

• Notes
• davidvictor
• 8

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

The University of Texas at Austin NP-completeness Department of Computer Sciences Professor Vijaya Ramachandran Lectures 24-26 CS357: ALGORITHMS, Spring 2006 1 Feasible Computation So far, we have been looking at designing algorithms that are as efficient as possible (prefer- ably linear in the size of the input, or within a constant factor of a lower bound for the computation time). We will work with a more relaxed notion of efficiency where any algo- rithm whose running time is polynomial in the size of the input is an efficient algorithm or a feasible computation . Some of the reasons for equating polynomial time with feasible computation are the following. Growth rate of a polynomial does not have the explosive growth rate of an exponential function. Although some polynomials, e.g., n 100 do not represent a running time that is in any way feasible, in practice , virtually every natural problem for which a polynomial-time algorithm has been developed has a running time that is a small power of the input size. Polynomials have nice closure properties – the addition or multiplication of two poly- nomials is a polynomial, as is functional composition. Polynomial time remains invariant across machine models, e.g., any computation run- ning in polynomial time on a RAM (the underlying machine model for our pseudocodes) will also run in polynomial time on the Turing machine. 1.1 Decision Problems A decision problem is a problem with yes/no answers. Hence in a decision problem, we can equivalently talk of the language associated with the decision problem, namely, the set of inputs for which the answer is yes. Typically, we assume that the input is coded in binary, so the set of all possible inputs is { 0 , 1 } and the language associated with a decision problem Q is L ( Q ) = { x ∈ { 0 , 1 } | the answer is yes for problem Q on input x }

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

2 The Classes P and NP We define P as the class of decision problems that are solvable by algorithms that run in time polynomial in the length of the input. We will next define the class NP , or Nondeterministic Polynomial Time . Before we can define this class, we need some definitions. Verification Algorithm. A verification algorithm is an algorithm A , that takes two inputs: an ordinary input x (coded in binary), and a certificate y , and outputs a 1 on certain combinations of x and y . Verification algorithm A verifies an input string x if there exists a certificate y such that A ( x, y ) = 1. The language verified by verification algorithm A is L = { input strings x | there exists certificate string y such that A ( x, y ) = 1 } Note that for an x that is not in L , for every certificate y , A ( x, y ) negationslash = 1.
This is the end of the preview. Sign up to access the rest of the document.
• Spring '06
• Ramachandran
• Algorithms, Computational complexity theory, NP-complete, TSP, Boolean satisfiability problem, polynomial time, verification algorithm

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern