<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AM</journal-id><journal-title-group><journal-title>Applied Mathematics</journal-title></journal-title-group><issn pub-type="epub">2152-7385</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/am.2018.912088</article-id><article-id pub-id-type="publisher-id">AM-89255</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Fast Algorithm for the Travelling Salesman Problem and the Proof of P = NP
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jinliang</surname><given-names>Wang</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>Research Institute for ESMD Method and Its Applications, College of Science, Qingdao University of Technology,
Qingdao, China</addr-line></aff><pub-date pub-type="epub"><day>19</day><month>12</month><year>2018</year></pub-date><volume>09</volume><issue>12</issue><fpage>1351</fpage><lpage>1359</lpage><history><date date-type="received"><day>26,</day>	<month>November</month>	<year>2018</year></date><date date-type="rev-recd"><day>17,</day>	<month>December</month>	<year>2018</year>	</date><date date-type="accepted"><day>20,</day>	<month>December</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  
    In the theory of computational complexity, the travelling salesman problem is a typical one in the 
   NP class. With the aid of a brand-new approach named “maximum-deleting method”, a fast algorithm is constructed for it with a polynomial time of biquadrate, which greatly reduces the computational complexity. Since this problem is also 
   NP-complete, as a corollary, 
   P = 
   NP is proved to be true. It indicates the crack of the well-known open problem named “
   P versus 
   NP”. 
  
 
</p></abstract><kwd-group><kwd>Travelling Salesman Problem</kwd><kwd> P versus NP Problem</kwd><kwd> NP-Complete</kwd><kwd> Computational Complexity</kwd><kwd> Maximum-Deleting Method</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The travelling salesman problem asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?” [<xref ref-type="bibr" rid="scirp.89255-ref1">1</xref>] . In the theory of computational complexity, this problem is a typical one in the NP class [<xref ref-type="bibr" rid="scirp.89255-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref2">2</xref>] . The closely related suspense is the well-known “P versus NP problem”, that is, to determine whether every language accepted by some nondeterministic algorithm in polynomial time is also accepted by some deterministic algorithm in poly-nomial time [<xref ref-type="bibr" rid="scirp.89255-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref4">4</xref>] . If it is true then P = NP, otherwise, P ≠ NP. Here P denotes the class of decision problems solvable by some algorithm within a number of steps bounded by some fixed polynomial in the length of the input. The notation NP stands for “nondeterministic polynomial time” and the class of questions for which an answer can be verified in polynomial time is called NP.</p><p>The proof of P = NP is associated with an important concept, named “NP-complete”, which was firstly proposed by Cook in 1971 [<xref ref-type="bibr" rid="scirp.89255-ref5">5</xref>] . The NP-complete problems are a set of problems to each of which any other NP-problem can be reduced in polynomial time, and whose solution may still be verified in poly-nomial time. That is, any NP problem can be transformed into any of the NP-complete problems [<xref ref-type="bibr" rid="scirp.89255-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref4">4</xref>] . Hence, to prove the including relationship NP &#205; P it only requires the consideration of a single arbitrarily-chosen NP-complete problem (P &#205; NP is naturally satisfied). The precise expression is given by Cook in [<xref ref-type="bibr" rid="scirp.89255-ref3">3</xref>] as follows:</p><p>Proposition 1. Let L be a language over a finite alphabet. If L is NP-complete and L belongs to P then P = NP.</p><p>It follows from [<xref ref-type="bibr" rid="scirp.89255-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref6">6</xref>] that the travelling salesman problem is NP-complete, and Proposition 1 indicates that the proof of P = NP only requires the seeking of a language L in P for it, that is, a fast algorithm which can be executed on computer with a polynomial time rather than an exponential time. Many researchers had already tried on it, and a lot of “optimizing” or “searching” approaches were developed (please see the list in [<xref ref-type="bibr" rid="scirp.89255-ref1">1</xref>] ). But the associated computational-complexity problem is still suspended till now. Just as indicated by Devlin in [<xref ref-type="bibr" rid="scirp.89255-ref2">2</xref>] , to solve this it requires an unusual but wonderful thinking!</p><p>From October 2018, I began to think about this, and a fresh idea suddenly appeared when I deleted the longest one among the total 15 paths (which connect 6 cities separately) by a pen on a paper (see <xref ref-type="fig" rid="fig1">Figure 1</xref>). Since the candidate for the concerned route is always composed by 6 segments and each one of them has several choices, to shorten the total length the longest path should be avoided. Without path-deleting this problem requires a selection among 5 ! = 5 &#215; 4 &#215; 3 &#215; 2 &#215; 1 = 120 choices. Yet the deleting of one path implies the avoiding of 4 ! = 24 choices. Among the left paths, we can continue to delete the maximum one, only if there are more than two paths connecting each city. To repeat this process with 4 times (that is, 4 paths are deleted), the number of the left choices is merely 5 ! − 4 &#215; 4 ! = 24 . The effect is very considerable! It</p><p>may greatly reduce the computational complexity, particularly for the problem with large number of cities. This “maximum-deleting method” had thrown some lights on the travelling salesman problem and the P versus NP problem. The subsequent endeavor on the preciseness lifted the mysterious veils of them. The present paper is a report on these.</p></sec><sec id="s2"><title>2. Maximum-Deleting Method</title><p>There is a necessity to re-express the travelling salesman problem in mathematical language. Let n be the total number of the concerned cities (include the origin city, n ≥ 4 ), which are expressed as a series of nodes C k specified by the two-dimensional coordinates ( x k , y k ) ( 1 ≤ k ≤ n ) (the order of the nodes is arbitrarily chosen). The path between every pair of cities is abstracted as a line-segment (in the following we call it by “line” for short) and the one between the i -th and the j -th notes is denoted by l i , j ( 1 ≤ i , j ≤ n with i ≠ j ). Notice that l j , i and l i , j denote the same line, only the case i &lt; j is considered in the following. All these lines compose a set:</p><p>D * = { l i , j : 1 ≤ i , j ≤ n , i &lt; j } ,</p><p>whose number of elements is</p><p>N = ( n − 1 ) + ( n − 2 ) + ⋯ + 2 + 1 = ∑ k = 1 n − 1   k = n ( n − 1 ) 2 . (1)</p><p>The concerned route that visits each city and returns to the origin city can be expressed as a closed loop Q which connects all the n nodes with two requirements:</p><p>1) Each node has two connections (that is, it only connects two lines);</p><p>2) The journey length of Q (that is, the sum of the lengthes for the selected n lines in D * ) should be shortest among all the choices.</p><p>Under the frame of maximum-deleting method, the first requirement is a criterion and the second requirement is a strategy.</p><p>To demonstrate the strategy in a clear way, we arrange the elements in D * by comparing their lengthes defined by the Euclidean distance</p><p>| l i , j | = ( x i − x j ) 2 + ( y i − y j ) 2 (2)</p><p>and get</p><p>D 0 = { l p ( k ) , q ( k ) : 1 ≤ k ≤ N , | l p ( r ) , q ( r ) | ≥ | l p ( r + 1 ) , q ( r + 1 ) |   for   all   1 ≤ r ≤ N − 1 } ,</p><p>where N is given in Equation (1) and the subscripts p ( k ) and q ( k ) are two mappings. For example, in case l 2,5 has the biggest length in D * then it reads l p ( 1 ) , q ( 1 ) in D 0 . For a candidate of Q, its journey-length reads</p><p>S = s 1 + s 2 + ⋯ + s n = ∑ k = 1 n   s k , (3)</p><p>where the chosen lines are also arranged according to the length, and s k denotes the length of the k -th line with s k ≥ s k + 1 for all 1 ≤ k ≤ n − 1 . To put the connectivity aside, the upper and lower bounds of S accord with the choice of the first n terms and the last n terms in D 0 , respectively. Since the candidate of Q is always composed by n segments and each one of them has many choices, to shorten the total length the longest line should be avoided. Precisely, if the length s 1 in Equation (3) corresponds to the first line l p ( 1 ) , q ( 1 ) in D 0 , then the substitution of this line by another one in D 0 with a shorter length s ′ 1 should be beneficial for shortening the possible length S. After deleting l p ( 1 ) , q ( 1 ) one can continue to delete l p ( 2 ) , q ( 2 ) , l p ( 3 ) , q ( 3 ) , ⋯ , only if the line to be deleted has more than two connections on each endpoint. This is an ensemble compressing strategy which squeezes the candidate set for Q close to the last n terms of D 0 . General speaking, it seldom occurs for the last n terms composing a single closed loop (the lower bound of S is seldom achieved). So there always exists some lines l p ( k ) , q ( k ) with k ≤ N − n in the left set, that is, some shorter lines are deleted. This leaves a certain leeway for modifications in the last process where the shortest principle should be obeyed. We note that, when the deleting process is finished, the left lines usually compose many small loops which need to be connected into a single one.</p></sec><sec id="s3"><title>3. Fast Algorithm with Polynomial Time</title><p>Notice that requirement (I) for Q only needs 2 of the n − 1 (≥3) connections for each node, it is always possible for executing the maximum-deleting strategy. The maximum-deleting algorithm for the travelling salesman problem is as follows:</p><p>Step 1. To input n nodes C k and generate all the lines in D * .</p><p>Step 2. To calculate the corresponding line lengths by Equation (2) and arrange them in the form of D 0 [the mapping from D * to D 0 needs to be saved].</p><p><sup>1</sup>After the deleting process, except some particular nodes with 2 m ( m ≥ 2) connections, all the others are the normal nodes which have 2 connections. The reason is that, originally all the nodes have the same number of connections and all the deleted lines connect pairs of nodes, it is impossible for a sole node who remains odd number of connections. In addition, a particular node only connects the normal nodes in its neighborhood, since if it connects another particular one at least two lines between them should be deleted.</p><p>Step 3. To delete the lines in D 0 one by one from the beginning (see <xref ref-type="fig" rid="fig1">Figure 1</xref>), only if the line to be deleted has more than two connections on each endpoint. If there are only two connections left on one of the two endpoints, then skip this line and continue to delete the subsequent smaller one<sup>1</sup>.</p><p>Step 4. If there are some particular nodes, to transform them into the normal ones. For the case in <xref ref-type="fig" rid="fig2">Figure 2</xref>, for example, one can delete l t , r (that is, the line between the nodes C t and C r ) and l t , s and substituted them by adding a single line l r , s . To follow the shortest principle, it needs to compare the lengthes of | l r , s | + | l t , p | + | l t , q | , | l s , p | + | l t , q | + | l t , r | , | l p , q | + | l t , r | + | l t , s | and | l q , r | + | l t , s | + | l t , p | and select the shortest one to substitute. For the case in <xref ref-type="fig" rid="fig3">Figure 3</xref>, the comparison is done on the last three lengthes. For example, in case | l q , r | + | l t , s | + | l t , p | is the shortest, one can delete l t , q and l t , r and add l q , r . If there are some</p><p><sup>2</sup>After Step 4 all the left nodes are the normal ones and the number of left lines is n .</p><p><sup>3 | l s , q | + | l p , r | = O C s + O C r + O C p + O C q &gt; | l p , q | + | l r , s | , | l s , p | + | l q , r | </sup>.</p><p><sup>4</sup>After Step 5 The left n lines compose either a single closed loop or some isolated closed loops without twists.</p><p>particular nodes who own 2 m ( m ≥ 3 ) connections, one can repeat this processing and delete the lines pair by pair until only a pair of connections are left<sup>2</sup>.</p><p>Step 5. If there are two crossed lines as in <xref ref-type="fig" rid="fig4">Figure 4</xref> (responding to a twisted loop), to substitute them by the shortest pair of opposite sides of the quadrilateral<sup>3</sup>. That is, if | l p , q | + | l r , s | &lt; | l s , p | + | l q , r | , then delete l s , q and l p , r and add l p , q and l r , s . For the case in <xref ref-type="fig" rid="fig5">Figure 5</xref>, to delete l s , q , l p , r and add l q , r , l s , p in a direct way. Other crossed cases can be dealt with in the same way<sup>4</sup>.</p><p>Step 6. If the left n lines compose many isolated closed loops, to connect them in the following way: For the cases in <xref ref-type="fig" rid="fig6">Figure 6</xref> and <xref ref-type="fig" rid="fig7">Figure 7</xref>, to find the nearest two neighboring pair of points and make the substitution. Specifically, if | l s , p | + | l r , q | is the shortest length among all the choices, then delete l s , r , l p , q and add l s , p , l r , q .</p><p>Step 7. To modify the unique closed loop according the shortest principle. Firstly, to re-number the nodes from C 1 along this loop in an anticlockwise order; Secondly, to follow this order and search from C 1 for the triangle determined by three neighboring nodes who owns a shortest boundary which is not on the loop, and then make the possible substitution. For example, in <xref ref-type="fig" rid="fig8">Figure 8</xref> the triangle determined by C k , C k + 1 and C k + 2 ( k ≥ 1 ) has a shortest boundary l k , k + 2 which is not on the loop. If | l k , k + 2 | + | l k + 1 , k + 3 | &lt; | l k , k + 1 | + | l k + 2 , k + 3 | , then delete l k , k + 1 , l k + 2, k + 3 and add l k , k + 2 , l k + 1, k + 3 . To continue searching for this kind of triangles along the loop and do the processing one by one until it returns back to C 1 .</p><p>According to this algorithm, when Step 3 is finished all the possible longer lines are deleted and the left ones compose either a single closed loop or many small closed loops. The determined thing is that the firstly generated normal node only remains two shortest connections. For the subsequent generated normal nodes, in the sake of connectivity each of them either remains two shortest connections or share one or two lines with the previously generated nodes (it doesn't matter whether they connect a particular node). Since the deleting processing is done from the longest one, it reduces all the possible longer connections respect to all the n nodes, and, to insure the connectivity, there are no other choices for a given node possessing a relatively shorter connection. So the closed loop to be found is based on the left lines with the shortest sum of lengths. In the subsequent steps, the small loops are opened and connected together. During this process the shortest principle is obeyed and the total length of the candidate loop is reduced to the maximum extent. So the final closed loop has the shortest length among all the choices. It is the anticipated solution for the travelling salesman problem.</p><p>Theorem 1. The maximum-deleting algorithm for the travelling salesman problem has a polynomial time of order O ( n 4 ) .</p><p>Proof: It follows from the definition of D * that the first step of this algorithm costs computation time of about K 1 N = K 1 &#215; n ( n − 1 ) / 2 = O ( n 2 ) , where K 1 is a constant. To select the longest line in D * it needs to make N − 1 times comparison. To select the second longest line it needs to make N − 2 times comparison ⋯ . So the arranging process for all the lines in the second step needs a computation time:</p><p>∑ k = 1 N − 1   k = N ( N − 1 ) 2 = 1 8 n 2 ( n − 1 ) 2 − 1 4 n ( n − 1 ) = O ( n 4 ) .</p><p>The corresponding saving process needs a time of about O ( N ) = O ( n 2 ) . The deleting process in Step 3 also needs a time of about O ( N ) = O ( n 2 ) . From Step 4 to Step 7, only some of the lines are adjusted. In each step, the number of involved lines is no more than 2 n . To include the judgements and substitutions, all the calculating process costs computation time of about O ( n ) . Hence, the computational complexity of this algorithm is determined by the second step, and all the process requires a polynomial time of order O ( n 4 ) . The proof is finished.</p><p>Corollary 1. P = NP.</p><p>Proof: On the one hand, it follows from [<xref ref-type="bibr" rid="scirp.89255-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.89255-ref6">6</xref>] that the travelling salesman problem is NP-complete; On the other hand, we have found a fast algorithm for the travelling salesman problem which can be executed on computer with a polynomial time. In another word, we have found a language L for a NP-complete problem in P. It follows from Proposition 1 that P = NP. The proof is finished.</p></sec><sec id="s4"><title>4. Conclusion</title><p>By using a new approach named “maximum-deleting method”, we have constructed a fast algorithm for the travelling salesman problem with a polynomial time of order O ( n 4 ) , which will greatly reduce the computational complexity. Notice that this problem is NP-complete, as a corollary, we have also solved the well-known open problem named “P versus NP”. The result indicates that P = NP which will result in a surprise to all, since great majority of people have believed that P ≠ NP.</p></sec><sec id="s5"><title>Conflicts of Interest</title><p>The author declares no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s6"><title>Cite this paper</title><p>Wang, J.L. (2018) Fast Algorithm for the Travelling Salesman Problem and the Proof of P = NP. Applied Mathematics, 9, 1351-1359. https://doi.org/10.4236/am.2018.912088</p></sec></body><back><ref-list><title>References</title><ref id="scirp.89255-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Wikipedia (the Free Encyclopedia), Travelling Salesman Problem.  
https://en.wikipedia.org/wiki/Travelling_salesman_problem</mixed-citation></ref><ref id="scirp.89255-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Devlin, K.J. (2003) The Millennium Problems: The Seven Greatest Unsolved Mathematical Puzzles of Our Time. Basic Books, New York.</mixed-citation></ref><ref id="scirp.89255-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Cook, S. (2018) Official Problem Description: The P versus NP Problem.  
http://www.claymath.org/millennium-problems/p-vs-np-problem</mixed-citation></ref><ref id="scirp.89255-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Wikipedia (the Free Encyclopedia), P versus NP Problem.  
https://en.wikipedia.org/wiki/P_versus_NP_problem</mixed-citation></ref><ref id="scirp.89255-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Cook, S. (1971) The Complexity of Theorem-Proving Procedures. Conference Record of Third Annual ACM Symposium on Theory of Computing, ACM, New York, 151-158.</mixed-citation></ref><ref id="scirp.89255-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Garey, M.R. and Johnson, D.S. (1979) Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, San Francisco.</mixed-citation></ref></ref-list></back></article>