Jump to content

Hamiltonian path problem: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
mNo edit summary
Line 106: Line 106:
<math>\operatorname{ham\left ( \begin{matrix}A_{11} & A_{12}\\ A_{21} & A_{22}\end{matrix} \right) = det^{2}\left ( A_{11} \right )ham\left ( \begin{matrix}A_{11}^{-1} & A_{11}^{-1}A_{12}\\ A_{21}A_{11}^{-1} & A_{22} + A_{21}A_{11}^{-1}A_{12}\end{matrix} \right )}</math>
<math>\operatorname{ham\left ( \begin{matrix}A_{11} & A_{12}\\ A_{21} & A_{22}\end{matrix} \right) = det^{2}\left ( A_{11} \right )ham\left ( \begin{matrix}A_{11}^{-1} & A_{11}^{-1}A_{12}\\ A_{21}A_{11}^{-1} & A_{22} + A_{21}A_{11}^{-1}A_{12}\end{matrix} \right )}</math>


and, due to the fact that the Hamiltonian cycle polynomial doesn't depend on the matrix's diagonal entris, adding an arbitrary diagonal matrix doesn't change this polynomial too. These two types of transformation don't compress the matrix, but keep its size unchanged.
and, due to the fact that the Hamiltonian cycle polynomial doesn't depend on the matrix's diagonal entris, adding an arbitrary diagonal matrix doesn't change this polynomial too. These two types of transformation don't compress the matrix, but keep its size unchanged. However, in a number of cases their application alow to reduce the matrix's size by some of the above-mentioned compression operators.
Thus there is a variety of matrix compression or size-preserving operators performed in polynomial time and preserving the Hamiltonian cycle polynomial in characteristic 2 whose sequential application, together with the transposition transformation (utilized each time the operators leave the matrix intact) has, for each matrix, a certain limit that can be defined as the compression-closure operator. When applied to classes of matrices, that operator thus maps one class into another. As it was proven in ({{harvtxt|Knezevic|Cohen|2017}}), if the compression-closure operator maps the class of unitary matrices into all the set of square matrices over an infinite field of characteristic 2 then the Hamiltonian cycle polynomial is computable in polynomial time over any field of this characteristic what would imply the equality RP = NP.
Hence there is a variety of matrix compression operators performed in polynomial time and preserving the Hamiltonian cycle polynomial in characteristic 2 whose sequential application, together with the transposition transformation (utilized each time the operators leave the matrix intact) has, for each matrix, a certain limit that can be defined as the compression-closure operator. When applied to classes of matrices, that operator thus maps one class into another. As it was proven in ({{harvtxt|Knezevic|Cohen|2017}}), if the compression-closure operator maps the class of unitary matrices into all the set of square matrices over an infinite field of characteristic 2 then the Hamiltonian cycle polynomial is computable in polynomial time over any field of this characteristic what would imply the equality RP = NP.





Revision as of 04:32, 26 August 2019

In the mathematical field of graph theory the Hamiltonian path problem and the Hamiltonian cycle problem are problems of determining whether a Hamiltonian path (a path in an undirected or directed graph that visits each vertex exactly once) or a Hamiltonian cycle exists in a given graph (whether directed or undirected). Both problems are NP-complete.[1]

The Hamiltonian cycle problem is a special case of the travelling salesman problem, obtained by setting the distance between two cities to one if they are adjacent and two otherwise, and verifying that the total distance travelled is equal to n (if so, the route is a Hamiltonian circuit; if there is no Hamiltonian circuit then the shortest route will be longer).

Reduction between the path problem and the cycle problem

There is a simple relation between the problems of finding a Hamiltonian path and a Hamiltonian cycle:

  • In one direction, the Hamiltonian path problem for graph G is equivalent to the Hamiltonian cycle problem in a graph H obtained from G by adding a new vertex x and connecting x to all vertices of G. Thus, finding a Hamiltonian path cannot be significantly slower (in the worst case, as a function of the number of vertices) than finding a Hamiltonian cycle.
  • In the other direction, the Hamiltonian cycle problem for a graph G is equivalent to the Hamiltonian path problem in the graph H obtained by copying one vertex v of G, v', that is, letting v' have the same neighbourhood as v, and by adding two dummy vertices of degree one, and connecting them with v and v', respectively.[2]

Algorithms

There are n! different sequences of vertices that might be Hamiltonian paths in a given n-vertex graph (and are, in a complete graph), so a brute force search algorithm that tests all possible sequences would be very slow. An early exact algorithm for finding an Hamiltonian cycle on a directed graph was the enumerative algorithm of Martello[3]. A search procedure by Frank Rubin[4] divides the edges of the graph into three classes: those that must be in the path, those that cannot be in the path, and undecided. As the search proceeds, a set of decision rules classifies the undecided edges, and determines whether to halt or continue the search. The algorithm divides the graph into components that can be solved separately. Also, a dynamic programming algorithm of Bellman, Held, and Karp can be used to solve the problem in time O(n2 2n). In this method, one determines, for each set S of vertices and each vertex v in S, whether there is a path that covers exactly the vertices in S and ends at v. For each choice of S and v, a path exists for (S,v) if and only if v has a neighbor w such that a path exists for (S − v,w), which can be looked up from already-computed information in the dynamic program.[5][6]

Andreas Björklund provided an alternative approach using the inclusion–exclusion principle to reduce the problem of counting the number of Hamiltonian cycles to a simpler counting problem, of counting cycle covers, which can be solved by computing certain matrix determinants. Using this method, he showed how to solve the Hamiltonian cycle problem in arbitrary n-vertex graphs by a Monte Carlo algorithm in time O(1.657n); for bipartite graphs this algorithm can be further improved to time o(1.415n).[7]

For graphs of maximum degree three, a careful backtracking search can find a Hamiltonian cycle (if one exists) in time O(1.251n).[8]

Hamiltonian paths and cycles can be found using a SAT solver.

Because of the difficulty of solving the Hamiltonian path and cycle problems on conventional computers, they have also been studied in unconventional models of computing. For instance, Leonard Adleman showed that the Hamiltonian path problem may be solved using a DNA computer. Exploiting the parallelism inherent in chemical reactions, the problem may be solved using a number of chemical reaction steps linear in the number of vertices of the graph; however, it requires a factorial number of DNA molecules to participate in the reaction.[9]

An optical solution to the Hamiltonian problem has been proposed in [10]. The idea is to create a graph-like structure made from optical cables and beam splitters which are traversed by light in order to construct a solution for the problem. The weak point of this approach is the required amount of energy which is exponential in the number of nodes.

The Hamiltonian cycle polynomial

An algebraic option sometimes useful for determining the existence of a Hamiltonian cycle in a directed graph is using the Hamiltonian cycle polynomial of an n×n-matrix defined as where is the set of n-permutations having exactly one cycle. It's a generalization of the number of Hamiltonian cycles of a digraph as the sum of the products of its Hamiltonian cycles' arc weights (all of whom equal unity) for weighted digraphs with arc weights taken from a given commutative ring. In the meantime, for an undirected weighted graph the sum of the products of the edge weights of its Hamiltonian cycles containing any fixed edge (i,j) can be expressed as the product of the weight of (i,j) and the Hamiltonian cycle polynomial of the matrix received from its weighted adjacency matrix via removing the i-th row and the j-th column.

In (Knezevic & Cohen (2017)) it was shown that where is the submatrix of induced by the rows and columns of indexed by , and is the complement of in , while the determinant of the empty submatrix is defined to be 1. In a field of characteristic 2 the latter equality turns into what therefore provides an opportunity to polynomial-time calculate the Hamiltonian cycle polynomial of any unitary matrix (i.e. such that where is the identity n×n-matrix), because in such a field each minor of a unitary matrix coincides with its algebraic complement: where is the identity n×n-matrix with the entry of indexes 1,1 replaced by 0. Hence if it's possible to assign weights from a field of characteristic 2 to a digraph's arcs that make its weighted adjacency matrix unitary and the Hamiltonian cycle polynomial of this matrix is non-zero then the digraph is Hamiltonian.

Besides, in an arbitrary ring for any skew-symmetric n×n-matrix there exists a power series in a formal variable : such that it's a unitary n×n-matrix over and , , while for any satisfying these conditions equals the coefficient at the -th power of in the power series . It implies that computing, up to the -th power of , the Hamiltonian cycle polynomial of a unitary n×n-matrix over the infinite extension of any ring of characteristic q (not necessarily prime) by the formal variable is a #q-P-complete problem if isn't 2 and computing the Hamiltonian cycle polynomial of a -semi-unitary matrix (i.e. an n×n-matrix such that ) over such an extension of any ring of characteristic 2 is a #2-P-complete problem for any > 0 (because any -semi-unitary matrix can be received from a unitary matrix via removing rows and columns). For the latter statement can be re-formulated as the #2-P-completeness of computing, for a given unitary n×n-matrix over a field of characteristic 2, the n×n-matrix whose i,j-th entry is the Hamiltonian cycle polynomial of the matrix received from via removing its i-th row and j-th column. This matrix satisfies the following matrix equation: .

Moreover, it would be worth noting that in characteristic 2 the Hamiltonian cycle polynomial possesses its invariant matrix compressions (partly analogical to the Gaussian modification that is invariant for the determinant), taking into account the fact that for any t×t-matrix having three equal rows or, if > 2, a pair of indexes i,j such that its i-th and j-th rows are identical and its i-th and j-th columns are identical too. Hence if a matrix has two equal rows then adding one of them to any third one doesn't change this polynomial in characteristic 2, and also it isn't changed by adding the i-th column to the j-th one in a matrix where the i-th and j-th rows are identical. These facts, particularly, yield in characteristic 2 the identity for an n×n-matrix , m×m-matrices and diagonal , m×n-matrix and n×m-matrix .

This identity's restriction to the case when is unitary, and , where is the identity m×m-matrix, makes the (2m+n)×(2m+n)-matrix in the equality's right side unitary and its Hamiltonian cycle polynomial computable, hence, in polynomial time what therefore generalizes the above-given formula for the Hamiltonian cycle polynomial of a unitary matrix.

Apart from the above-mentioned compression transformations, in characteristic 2 the following relation is also valid for the Hamiltonian cycle polynomials of a matrix and its partial inverse (for and being square, being invertible):

and, due to the fact that the Hamiltonian cycle polynomial doesn't depend on the matrix's diagonal entris, adding an arbitrary diagonal matrix doesn't change this polynomial too. These two types of transformation don't compress the matrix, but keep its size unchanged. However, in a number of cases their application alow to reduce the matrix's size by some of the above-mentioned compression operators.

Hence there is a variety of matrix compression operators performed in polynomial time and preserving the Hamiltonian cycle polynomial in characteristic 2 whose sequential application, together with the transposition transformation (utilized each time the operators leave the matrix intact) has, for each matrix, a certain limit that can be defined as the compression-closure operator. When applied to classes of matrices, that operator thus maps one class into another. As it was proven in (Knezevic & Cohen (2017)), if the compression-closure operator maps the class of unitary matrices into all the set of square matrices over an infinite field of characteristic 2 then the Hamiltonian cycle polynomial is computable in polynomial time over any field of this characteristic what would imply the equality RP = NP.


Complexity

The problem of finding a Hamiltonian cycle or path is in FNP; the analogous decision problem is to test whether a Hamiltonian cycle or path exists. The directed and undirected Hamiltonian cycle problems were two of Karp's 21 NP-complete problems. They remain NP-complete even for special kinds of graphs, such as:

However, for some special classes of graphs, the problem can be solved in polynomial time:

  • 4-connected planar graphs are always Hamiltonian by a result due to Tutte, and the computational task of finding a Hamiltonian cycle in these graphs can be carried out in linear time[17] by computing a so-called Tutte path.
  • Tutte proved this result by showing that every 2-connected planar graph contains a Tutte path. Tutte paths in turn can be computed in quadratic time even for 2-connected planar graphs[18], which may be used to find Hamiltonian cycles and long cycles in generalizations of planar graphs.

Putting all of these conditions together, it remains open whether 3-connected 3-regular bipartite planar graphs must always contain a Hamiltonian cycle, in which case the problem restricted to those graphs could not be NP-complete; see Barnette's conjecture.

In graphs in which all vertices have odd degree, an argument related to the handshaking lemma shows that the number of Hamiltonian cycles through any fixed edge is always even, so if one Hamiltonian cycle is given, then a second one must also exist.[19] However, finding this second cycle does not seem to be an easy computational task. Papadimitriou defined the complexity class PPA to encapsulate problems such as this one.[20]

References

Media related to Hamiltonian path problem at Wikimedia Commons

  1. ^ Michael R. Garey and David S. Johnson (1979), Computers and Intractability: A Guide to the Theory of NP-Completeness, W.H. Freeman, ISBN 978-0-7167-1045-5 A1.3: GT37–39, pp. 199–200.
  2. ^ Reduction from Hamiltonian cycle to Hamiltonian path
  3. ^ Martello, Silvano (1983), "An Enumerative Algorithm for Finding Hamiltonian Circuits in a Directed Graph", ACM Transactions on Mathematical Software, 9 (1): 131–138, doi:10.1145/356022.356030
  4. ^ Rubin, Frank (1974), "A Search Procedure for Hamilton Paths and Circuits", Journal of the ACM, 21 (4): 576–80, doi:10.1145/321850.321854.
  5. ^ Bellman, R. (1962), "Dynamic programming treatment of the travelling salesman problem", Journal of the ACM, 9: 61–63, doi:10.1145/321105.321111.
  6. ^ Held, M.; Karp, R. M. (1962), "A dynamic programming approach to sequencing problems", J. SIAM, 10 (1): 196–210, doi:10.1137/0110015, hdl:10338.dmlcz/103900.
  7. ^ Björklund, Andreas (2010), "Determinant sums for undirected Hamiltonicity", Proc. 51st IEEE Symposium on Foundations of Computer Science (FOCS '10), pp. 173–182, arXiv:1008.0541, doi:10.1109/FOCS.2010.24, ISBN 978-1-4244-8525-3.
  8. ^ Iwama, Kazuo; Nakashima, Takuya (2007), "An improved exact algorithm for cubic graph TSP", Proc. 13th Annual International Conference on Computing and Combinatorics (COCOON 2007), Lecture Notes in Computer Science, vol. 4598, pp. 108–117, CiteSeerX 10.1.1.219.1672, doi:10.1007/978-3-540-73545-8_13, ISBN 978-3-540-73544-1.
  9. ^ Adleman, Leonard (November 1994), "Molecular computation of solutions to combinatorial problems", Science, 266 (5187): 1021–1024, Bibcode:1994Sci...266.1021A, CiteSeerX 10.1.1.54.2565, doi:10.1126/science.7973651, JSTOR 2885489, PMID 7973651.
  10. ^ Mihai Oltean (2006). A light-based device for solving the Hamiltonian path problem. Unconventional Computing. Springer LNCS 4135. pp. 217–227. arXiv:0708.1496. doi:10.1007/11839132_18.
  11. ^ "Proof that the existence of a Hamilton Path in a bipartite graph is NP-complete". Computer Science Stack Exchange. Retrieved 2019-03-18.
  12. ^ Garey, M. R.; Johnson, D. S.; Stockmeyer, L. (1974), "Some simplified NP-complete problems", Proc. 6th ACM Symposium on Theory of Computing (STOC '74), pp. 47–63, doi:10.1145/800119.803884.
  13. ^ Plesńik, J. (1979), "The NP-completeness of the Hamiltonian cycle problem in planar digraphs with degree bound two" (PDF), Information Processing Letters, 8 (4): 199–201, doi:10.1016/0020-0190(79)90023-1.
  14. ^ Akiyama, Takanori; Nishizeki, Takao; Saito, Nobuji (1980–1981), "NP-completeness of the Hamiltonian cycle problem for bipartite graphs", Journal of Information Processing, 3 (2): 73–76, MR 0596313.
  15. ^ Itai, Alon; Papadimitriou, Christos; Szwarcfiter, Jayme (1982), "Hamilton Paths in Grid Graphs", SIAM Journal on Computing, 4 (11): 676–686, CiteSeerX 10.1.1.383.1078, doi:10.1137/0211056.
  16. ^ Buro, Michael (2000), "Simple Amazons endgames and their connection to Hamilton circuits in cubic subgrid graphs" (PDF), Conference on Computers and Games, Lecture Notes in Computer Science, vol. 2063, pp. 250–261, CiteSeerX 10.1.1.40.9731, doi:10.1007/3-540-45579-5_17, ISBN 978-3-540-43080-3.
  17. ^ Chiba, Norishige; Nishizeki, Takao (1989), "The Hamiltonian cycle problem is linear-time solvable for 4-connected planar graphs", Journal of Algorithms, 10 (2): 187–211, doi:10.1016/0196-6774(89)90012-6
  18. ^ Schmid, Andreas; Schmidt, Jens M. (2018), "Computing Tutte Paths", Proceedings of the 45th International Colloquium on Automata, Languages and Programming (ICALP'18), to appear.
  19. ^ Thomason, A. G. (1978), "Hamiltonian cycles and uniquely edge colourable graphs", Advances in Graph Theory (Cambridge Combinatorial Conf., Trinity College, Cambridge, 1977), Annals of Discrete Mathematics, vol. 3, pp. 259–268, doi:10.1016/S0167-5060(08)70511-9, ISBN 9780720408430, MR 0499124.
  20. ^ Papadimitriou, Christos H. (1994), "On the complexity of the parity argument and other inefficient proofs of existence", Journal of Computer and System Sciences, 48 (3): 498–532, doi:10.1016/S0022-0000(05)80063-7, MR 1279412.