Home
Subjects
Textbook solutions
Create
Study sets, textbooks, questions
Log in
Sign up
Upgrade to remove ads
Only $35.99/year
P, NP, NP-Complete, NP-Hard
STUDY
Flashcards
Learn
Write
Spell
Test
PLAY
Match
Gravity
Terms in this set (18)
Decision problem
A question with a yes or no answer
set P
P is the set of all decision problems which can be SOLVED in polynomial time by a deterministic Turing machine. Since it can be solved in polynomial time, it can also be VERIFIED in polynomial time. Therefore P is a SUBSETof NP.
Polynomial time is also...
fast or quickly
set NP
decision problems where instances of the problem for which the answer is yes have proofs that can be VERIFIED in polynomial time. This means that if someone gives us an instance of the problem and a certificate (sometimes called a witness) to the answer being yes, we can check that it is correct in polynomial time.
NP stands for Non-deterministic Polynomial time.
NP-Complete
An NP problem X for which it is possible to reduce any other NP problem Y to X in polynomial time. Intuitively this means that we can solve Y quickly if we know how to solve X quickly. Precisely, Y is reducible to X if there is a polynomial time algorithm f to transform instances y of Y to instances x = f(y) of X in polynomial time with the property that the answer to y is yes if and only if the answer to f(y) is yes.
Identify which set(s) this problem belongs to:
Minesweeper
NP-Complete
reduction
A reduction is an algorithm for transforming one problem into another problem. A reduction from one problem to another may be used to show that the second problem is at least as difficult as the first.
Identify which set(s) this problem belongs to:
Given a graph connected G, can its vertices be colored using two colors so that no edge is monochromatic. Algorithm: start with an arbitrary vertex, color it red and all of its neighbors blue and continue. Stop when you run our of vertices or you are forced to make an edge have both of its endpoints be the same color.
P (and thus NP)
Identify which set(s) this problem belongs to:
Integer factorization. This is the problem that given integers n and m, is there an integer f with 1 < f < m such that f divides n (f is a small factor of n)? This is a decision problem because the answers are yes or no. If someone hands us an instance of the problem (so they hand us integers n and m) and an integer f with 1 < f < m and claim that f is a factor of n (the certificate) we can check the answer in ___ time by performing the division n / f.
NP
Identify which set(s) this problem belongs to:
3-SAT
NP-Complete
3-SAT
In this, we are given a conjunction of 3-clause disjunctions (i.e., statements of the form
(x_v11 or x_v21 or x_v31) and
(x_v12 or x_v22 or x_v32) and
... and
(x_v1n or x_v2n or x_v3n)
...where each x_vij is a boolean variable or the negation of a variable from a finite predefined list (x_1, x_2, ... x_n). It can be shown that every NP problem can be reduced to 3-SAT. The proof of this is technical and requires use of the technical definition of NP (based on non-deterministic Turing machines and the like). This is known as Cook's theorem.
What makes NP-complete problems important is that if a deterministic polynomial time algorithm can be found to solve one of them, every NP problem is solvable in polynomial time (one problem to rule them all).
aka Boolean Satisfiability Problem, Satisfiability
NP-Hard
Intuitively these are the problems that are even HARDER than the NP-complete problems. Note that NP-hard problems do not have to be in NP (they do not have to be decision problems). The precise definition here is that a problem X is NP-hard if there is an NP-complete problem Y such that Y is reducible to X in polynomial time. But since any NP-complete problem can be reduced to any other NP-complete problem in polynomial time, all NP-complete problems can be reduced to any NP-hard problem in polynomial time. Then if there is a solution to one NP-hard problem in polynomial time, there is a solution to all NP problems in polynomial time.
TL;DR
the hardest problems that are NOT decision problems (NP-complete are the hardest decision problems)
Identify which set(s) this problem belongs to:
Travelling Salesman
NP-Hard
P=NP problem
This the most famous problem in computer science, and one of the most important outstanding questions in the mathematical sciences. In fact, the Clay Institute is offering one million dollars for a solution to the problem (Stephen Cook's writeup on the Clay website is quite good). It's clear that P is a subset of NP. The open question is whether or not NP problems have deterministic polynomial time solutions. It is largely believed that they do not. Here is an outstanding recent article on the latest (and the importance) of the P = NP problem: The Status of the P versus NP problem.
Any NP can be reduced to NP-Complete and any NP-Complete can be reduced to NP-Hard, all in P time.
reducing (easier) to (harder)...
source(s)
http://stackoverflow.com/questions/1857244/np-vs-np-complete-vs-np-hard-what-does-it-all-mean
diagram:
http://upload.wikimedia.org/wikipedia/commons/a/a0/P_np_np-complete_np-hard.svg
http://stackoverflow.com/questions/210829/what-is-an-np-complete-problem
approximation algorithms
Approximation algorithms are algorithms used to find approximate solutions to optimization problems. An approximate algorithm is a way of dealing with NP-completeness for optimization problem. This technique does not guarantee the best solution. The goal of an approximation algorithm is to come as close as possible to the optimum value in a reasonable amount of time which is at most polynomial time.
Approx. algo. design techniques
1. Greedy algorithm,
2. Local search,
3. Enumeration and dynamic programming,
4. Solving a convex programming relaxation to get a fractional solution. Then converting this fractional solution into a feasible solution by some appropriate rounding. The popular relaxations include the following.
a. Linear programming relaxation
b. Semidefinite programming relaxation,
5. Embedding the problem in some simple metric and then solving the problem on the metric. This is also known as metric embedding.
http://en.wikipedia.org/wiki/Approximation_algorithm
Recommended textbook explanations
Introduction to Algorithms
3rd Edition
Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
709 explanations
Computer Organization and Design MIPS Edition: The Hardware/Software Interface
5th Edition
David A. Patterson, John L. Hennessy
220 explanations
Operating System Concepts
8th Edition
Abraham Silberschatz, Greg Gagne, Peter B. Galvin
308 explanations
Starting Out with Python
3rd Edition
Tony Gaddis
610 explanations
Sets with similar terms
CS 317 FINAL P & NP Terms
27 terms
Cognitive Psychology: Chapter 12
46 terms
CH 12
52 terms
CSC 380 Final
23 terms
Sets found in the same folder
P, NP, NP-Hard, NP-Complete
39 terms
CS 6515 Algos Test 3
80 terms
CS 6515 Algos Test 3
80 terms
BNC1 - Perception and Individual Decision Making
27 terms
Other sets by this creator
matlab
200 terms
'hard' probs from ctci
25 terms
bit manip probs
9 terms
calc
3 terms
Verified questions
COMPUTER SCIENCE
Assume that a file containing a series of integers is named numbers.txt and exists on the computer’s disk. Write a program that reads all of the numbers stored in the file and calculates their total.
COMPUTER SCIENCE
Show that a full parenthesization of an n-element expression has exactly n - 1 pairs of parentheses.
COMPUTER SCIENCE
A non-governmental organization needs a program to calculate the amount of financial assistance for needy families. The formula is as follows: - If the annual household income is between $30,000 and$40,000 and the household has at least three children, the amount is $1,000 per child. If the annual household income is between$20,000 and $30,000 and the household has at least two children, the amount is$1,500 per child. - If the annual household income is less than $20,000, the amount is$2,000 per child. Implement a function for this computation. Write a program that asks for the household income and number of children for each applicant, printing the amount returned by your function. Use –1 as a sentinel value for the input.
COMPUTER SCIENCE
True or False? An interpreter is a program that both translates and executes the instructions in a highlevel language program.
Other Quizlet sets
liver, gallbladder and pancreas exam
46 terms
MKT test 2
93 terms
Reproductive Systems
27 terms
Chapter 5
46 terms
Related questions
QUESTION
A troubleshooting tool which permits a support worker to access a user's PC without traveling to the user's physical location is called remote access.
QUESTION
An administrator has just replaced the toner in a laser printer. However, users are complaining that print jobs still come out faded. What should the administrator look for on the printer?
QUESTION
what statement below best captures why a grounded theorist engages in memoing during a study?
QUESTION
If you were remembering seeing a friend, which of Guilford's operations would you be using?