Escolar Documentos
Profissional Documentos
Cultura Documentos
In computational complexity theory, P, also known as PTIME or DTIME (nO(1)), is one of the most fundamental complexity classes. It contains all decision problems which can be solved by a deterministic Turing machine using a polynomial amount of computation time, or polynomial time.. Cobhams thesis holds that P is the class of computational problems which are efficiently solvable or tractable; in practice, some problems not known to be in P have practical solutions, and some that are in P do not, but this is a useful rule of thumb. A language L is in P if and only if there exists a deterministic Turing machine M, such that M runs for polynomial time on all inputs For all x in L, M outputs 1 For all x not in L, M outputs 0 P is known to contain many natural problems, including the decision versions of linear programming, calculating the greatest common divisor, and finding a maximum matching. In 2002, it was shown that the problem of determining if a number is prime is in P. The related class of function problems is FP. The article on P-complete problems lists further relevant problems in P. A generalization of P is NP, which is the class of languages decidable in polynomial time on a non-deterministic Turing machine. We then trivially have P is a subset of NP. Though unproven, most experts believe this is a strict subset.
NP problems
In computational complexity theory, NP is one of the most fundamental complexity classes. The abbreviation NP refers to nondeterministic polynomial time. Intuitively, NP is the set of all decision problems for which the yes-answers have simple proofs of the fact that the answer is indeed yes. More precisely, these proofs have to be verifiable in polynomial time by a deterministic Turing machine. In an equivalent formal definition, NP is the set of decision problems solvable in polynomial time by a non-deterministic Turing machine. The complexity class P is contained in NP, but NP contains many important problems, the hardest of which are called NP-complete problems, for which no polynomial-time algorithms are known. The most important open question in complexity theory, the P = NP problem, asks whether such algorithms actually exist for NP-complete, and by corollary, all NP problems. It is widely believed that this is not the case. The complexity class NP can be defined in terms of NTIME as follows:
Alternatively, NP can be defined using only deterministic Turing machines using the verifier-based definition. A language L is in NP if and only if there exists a polynomial p and deterministic Turing machine M, such that M runs for polynomial time on all inputs For all x in L, there exists a string y of length p(|x|), such that M(x,y) = 1 For all x in not in L, for all strings y of length p(|x|), M(x,y) = 0
NP Complete
In computational complexity theory, the complexity class NP-complete (abbreviated NP-C or NPC), is a class of problems having two properties: 1-:Any given solution to the problem can be verified quickly (in polynomial time); the set of problems with this property is called NP (nondeterministic polynomial time).
2-:If the problem can be solved quickly (in polynomial time), then so can every problem in NP. Although any given solution to such a problem can be verified quickly, there is no known efficient way to locate a solution in the first place; indeed, the most notable characteristic of NP-complete problems is that no fast solution to them is known. That is, the time required to solve the problem using any currently known algorithm increases very quickly as the size of the problem grows. As a result, the time required to solve even moderately large versions of many of these problems easily reaches into the billions or trillions of years, using any amount of computing power available today. NP-complete problems are often addressed by using approximation algorithms NP-complete is a subset of NP, the set of all decision problems whose solutions can be verified in polynomial time; NP may be equivalently defined as the set of decision problems that can be solved in polynomial time on a nondeterministic Turing machine. A problem p in NP is also in NPC if and only if every other problem in NP can be transformed into p in polynomial time. NP-complete can also be used as an adjective: problems in the class NP-complete are known as NPcomplete problems. A decision problem C is NP-complete if: C is in NP, and Every problem in NP is reducible to C in polynomial time. The list below contains some well-known problems that are NP-complete when expressed as decision problems. Boolean satisfiability problem (Sat.) N-puzzle Knapsack problem Hamiltonian path problem Travelling salesman problem Subgraph isomorphism problem Subset sum problem Clique problem Vertex cover problem Independent set problem Dominating set problem Graph coloring problem The following techniques can be applied to solve computational problems in general, and they often give rise to substantially faster algorithms: Approximation: Instead of searching for an optimal solution, search for an almost optimal one. Randomization: Use randomness to get a faster average running time, and allow the algorithm to fail with some small probability. Restriction: By restricting the structure of the input (e.g., to planar graphs), faster algorithms are usually possible. Parameterization: Often there are fast algorithms if certain parameters of the input are fixed. Heuristic: An algorithm that works reasonably well in many cases, but for which there is no proof that it is both always fast and always produces a good result. Metaheuristic approaches are often used.
NP Hard
NP-hard (non-deterministic polynomial-time hard), in computational complexity theory, is a class of problems that are, informally, at least as hard as the hardest problems in NP. A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H. It is super set of NP complete. NP-hard problems may be of any type: decision problems, search problems, or optimization problems
NP naming confusions
NP-complete means problems that are complete in NP (i.e., any problem reduces to any other problem in polynomial time) NP-hard -:stands for at least as hard as NP (but not necessarily in NP) NP-easy -:stands for at most as hard as NP (but not necessarily in NP) NP-equivalent -:means equally difficult as NP, (but not necessarily in NP)
NP Complete Problems
1 SAT-: Satisfy Ability Problem.
Satisfiability is the problem of determining if the variables of a given Boolean formula can be assigned in such a way as to make the formula evaluate to TRUE. Equally important is to determine whether no such assignments exist, which would imply that the function expressed by the formula is identically FALSE for all possible variable assignments. In this latter case, we would say that the function is unsatisfiable; otherwise it is satisfiable. To emphasize the binary nature of this problem, it is frequently referred to as Boolean or propositional satisfiability. The shorthand SAT is also commonly used to denote it, with the implicit understanding that the function and its variables are all binary-valued. In complexity theory, the Boolean satisfiability problem (SAT) is a decision problem, whose instance is a Boolean expression written using only AND, OR, NOT, variables, and parentheses. The question is: given the expression, is there some assignment of TRUE and FALSE values to the variables that will make the entire expression true? A formula of propositional logic is said to be satisfiable if logical values can be assigned to its variables in a way that makes the formula true. The boolean satisfiability problem is NP-complete. The propositional satisfiability problem (PSAT), which decides whether a given propositional formula is satisfiable, is of central importance in various areas of computer science, including theoretical computer science, algorithmics, artificial intelligence, hardware design, electronic design automation, and verification.
A minimum vertex cover is a vertex cover of smallest possible size. The vertex cover number is the size of a minimum vertex cover. The following figure shows examples of minimum vertex covers in two graphs.
In computer science, the partition problem is an NP-complete problem. The problem is to decide whether a given multiset of integers can be partitioned into two halves that have the same sum. More precisely, given a multiset S of integers, is there a way to partition S into two subsets S1 and S2 such that the sum of the numbers in S1 equals the sum of the numbers in S2? The subsets S1 and S2 must form a partition in the sense that they are disjoint and they cover S. The optimization version asks for the best partition, and can be stated as: Find a partition into two subsets S1,S2 such that is minimized (sometimes with the additional constraint that the sizes of the two sets in the partition must be equal, or differ by at most 1). The partition problem is equivalent to the following special case of the subset sum problem: given a set S of integers, is there a subset S1 of S that sums to exactly t /2 where t is the sum of all elements of S? (The equivalence can be seen by defining S2 to be the difference S S1.) Therefore, the pseudo-polynomial time dynamic programming solution to subset sum applies to the partition problem as well. A variation of the partition problem is the 3-partition problem, in which the set S must be partitioned into |S|/3 triples each with the same sum. In contrast to partition, 3-partition has no pseudo-polynomial time algorithm unless P = NP: 3partition remains NP-complete even when using unary coding.