<<

A Constructive to Prove =NP Duan Wen-Qi ([email protected]) College of Economics and Management, Zhejiang Normal University, Jinhua, 321004, China Abstract: After reducing the undirected Hamiltonian cycle problem into the TSP problem with cost 0 or 1, we developed an effective algorithm to compute the optimal tour of the transformed TSP. Our algorithm is described as a growth process: initially, constructing 4-vertexes optimal tour; next, one new vertex being added into the optimal tour in such a way to obtain the new optimal tour; then, repeating the previous step until all vertexes are included into the optimal tour. This paper has shown that our constructive algorithm can solve the undirected Hamiltonian cycle problem in time. According to Cook-Levin theorem, we argue that we have provided a constructive proof of P=NP.

This paper, taking Hamiltonian cycle as our object, be the total cost of the optimal tour, which corresponds wishes to develop a constructive algorithm to prove to the m -TSP composed of v1 , v2 , …, and v m . * P=NP, which is one of the seven Millennium Prize When C m 1 ,if any c(vi , v j ) 1 and the edge

Problems selected by the Clay Institute, (,)vi v j can appear in any optimal tour (whatever one and is also a major unsolved problem in computer or multiples optimal tours exist) of the m -TSP, we science. NP represents the class of questions for which call this kind of edges as optimizing edges (denoted as ** there is no known way to find an answer quickly, but (,)vi v j ) because of their key role playing in our ** an answer can be verified in polynomial time. For the algorithm. Let H m (vi , v j ) |i , j  [1, m ] , which hardest NP problems (i.e., NP-complete problems), contains all optimizing edges. Evidently, whether an given an efficient algorithm for any one of them, we edge is optimizing edge depends on the specific [1-4] can find an efficient algorithm for all of them . m -TSP. H m will change if the value of m is In terms of graph theory, a Hamiltonian cycle is a changed. For each optimizing edge, we construct an cycle in a graph that visits each vertex exactly once. optimal tour which must contain that edge. Therefore,

For a given graph (whether directed or undirected), we will construct KHm m optimal tours for the i determining the existence of such cycles is the m -TSP. Let  m ( i 1,2, , K m ) be the ith Hamiltonian cycle problem, which is NP-complete optimal tour which contains the ith optimizing edge [3] i problem . According to the Cook-Levin theorem, if in H m , and  m m |i  1,2, , K m be the set * we solve the undirected Hamiltonian cycle problem in of K m optimal tours. When C m =0, it will happen polynomial time, we also provides a constructive proof H m   , K m =0, and  m   . In order to keep * of P=NP. Following is our constructive algorithm. We consistence, for those m -TSP problems with C m  0 , first reduce the undirected Hamiltonian cycle problem we define H m as the set of (1) edges must be of cost into a special TSP problem. Let GVE (,) be an 0 and appear in any optimal tour whose total cost is 0, instance of the undirected Hamiltonian cycle problem. and (2) edges must be of cost 1 and appear in any tour

Consider a complete graph GVE (,) where whose total cost is 1. Considering that edges in H m

E(,)| u v u , v in V and u  v . Assign a cost to will play the same role as edges in H m , we also call each edge in E as follows: (1) c( u , v ) 0 if them as optimizing edges, call tours containing (,)u v in E ; (2) c( u , v ) 1 if (,)u v not in E . optimizing edge with cost 0 as optimal tours and tours Evidently, if the total cost of the optimal tour of G is containing one optimizing edge with cost 1 as “optimal

0, then graph G must have at least one Hamiltonian tours”. We define KHm m as the number of edges , i ( ) cycle. Otherwise, there is no Hamiltonian cycle in in H m  m i 1,2, , K m be the ith optimal graph G . Therefore, we will prove P=NP provided tour or “optimal tour” which contains the ith i that we can develop a deterministic algorithm to solve optimizing edge, and m m |i  1,2, , K m be the transformed TSP problem G in polynomial time. the set of tours which will be used in vertex growth.

The number of vertexes in G is NV , and When the new vertex v m1 is added into the * vi (i 1,2, , N ) denotes the ith vertex. Let C m m -TSP, the total cost of the optimal tour of 1 * , ( ), * * m 1 -TSP depends on C m H m H m Dm1 Table 1, and obtaining one optimal tour  m1 with m1 , ( ) * Mindi, j c ( v m 1 ,) v i  c ( v m  1 ,)| v j i  j  [1,] m   m m . The optimal tour  m1 is constructed in m1 * * m1(vi , v j ) | d i, j =D m  1 ,i  j  [1, m ] , and such a way that the lowest total cost C m1 in table 1 s m1 * m1  (,)|vi v j d i, j =D m1  1,i  j  [1,] m  . Table will be realized. Following we describe in detail how * * 1 shows in detail how C m+1 depends on the specific to construct  m1 under different situations. Case * , * , ( ), , * value of C m Dm1 H m H m m1 and one: D m1  2 . In this case, we first (1) randomly s * * m1 . It is worth noting that C N is the total cost of choose one edge (if C m  0 ), or (2) choose one * * the optimal tour of G . If C N  0 , it implies that optimizing edge (if C m 1) from one of the optimal there is at least one Hamiltonian cycle in graph G ; tour(s) in m (or  m ), then connect v m1 to the otherwise there is no Hamiltonian cycle in graph G . two vertices of the previous chosen edge and delete * * s * Evidently, C m1 , Dm1 , m1 , and m1 are that edge. Case two: Dm1 1. In this case, there * very easy to compute if we know C m and H m must exist one, but only one vertex vl which makes ( ). . H m Therefore, we will solve the transformed TSP (vm1 , v l ) 0 We pick out vl and (1) find out the problem G in polynomial time provided that our optimal tour which contains an edge (vl , v i ) 1 from ( ) ( ) algorithm can construct H m H m and  m m  m if ()H m  m1   or (2) pick out another correctly from m=4 to m= N in polynomial time, vertex v j provided that (,)vl v j appears in one * which will be proved in the latter. optimal tour if (H m  m1 )= or C m  0 , then

Table 1 The total cost of the optimal tour with m 1vertexes connect two edges (,)vm1 v l and (,)vm1 v i (or

(,)vm1 v j ), and delete the edge (vl , v i (or v j )) * * * D m1 C m  0 C m  1 from the corresponding optimal tour. Case three: if  if  * * ()H m m1   ()H m m1   D m1  0 . In this case, if C m  0 and ()H m  m1 * ** then C m1  0 then CCm1  m 1   , we first find out an edge (,)vi v j so as to , if ()H m  m1   (vm1 , v i ) 0 and (vm1 , v j ) 0 from m then s and()H m  m1   pick out that tour which contains (,)vi v j , add two 0 ** edges (,) and (,) into, and delete the if ()H m  m1   then CCm1  m vm1 v i vm1 v j * * edge (,) from it. If  0 and () then C m1  1 if ()H m  m1   vi v j C m H m m1 s = , we randomly pick out one optimal tour from and()H m  m1  

** , and connect the new vertex m1 to the vertex then CCm1  m 1 m v vi which satisfies with (vm1 , v i ) 0 and vi ’s if ()H m  m1   , then ** adjacent vertex v j then delete the edge (,)vi v j * CCm1 m 1 C m1  1 * from that optimal tour. If C m 1 and ()H m  m1 if ()H m  m1   **   , we first find out one edge (,)vi v j that satisfies then CCm1  m 1 * ** with (vm1 , v i ) 0 and (vm1 , v j ) 0 from  m , 2 C m1  2 CCm1  m 1 then pick out the optimal tour which contains the edge

After introducing our general idea, we now (,)vi v j , add the edges (,)vm1 v i and (,)vm1 v j present the detailed process to solve the TSP problem. into, and delete (,)vi v j from that optimal tour. Lastly, * Step one: starting from m=4 , picking out four considering situation ()H m  m1   and C m 1 s s vertices and making sure that the total cost of the ( ()H m  m1   or ()H m  m1   ), it is very * * optimal tour of the 4-TSP is larger than 0, i.e. 1C 4 similar to the Case two with C m 1 if we replace the * s .  4 ; computing C 4 , H 4 , and  4 . If the total symbol m1 with m1 Hence, we can construct cost of the optimal tours of all 4-TSP in G is 0, then the optimal tour with the procedure used in Case two. ( ) there must exist multiple Hamiltonian cycles in G . Step three: constructing H m1 H m1 and * ( ) * . Step two: adding the new vertex v m1 : as C m  m1 m1 based on the optimal tour  m1 If ( ) * , * , we use Optimizing Edge Replacing (OER) and H m H m already known, computing Dm1 C m1 1 s * * m1 , m1 (if necessary), and C m1 based on moves to construct H m1 and  m1 . If C m1  0 , 2 we use Modified Optimizing Edge Replacing add-one-OER, in which the total cost of the original . (MOER) moves to construct H m1 and m1 The tour increases to 1 after performing any move, implementation of OER and MOER will be illustrated whatever sequential 2-opt, 3-opt moves, or in the latter. double-bridge non-sequential move. After an Step four: repeating Step two and Step three until add-one-OER, only in-edges with cost 1 (being taken . * , ( ), m= N After obtained C N H N H N and as optimizing edges) and an “optimal tour” contained

 N (  N ), we complete our computing procedure that will be added into H m1 and m1 , respectively. for solving the undirected Hamiltonian cycle problem. The third one is minus-one-OER, which is the inverse The key idea of OER is to find out all new move of add-one-OER. The “optimal tour” will optimizing edges which can replace those optimizing become an optimal tour and the total cost of the * edge(s) already existed in  m1 . To implement OER “optimal tour” will decrease to 0 after performing a move, we first start from any out-optimizing edge move. Evidently, in minus-one-OER, all in-edges must * (,)vi v j 1 in  m1 , then exhaustive search and be of cost 0, and all of them are taken as optimizing perform sequential 2-opt and 3-opt moves like that in edges and added into H m1 . The fourth one is the Lin–Kernighan heuristic [5-6], and perform double- same as OER move, which does not change the total bridge non-sequential move which is shown in Fig. 4 cost of the original “optimal tour”, and only the of Ref. [6], so as to find out at least one new in-edges with cost 1 will be taken as new optimizing optimizing edge. It is worth noting that all sequential edges. As described in the above, based on an optimal and non-sequential moves in OER must not change the tour, we can perform zero-OER or add-one-OER; we total cost of optimal tour(s). After each move, at least can implement minus-one-OER and OER move based * one new optimizing edge is introduced into the optimal on an “optimal tour”. For the given optimal tour  m1 , * tour, which will be used as out-optimizing edge in if C m1  0 , all edges in it are optimizing edges. We latter OER moves. We iteratively start from one start from these initially optimizing edges to optimizing edge to perform succession OER moves exhaustively perform the above four moves so as to until we cannot find out any new optimizing edge. It is find out new optimizing edges. By iteration, we will easy to see that the complexity of performing OER find out all optimizing edges, and construct all move is O(5) in worst case, which implies our “optimal tours” and optimal tours. Similar to OER, the computation can be finished in polynomial time. complexity of MOER is O(5) in worst case, which

Different from H m1 only containing edges with means that the whole computation to construct H m cost 1, H m1 contains not only edges with cost 0 but and m can be finished in polynomial time. also edges with cost 1. Correspondingly, m1 As described in the above, our algorithm can contains two kinds of tours. One is the optimal tours solve the undirected Hamiltonian cycle problem in whose total cost must be 0, and the other is the polynomial time completely provided that we can find

“optimal tours” whose total cost must be 1. MOER out all optimizing edges in H m1 ( H m1 ) based on a * move is much like OER move, i.e., replacing given optimal tour  m1 . Following we illustrate out-edges with other in-edges by performing sequential why we can find out all optimizing edges in H m1

2-opt, 3-opt moves, and double-bridge non-sequential ( H m1 ) by applying OER (MOER) moves based on a move. However, there are major differences between give optimal tour. For any vertex vi , if there exists at , MOER and OER. There are four kinds of OER moves least one edge (,)()vi v j  H m1 H m1 we call it as in MOER. The first one is zero-OER, which is used to optimizing vertex, otherwise as non-optimizing vertex. , find out optimizing edges with cost 0 in H m1 and For any optimizing edge (,)vi v j with the vertex vi . ' optimal tours in m1 Evidently, both in-edges and its each connected edge (,)vi v j with cost 0 must ' out-edges all are optimizing edges. When we perform correspond to one optimizing edge (,)vj v i , which zero-OER moves, the total cost of the optimal tour make us obtain a new optimal tour (or “optimal tour”) must keep unchanged. The second one is with new optimizing edge only by a simple OER 3 * * (MOER) move. Conversely, if C m1  0 , each (vm1,)v j are added into and the optimal tour  m1 opt optimizing edge in H m1 must have at least one edge is given, we examine whether G m1 is a connected with zero cost corresponding to it. Evidently, for graph. If * 1 and c( v ,) + c( v ,) =0, C m m1 vi m1 v j * opt opt C m1  0 and H m1 , all vertices are optimizing then HHm+1  m and VVm1  m . Being a sub- opt opt vertices and each vertex connects to at least two graph of G m , G m1 must be a connected graph. If * optimizing edges. Therefore, MOER move can exploit c( vm1,)vi + c( vm1,)v j =2, then C m1  2 and v m1 * * all zero cost edges of each vertex and find out all can connect to any vertex in  m if C m  0 (or optimizing edges. connect to two optimizing vertices vi and v j * opt opt For C m1 1 and H m1 , we define V m1  satisfied with (vi,v j ) 1). It is easy to see that G m1

vi| ( v i , v j )  H m1 as the set of optimizing is a connected graph. If c( vm1,)vi + c( vm1,)v j =1, vertices and opt |  ( , )  as the set without lost generality, let c( v , ) 0 and V m1 vi v i v j H m1 m1 vi of non-optimizing vertices. For any two vertices c( vm1,v j ) 1. In this case, under the situation of opt opt * * vi V m1 and vj V m1 , if (,)vi v j  H m1 , then C m 1 and C m1 1, as we can see from Table 1 there is an edge between vi and v j which and Step two, v m1 as an optimizing vertex, has opt corresponds to the optimizing edge (,)vi v j . By this connected to G m through the edge (vm1,)v j opt way, we can obtain a graph G m1 . For any two because of (vi,v j ) 1 or we can builds the opt vertices vi and v j in V m1 and (vi , v j ) 1 , if connection by implementing only one OER move there exists a path between them, we can apply between (vm1,)v j and another optimizing edge in * * succession OER moves to obtain another optimal tour  m1 (if (vi,v j ) 0 , then C m1  2 ). Under the * * containing (,)vj v l  H m1 from one optimal tour situation of C m  0 and C m1 1 , all optimizing containing (,)vi v k  H m1 . Therefore, provided that vertices can be connected to v m1 , at most applying 2 opt G m1 is a connected graph, we can find out all OER moves. Hence, all optimizing vertices are optimizing edges from the seed optimizing edge(s) in composed of a connected graph. As analyzed in the * opt  m1 by applying succession OER moves. Following above, in whatever situation, G m1 must be a opt opt we apply inductive method to prove G m1 is a connected graph if G m is already a connected graph. connected graph. Therefore, we have proved that applying OER move

For m 1  4 , without doubt, we can obtain can find out all optimizing edges in H N for any N . v H 4 and  4 correctly by applying OER moves As shown in the previous paragraph, our * based on one optimal tour  4 . Now, we assume that constructive algorithm can solve one of the most we can obtain H m and  m by applying OER famous NP-complete problems –– the undirected * opt moves based on a optimal tour  m . Evidently, G m Hamiltonian cycle problem in polynomial time. should be a connected graph under the previous According to the Cook–Levin theorem, we conclude assumption. When the new edges (vm1,)vi and that we have provided a constructive proof of P=NP. Reference [1] Fortnow, L. The status of the P versus NP problem. Communications of the ACM, 52 (9): 78-86, 2009. [2] Cook, S. The complexity of theorem-proving procedures. In Proceedings of the 3rd ACM Symposium on the Theory of Computing, ACM, NY, 1971, 151-158. [3] Karp, R. Reducibility among combinatorial problems. Complexity of Computer Computations. R. Miller and J. Thatcher, Eds. Plenum Press, 1972, 85-103. [4] Levin, L. Universal'nyie perebornyie zadachi (Universal search problems: in Russian). Problemy Peredachi Informatsii, 9(3): 265-266, 1973. [5] Lin, S., Kernighan, B. W. An effective heuristic algorithm for the traveling-salesman problem. Operations Research, 21(2): 498-516, 1973. [6] Helsgaun, K. General k-opt submoves for the Lin–Kernighan TSP heuristic. Mathematics and Statistics, 1(2-3): 119-163, 2009.

4