Sequencing Research Foreplay _ Computational Complexity

Source: Internet
Author: User

Computational complexity theory (Computational complexity theory) is a branch of theoretical computer science and mathematics that is dedicated to classifying computable problems according to their own complexity and linking them. A computable problem is considered a problem that can be solved in principle by a computer, i.e. the problem can be solved by a series of mechanical mathematical steps, such as an algorithm.

If the solution of a problem requires a considerable amount of resources (whatever algorithm is used), it is considered to be difficult to solve. Computational complexity theory is formalized by introducing mathematical computational models to study these problems and to quantify the resources (time and space) needed to solve the problem. Other complexity measures are also used, such as traffic (applied to communication complexity), the number of gates in the circuit (applied to circuit complexity), and the number of central processing units (applied to parallel computing). One of the functions of computational complexity theory is to determine the actual limitations of a problem that can or cannot be solved by a computer.

In the field of theoretical computer science, the related concepts are algorithmic analysis and computable theory. A key difference between the two is that the former is devoted to analyzing the amount of resources needed to solve a problem with a deterministic algorithm, while the latter is in a broader sense to solve the same problem with all possible algorithms. More precisely, it tries to divide the problem into energy or not to solve these two classes under the existing appropriate constrained resource conditions. Correspondingly, the constraints under the existing resource conditions are an important indicator for distinguishing the computational complexity theory from the computable theory: the latter is concerned about what problems can be solved in principle.


determinant issues and computable nature

We consider the question of an algorithm, what kind of answer is what we need. For example, search problem: Given array A, and a number of s, we have to ask s in not in a (the determinant of the problem, decision problem). and further, S if in a then what's the position of s (search-problem). Another example is the perfect match problem (perfect matching): Given a binary graph g= (v,e), we ask whether there is an edge set E, so that each node in the binary map exactly belongs to one edge of the edge set (decision-type problem). and further, E exists, E is exactly what (search-type problem).

Naturally, we will find that for the general algorithm problem A, we can all ask: first, does the solution exist? Second, if the solution exists, what is the solution specifically? This is a decision-type problem and a search-type problem (also known as a functional problem) to distinguish the source of the visual interpretation. The answer to the decision-type question is only "yes" or "no", and the search-type problem needs to return the specific form of the solution or the "solution does not exist". Therefore, an algorithm for the search-type problem of A is also an algorithm for the decision-type problem of a. Conversely, given a decision-type problem algorithm, whether there is a search-type problem algorithm, in the computational theory and computational complexity theory has different answers, this is to understand the computational complexity theory and its predecessor computable theory of a basic observation.

In the computable theory, it can be explained that the decision-type problem and the search-type problem are equivalent in the sense of computable (see decision problem). In the computational complexity, Khuller and Vazirani proved in the 1990 's that under the assumption of P≠NP, the decision-type problem of plane figure 4-coloring problem is in P, while it is NP hard to find the first coloring of its dictionary order. [1]

Therefore, in the computable theory, it is reasonable to pay attention to the problem of decision-type. In computational complexity theory, although some basic complexity classes (such as P,NP and Pspace), as well as some basic problems (P and NP relationship problems, etc.) are defined by the decision-type problem, the function-type problem complexity class is also defined (such as FP,FNP, etc.), and some special function-type problem complexity classes, such as TFNP, is also being gradually received attention.

Algorithm Analysis

The research object of computational complexity theory mentioned above is the resources used to perform a computational task, in particular, time and space are the two most important resources.

We use time as an example to discuss some basic knowledge of algorithmic analysis. If the length of the input (set to n) is used as a variable, we are concerned with the function of the algorithm run time and N. T (n). Because T (n) may have a difference in the constant factor when an algorithm is implemented on different computational models (see computable theory), we use the large O-expression to represent t (N), which allows us to ignore the constant factors that are implemented on different computational models.

Take the search for this computational task as an example. In the search problem, given a specific number s, and an array of length n (the position of the number of the array is marked with 1 to N), the task is that when S is in a, the position of S is found, and S is not in a, it needs to report "not found". The length of the input is n+1. The following procedure is the simplest algorithm: we sweep through each number in a sequence and compare it to S, and return "not found" if the current position is returned as equal, if all the numbers are swept and the algorithm is still not stopped.

If we assume that the probability of S is the same for each position in a, then the algorithm needs to 1/n (1+2+...+n) =n (n+1)/2n= (n+1)/2 in the condition where s is found. If S is not in a, then the time required (n+1). By the knowledge of the large O-expression we know that the time required for the algorithm is O (n).

And if we further assume that a is ordered, then we have a binary lookup algorithm that makes the algorithm run at O (logn). You can see that there is a big difference in the running time between the different algorithms that perform a computational task.


Sequencing Research Foreplay _ Computational Complexity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.