1 / 29

NP-complete Problem 2

Lecture 25. NP-complete Problem 2. Prof. S M Lee Department of Computer Science. Encodings An encoding "e" is a mapping from a set S to binary strings Use encodings to map abstract problems to concrete problems Example - Shortest Path 010100101010010101101100010101001010.

carson
Download Presentation

NP-complete Problem 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 25 NP-complete Problem 2 Prof. S M Lee Department of Computer Science

  2. Encodings An encoding "e" is a mapping from a set S to binary strings Use encodings to map abstract problems to concrete problems Example - Shortest Path010100101010010101101100010101001010

  3. Hamiltonian cycle of an undirected graph G= (V, E) is a simple cycle that contains each vertex in VA hamiltonian graph is a graph that has a hamiltonian cycle.Let m = |V|, it takes m! operations to determine if G= (V, E) is a hamiltonian graph If Mary claims a graph is hamiltonian graph and provides the vertices in order on the hamiltonian cycle then we can verify her claim in polynomial timeThe potential cycle is called the certificate.

  4. R Why Are We Studying NP-complete Problems? • Because we want to know what problems can be solved by computers

  5. Polynomial Reductions • NP-complete problems are known as decision problems. This means that a specific item of input data is accepted and depending on the specific problem, it is required to determine if the instance does have the property, then the answer yes is returned; if not, then the answer no is returned

  6. Polynomial Reduction • Reduction of a problem P to a problem Q: problem q’s answer for t(x) must be the same as p’s answer for x x T T(x) Algorithm for Q Yes or No answer (an input for p) An input for Q

  7. A Simple Reduction • Let the problem P be: given a sequence of boolean values, does at least one of them have the value true • Let Q be: given a sequence of integers, is the maximum of the integer positive? • Let the transformation T be defined by: t(x1,x2,…,xn)=(y1,y2,…,yn) where yi=1 if xi=true, and yi=0 if xi=false • Clearly an algorithm to solve Q, when applied to y1,y2,…,yn, solves P for x1,x2,…,xn

More Related