The Ch34 is calculated as a guide. NP Complete

Source: Internet
Author: User

1. Turing stop problem: No matter how long you can not be solved by any computer

Problem Description: The input data for h,h is P (p is a program (the program is also a string of data)), determine whether P can finally stop under the input W

H (P (w)) =0 if p is down at input W

-1 if P is dead in the input w (the output of H is State)

Analysis: If the problem H can be solved, then construct a process K (p), the input is a program, the output of k depends on the results of H (p))

Procedure K (input P):

if (H (p)) ==0) dead loop

else if (H (P (p)) ==-1) return 0;

K (k): If K (k) dies, then H (k (k)) =0,k (k) should be able to stop

If K (k) stops, then H (k (k)) =-1,k (k) should be a dead cycle

There are contradictions

It's really around ... It's changed three times before I know it.

2. Some examples of problems

1) in the graph g= (v,e), find the shortest path starting from a single source vertex in O (VE) time

Related NPC: Determines whether a graph contains a simple path in a given number of edges

2) at O (e) time, you can determine whether a diagram has a eular loop (which happens to pass through each side of the Loop) (22-3), in fact, you can traverse the various edges of the Euler circuit at O (e) time

Related NPC: Determine if a graph contains Hamiltonian loops (simple loops that pass through each vertex)

3) k-cnf:k a normal form, connecting several or clauses with and, and each clause just has k bool variable or its negation

Polynomial time judgment 2-cnf (whether there is a set of legal assignments): polynomial time

3-CNF of the meeting: NPC

3.P,NP,NPC problems

P class: Can be resolved within O (n^k) time

NP class: Can be validated in polynomial time (given a set of assignments)

Obviously, p-type problems are NP-problems.

The Ch34 is calculated as a guide. NP Complete

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.