Fast Algorithm for the Travelling Salesman Problem and the Proof of P = NP
Vol.09No.12(2018), Article ID:89255,9 pages
10.4236/am.2018.912088
Jinliang Wang
Research Institute for ESMD Method and Its Applications, College of Science, Qingdao University of Technology, Qingdao, China
Copyright © 2018 by author and Scientific Research Publishing Inc.
This work is licensed under the Creative Commons Attribution International License (CC BY 4.0).
http://creativecommons.org/licenses/by/4.0/
Received: November 26, 2018; Accepted: December 17, 2018; Published: December 20, 2018
ABSTRACT
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”.
Keywords:
Travelling Salesman Problem, P versus NP Problem, NP-Complete, Computational Complexity, Maximum-Deleting Method
1. Introduction
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?” [1] . In the theory of computational complexity, this problem is a typical one in the NP class [1] [2] . 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 [3] [4] . 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.
The proof of P = NP is associated with an important concept, named “NP-complete”, which was firstly proposed by Cook in 1971 [5] . 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 [3] [4] . Hence, to prove the including relationship NP Í P it only requires the consideration of a single arbitrarily-chosen NP-complete problem (P Í NP is naturally satisfied). The precise expression is given by Cook in [3] as follows:
Proposition 1. Let L be a language over a finite alphabet. If L is NP-complete and L belongs to P then P = NP.
It follows from [1] [2] [4] [6] 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 [1] ). But the associated computational-complexity problem is still suspended till now. Just as indicated by Devlin in [2] , to solve this it requires an unusual but wonderful thinking!
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 Figure 1). 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 choices. Yet the deleting of one path implies the avoiding of 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 . The effect is very considerable! It
Figure 1. Example for the travelling salesman problem with 6 cites.
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.
2. Maximum-Deleting Method
There is a necessity to re-express the travelling salesman problem in mathematical language. Let be the total number of the concerned cities (include the origin city, ), which are expressed as a series of nodes specified by the two-dimensional coordinates ( ) (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 -th and the -th notes is denoted by ( with ). Notice that and denote the same line, only the case is considered in the following. All these lines compose a set:
whose number of elements is
(1)
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 nodes with two requirements:
1) Each node has two connections (that is, it only connects two lines);
2) The journey length of Q (that is, the sum of the lengthes for the selected lines in ) should be shortest among all the choices.
Under the frame of maximum-deleting method, the first requirement is a criterion and the second requirement is a strategy.
To demonstrate the strategy in a clear way, we arrange the elements in by comparing their lengthes defined by the Euclidean distance
(2)
and get
where is given in Equation (1) and the subscripts and are two mappings. For example, in case has the biggest length in then it reads in . For a candidate of Q, its journey-length reads
(3)
where the chosen lines are also arranged according to the length, and denotes the length of the -th line with for all . To put the connectivity aside, the upper and lower bounds of S accord with the choice of the first terms and the last terms in , respectively. Since the candidate of Q is always composed by segments and each one of them has many choices, to shorten the total length the longest line should be avoided. Precisely, if the length in Equation (3) corresponds to the first line in , then the substitution of this line by another one in with a shorter length should be beneficial for shortening the possible length S. After deleting one can continue to delete , , , 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 terms of . General speaking, it seldom occurs for the last terms composing a single closed loop (the lower bound of S is seldom achieved). So there always exists some lines with 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.
3. Fast Algorithm with Polynomial Time
Notice that requirement (I) for Q only needs 2 of the (≥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:
Step 1. To input nodes and generate all the lines in .
Step 2. To calculate the corresponding line lengths by Equation (2) and arrange them in the form of [the mapping from to needs to be saved].
1After the deleting process, except some particular nodes with 2 ( ≥ 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.
Step 3. To delete the lines in one by one from the beginning (see Figure 1), 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 one1.
Step 4. If there are some particular nodes, to transform them into the normal ones. For the case in Figure 2, for example, one can delete (that is, the line between the nodes and ) and and substituted them by adding a single line . To follow the shortest principle, it needs to compare the lengthes of , , and and select the shortest one to substitute. For the case in Figure 3, the comparison is done on the last three lengthes. For example, in case is the shortest, one can delete and and add . If there are some
Figure 2. One case with particular node.
Figure 3. Another case with particular node.
2After Step 4 all the left nodes are the normal ones and the number of left lines is .
3 .
4After Step 5 The left lines compose either a single closed loop or some isolated closed loops without twists.
particular nodes who own 2 ( ) connections, one can repeat this processing and delete the lines pair by pair until only a pair of connections are left2.
Step 5. If there are two crossed lines as in Figure 4 (responding to a twisted loop), to substitute them by the shortest pair of opposite sides of the quadrilateral3. That is, if , then delete and and add and . For the case in Figure 5, to delete , and add , in a direct way. Other crossed cases can be dealt with in the same way4.
Step 6. If the left lines compose many isolated closed loops, to connect them in the following way: For the cases in Figure 6 and Figure 7, to find the nearest two neighboring pair of points and make the substitution. Specifically, if is the shortest length among all the choices, then delete , and add , .
Figure 4. A case with crossed lines.
Figure 5. Another case with crossed lines.
Figure 6. One positional relation for two isolated loops.
Step 7. To modify the unique closed loop according the shortest principle. Firstly, to re-number the nodes from along this loop in an anticlockwise order; Secondly, to follow this order and search from 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 Figure 8 the triangle determined by , and ( ) has a shortest boundary which is not on the loop. If , then delete , and add , . To continue searching for this kind of triangles along the loop and do the processing one by one until it returns back to .
Figure 7. Another positional relation for two isolated loops.
Figure 8. The possible case in the final modifying process.
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 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.
Theorem 1. The maximum-deleting algorithm for the travelling salesman problem has a polynomial time of order .
Proof: It follows from the definition of that the first step of this algorithm costs computation time of about , where is a constant. To select the longest line in it needs to make times comparison. To select the second longest line it needs to make times comparison . So the arranging process for all the lines in the second step needs a computation time:
The corresponding saving process needs a time of about . The deleting process in Step 3 also needs a time of about . 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 . To include the judgements and substitutions, all the calculating process costs computation time of about . Hence, the computational complexity of this algorithm is determined by the second step, and all the process requires a polynomial time of order . The proof is finished.
Corollary 1. P = NP.
Proof: On the one hand, it follows from [1] [2] [4] [6] 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 for a NP-complete problem in P. It follows from Proposition 1 that P = NP. The proof is finished.
4. Conclusion
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 , 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.
Conflicts of Interest
The author declares no conflicts of interest regarding the publication of this paper.
Cite this paper
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
References
- 1. Wikipedia (the Free Encyclopedia), Travelling Salesman Problem. https://en.wikipedia.org/wiki/Travelling_salesman_problem
- 2. Devlin, K.J. (2003) The Millennium Problems: The Seven Greatest Unsolved Mathematical Puzzles of Our Time. Basic Books, New York.
- 3. Cook, S. (2018) Official Problem Description: The P versus NP Problem. http://www.claymath.org/millennium-problems/p-vs-np-problem
- 4. Wikipedia (the Free Encyclopedia), P versus NP Problem. https://en.wikipedia.org/wiki/P_versus_NP_problem
- 5. 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.
- 6. Garey, M.R. and Johnson, D.S. (1979) Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, San Francisco.
上一篇:Ordered Rate Constitutive Theo 下一篇:Development of a Tool Cost Opt
最新文章NEWS
- Ordered Rate Constitutive Theories for Non-Classical Thermoviscoelastic Fluids with Internal Rotatio
- Modeling and Numerical Solution of a Cancer Therapy Optimal Control Problem
- Extended Wiener Measure by Nonstandard Analysis for Financial Time Series
- Methodology for Constructing a Short-Term Event Risk Score in Heart Failure Patients
- Application of Conjugate Gradient Approach for Nonlinear Optimal Control Problem with Model-Reality
- On the Dynamics of Transition of a Classical System to Equilibrium State
- On the ECI and CEI of Boron-Nitrogen Fullerenes
- Binomial Hadamard Series and Inequalities over the Spectra of a Strongly Regular Graph
推荐期刊Tui Jian
- Chinese Journal of Integrative Medicine
- Journal of Genetics and Genomics
- Journal of Bionic Engineering
- Chinese Journal of Structural Chemistry
- Pedosphere
- Nuclear Science and Techniques
- 《传媒》
- 《哈尔滨师范大学自然科学学报》
热点文章HOT
- On Existence of Periodic Solutions of Certain Second Order Nonlinear Ordinary Differential Equations
- Ordered Rate Constitutive Theories for Non-Classical Thermoviscoelastic Fluids with Internal Rotatio
- Application of Conjugate Gradient Approach for Nonlinear Optimal Control Problem with Model-Reality
- Fuzzy Modelling for Predicting the Risk of Recurrence and Progression of Superficial Bladder Tumors
- Modeling and Numerical Solution of a Cancer Therapy Optimal Control Problem
- Integer Wavelet-Based Image Interpolation in Lifting Structure for Image Resolution Enhancement
- A Review of Some Reference Analytic Solutions for the Magnetohydrodynamic Flow of Blood
- A Computational Study with Finite Difference Methods for Second Order Quasilinear Hyperbolic Partial