The Complexity of HCP in Digraps with Degree Bound Two
Guohun Zhu

TL;DR
This paper demonstrates that the Hamiltonian cycle problem in directed graphs with maximum degree two can be solved in polynomial time using novel mappings, challenging the typical NP-complete classification.
Contribution
It introduces two mappings that establish polynomial solutions for HCP in degree-two digraphs and claims to prove P=NP based on these results.
Findings
HCP in degree-two digraphs is polynomially solvable.
A bijection between incidence matrices of digraphs and bipartite graphs.
Finding non-isomorphic Hamiltonian cycles is also polynomial.
Abstract
The Hamiltonian cycle problem (HCP) in digraphs D with degree bound two is solved by two mappings in this paper. The first bijection is between an incidence matrix C_{nm} of simple digraph and an incidence matrix F of balanced bipartite undirected graph G; The second mapping is from a perfect matching of G to a cycle of D. It proves that the complexity of HCP in D is polynomial, and finding a second non-isomorphism Hamiltonian cycle from a given Hamiltonian digraph with degree bound two is also polynomial. Lastly it deduces P=NP base on the results.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGraph theory and applications · graph theory and CDMA systems · Graph Labeling and Dimension Problems
11institutetext: Guilin University of Electronic Technology,
No.1 Jinji Road,Guilin, Guangxi, 541004,P.R.China
11email: [email protected]
The Complexity of HCP in Digraps with Degree
Bound Two
Guohun Zhu
Abstract
The Hamiltonian cycle problem (HCP) in digraphs with degree bound two is solved by two mappings in this paper. The first bijection is between an incidence matrix of simple digraph and an incidence matrix of balanced bipartite undirected graph ; The second mapping is from a perfect matching of to a cycle of . It proves that the complexity of HCP in is polynomial, and finding a second non-isomorphism Hamiltonian cycle from a given Hamiltonian digraph with degree bound two is also polynomial. Lastly it deduces base on the results.
1 Introduction
It is well known that the Hamiltonian cycle problem(HCP) is one of the standard NP-complete problem [1]. As for digraphs, even when the digraphs on this case: planar digraphs with indegree 1 or 2 and outdegree 2 or 1 respectively, it is still which is proved by J.Plesník [2].
Let us named a simple strong connected digraphs with at most indegree 1 or 2 and outdegree 2 or 1 as digraphs. This paper solves the HCP of digraphs with following main results.
Theorem 1.1
Given an incidence matrix of digraph, building a mapping:F=\left({\begin{array}[]{c c}C^{+}\\ -C^{-}\end{array}}\right), then is a incidence matrix of undirected balanced bipartite graph , which obeys the following properties:
- c1.
,,** 2. c2.
[TABLE]
[TABLE] 3. c3.
* has at most components which is length of .*
Let us named the undirected balanced bipartite graph of digraph as projector graph.
Theorem 1.2
Let be the projector graph of a graph , determining a Hamiltonian cycle in digraph is equivalent to find a perfect match in and , where is the incidence matrix of and .
Let the each component of corresponding to a boolean variable, a monotonic function is build to represents the number of component in . Based on this function, the maximum number of non-isomorphism perfect matching is linear, thus complexity of digraphs has a answer.
Theorem 1.3
Given the incidence matrix of a digraph , the complexity of finding a Hamiltonian cycle existing or not is
The concepts of cycle and rank of graph are given in section . Then theorems ,, are proved in sections ,, respectively. The last section discusses the versus in more detail.
2 Definition and properties
Throughout this paper we consider the finite simple (un)directed graph (, respectively), i.e. the graph has no multi-arcs and no self loops. Let and denote the number of vertices and arcs (edges , respectively), respectively.
As conventional, let denote the number of a set . The set of vertices and set of arcs of of a digraph are denoted by and respectively, where is a arc from to . Let the out degree of vertex denoted by , which has the in degree by denoted as and has the degree which equals . Let the , and .
Let us define a forward relation between two arcs as following, . It is obvious that .
A *cycle * is a set of arcs in a digraph , which obeys two conditions:
- c1.
2. c2.
If a cycle obeys the following conditions, it is a simple cycle.
- c3.
, does not satisfy both conditions and .
A Hamiltonian cycle is also a simple cycle of length in digraph. As for simplify, this paper given a sufficient condition of Hamiltonian cycle in digraph.
Lemma 1
If a digraph include a sub graph with following two properties, the is a Hamiltonian graph.
- c1.
, 2. c2.
* and is a strong connected digraph.*
A graph that has at least one Hamiltonian cycle is called a Hamiltonian graph. A graph G= is bipartite if the vertex set can be partitioned into two sets and (the bipartition) such that , (, respectively). if , We call that is a balanced bipartite graph. A matching is a collection of edges such that every vertex of is incident to at most one edge of , a matching of balanced bipartite graph is perfect if . Hopcroft and Karp shows that constructs a perfect matching of bipartite in [3]. The matching of bipartite has a relation with neighborhood of .
Theorem 2.1
[4*]**
A bipartite graph has a matching from into if and only if , for any .*
Lemma 2
A even length of simple cycle consist of two disjoin perfect matching.
Two matrices representation for graphs are defined as follows.
Definition 1
[5] The incidence matrix of undirected graph is a two dimensional table, each row represents one vertex, each column represents one edge, the in are given by
[TABLE]
It is obvious that every column of an incidence matrix has exactly two entries.
Definition 2
[5] The incidence matrix of directed graph is a two dimensional table, each row represents one vertex, each column represents one arc the in are given by
[TABLE]
It is obvious to obtain a corollary of the incidence matrix as following.
Corollary 1
Each column of an incidence matrix of digraph has exactly one and one entries.
Theorem 2.2
[5]** The is the incidence matrix of a directed graph with components the rank of is given by
[TABLE]
In order to convince to describe the graph properties, in this paper, we denotes the .
3 Divided incidence matrix and Projector incidence matrix
Firstly, let us divided the matrix of into two groups.
[TABLE]
[TABLE]
It is obvious that the matrix of represents the forward arc of a digraph and matrix represents the backward arc respectively. A corollary is deduced as following.
Corollary 2
A digraph is strong connected if and only if the rank of divided incidence matrix satisfies .
Secondly, let us combined the the and as following matrix.
[TABLE]
In more additional, let represents as an incidence matrix of undirected graph . The is named as *projector incidence matrix * of and is named as *projector graph *, where represents the vertices of , represents the vertices of respectively. In another words we build a mapping and denotes it as . So the has vertices and edges if has vertices and arcs. We also build up a reverse mapping: When is a projector graph. To simplify, we also denotes the arcs , and .
3.1 Proof of Theorem 1.1
Firstly, let us prove the theorem 1.1.
Proof
- c1.
Since digraph is strong connected, then each vertices of digraph has at least one forward arcs, each row of has at least one entries, and the represents the , so
[TABLE]
the same principle of , each row of has at least one entries, and the represents the , so
[TABLE]
Since the columns of equal to the columns of ,
[TABLE] 2. c2.
Since the degree of each of digraph is ,
[TABLE]
Since the degree of each of digraph is ,
[TABLE] 3. c3.
Let us prove by contradiction, suppose there are components with length of in . Since is strong connected, according to the corollary 2, , where is number of components (including components with length of ). Thus , then there are only components without length , where is
[TABLE]
Suppose the remind components with length of (at least vertices connected by some edges), then . So . According to the equation 7, the . It is contradict that the is strong connected.
3.2 The cycle in digraph corresponding matching in projector graph
Secondly, let us given the properties after mapping Hamiltonian cycle of into the sub graph of projector graph .
Lemma 3
If a Hamiltonian cycle of mapping into a forest of projector graph , the forest consist of number of trees which has only two node and one edge, and has a unique perfect matching.
Proof
Let the digraph has a sub digraph which exists one Hamiltonian cycle and , the incidence matrix of could be permutation as follows.
[TABLE]
Let
[TABLE]
It is obvious that each row of has only one entry and each column of has two entries.
According to theorem 1.1, represents a balanced bipartite graph that each vertex has one edge connected, and each edge connect on vertex , another in , in another words, ,, (,respectively). According the matching definition, is a matching, since , is a perfect matching. and pair of vertices between and only has one edge, so is a forest, and each tree has only two node with one edge.
4 Proof of Theorem 1.2
Proof
Let the digraph has a sub digraph which is a Hamiltonian cycle and , let matrix represents the incidence matrix of , so ; According to lemma 3, the projector graph has a perfect matching, thus also has a perfect matching.
Let be a projector graph of the graph , is a perfect matching in . Let be a sub graph of and . Since , is a strong connected digraph. it deduces that ,. Suppose , ( respectively), Since , it deduces that , which imply that . this is contradiction with and . So , , According the lemma 1, has a Hamiltonian cycle.
5
Number of perfect matching in projector graph
Let us considering the number of perfect matching in . Firstly, let us considering a example as shown in figure 1.
\begin{picture}(10.0,4.0)\par \par \put(1.0,0.0){Figure 1. Original Digraph } \put(1.0,1.0){\vector(0,1){0.8}} \put(1.0,1.0){\circle{0.5}} \put(1.2,1.4){} \par\put(1.0,2.0){\vector(1,0){0.8}} \put(1.0,2.0){\circle{0.5}} \put(1.4,2.1){} \par\put(2.0,1.0){\vector(-1,0){0.8}} \put(2.0,1.0){\circle{0.5}} \put(1.4,0.7){} \par\put(2.0,2.0){\vector(0,-1){0.8}} \put(2.0,2.0){\vector(1,0){0.8}} \put(2.0,2.0){\circle{0.5}} \put(2.4,2.1){} \put(2.2,1.4){} \par\put(3.0,1.0){\vector(-1,0){0.8}} \put(3.0,1.0){\vector(0,1){0.8}} \put(3.0,1.0){\circle{0.5}} \put(2.4,0.7){} \put(3.1,1.4){} \par\put(3.0,2.0){\circle{0.5}} \put(3.0,2.0){\vector(1,0){0.8}} \put(3.4,2.1){} \par\put(4.0,1.0){\vector(-1,0){0.8}} \put(4.0,1.0){\circle{0.5}} \put(3.4,0.7){} \par\put(4.0,2.0){\vector(0,-1){0.8}} \put(4.0,2.0){\vector(1,0){0.8}} \put(4.0,2.0){\circle{0.5}} \put(4.4,2.1){} \put(4.1,1.4){} \par\put(5.0,1.0){\vector(-1,0){0.8}} \put(5.0,1.0){\vector(0,1){0.8}} \put(5.0,1.0){\circle{0.5}} \put(4.4,0.7){} \put(5.1,1.4){} \par\put(5.0,2.0){\circle{0.5}} \put(5.0,2.0){\vector(1,0){0.8}} \put(5.4,2.1){} \par\put(6.0,1.0){\vector(-1,0){0.8}} \put(6.0,1.0){\circle{0.5}} \put(5.4,0.7){} \par\put(6.0,2.0){\vector(0,-1){0.8}} \put(6.0,2.0){\vector(1,0){0.8}} \put(6.0,2.0){\circle{0.5}} \put(6.4,2.1){} \put(6.1,1.4){} \par\par\put(7.0,1.0){\vector(-1,0){0.8}} \put(7.0,1.0){\vector(0,1){0.8}} \put(7.0,1.0){\circle{0.5}} \put(6.4,0.7){} \put(7.2,1.4){} \par\put(7.0,2.0){\circle{0.5}} \put(7.0,2.0){\vector(1,0){0.8}} \put(7.4,2.1){} \par\put(8.0,1.0){\vector(-1,0){0.8}} \put(8.0,1.0){\circle{0.5}} \put(7.4,0.7){} \par\put(8.0,2.0){\circle{0.5}} \put(8.0,2.0){\vector(0,-1){0.8}} \put(8.4,1.4){} \par\par\par\end{picture}
Figure 1. Original Digraph D$$a_{8}
a_{2}$$a_{9}
a_{21}$$a_{10}
a_{4}$$a_{11}
a_{12}$$a_{19}
a_{6}$$a_{13}
a_{17}$$a_{14}
Then the projector graph is shown in figure 2.
\begin{picture}(12.0,4.0)\par \par \put(1.0,0.0){Figure 2. Projector graph } \put(1.0,1.0){\line(0,1){1.8}} \put(1.0,1.0){\circle{0.5}} \put(1.0,3.0){\circle{0.5}} \put(1.1,1.4){} \par\put(1.5,1.0){\line(0,1){1.8}} \put(1.5,1.0){\circle{0.5}} \put(1.5,3.0){\circle{0.5}} \put(1.6,1.4){} \par\put(2.0,1.0){\line(0,1){1.8}} \put(2.0,1.0){\circle{0.5}} \put(2.0,3.0){\circle{0.5}} \put(2.1,1.4){} \par\put(3.0,1.0){\line(0,1){1.8}} \put(3.0,1.0){\line(1,2){1.0}} \put(3.0,1.0){\circle{0.5}} \put(3.0,3.0){\circle{0.5}} \put(2.5,2.0){} \put(3.2,2.6){} \par\put(3.3,0.4){} \par\put(4.0,1.0){\line(0,1){1.8}} \put(4.0,1.0){\line(-1,2){1.0}} \put(4.0,1.0){\circle{0.5}} \put(4.0,3.0){\circle{0.5}} \put(4.1,1.4){} \put(3.6,2.1){} \par\par\par\put(4.6,1.0){\line(0,1){1.8}} \put(4.6,1.0){\circle{0.5}} \put(4.6,3.0){\circle{0.5}} \put(4.7,1.4){} \par\put(5.3,1.0){\line(0,1){1.8}} \put(5.3,1.0){\circle{0.5}} \put(5.3,3.0){\circle{0.5}} \put(5.4,1.4){} \par\put(6.0,1.0){\line(0,1){1.8}} \put(6.0,1.0){\line(1,2){1.0}} \put(6.0,1.0){\circle{0.5}} \put(6.0,3.0){\circle{0.5}} \put(5.8,2.0){} \put(6.2,2.6){} \par\put(6.3,0.4){} \par\put(7.0,1.0){\line(0,1){1.8}} \put(7.0,1.0){\line(-1,2){1.0}} \put(7.0,1.0){\circle{0.5}} \put(7.0,3.0){\circle{0.5}} \put(7.1,1.4){} \put(6.6,2.1){} \par\put(7.7,1.0){\line(0,1){1.8}} \put(7.7,1.0){\circle{0.5}} \put(7.7,3.0){\circle{0.5}} \put(7.7,1.4){} \par\put(8.3,1.0){\line(0,1){1.8}} \put(8.3,1.0){\circle{0.5}} \put(8.3,3.0){\circle{0.5}} \put(8.3,1.4){} \par\put(9.0,1.0){\line(0,1){1.8}} \put(9.0,1.0){\line(1,2){1.0}} \put(9.0,1.0){\circle{0.5}} \put(9.0,3.0){\circle{0.5}} \put(8.6,2.0){} \put(9.2,2.6){} \par\put(9.3,0.4){} \par\put(10.0,1.0){\line(0,1){1.8}} \put(10.0,1.0){\line(-1,2){1.0}} \put(10.0,1.0){\circle{0.5}} \put(10.0,3.0){\circle{0.5}} \put(9.6,2.1){} \put(10.3,1.4){} \put(10.6,2.0){} \par\end{picture}
Figure 2. Projector graph G$$e_{1}
e_{9}$$e_{2}
e_{10}$$e_{21}
e_{11}$$e_{4}
e_{19}$$e_{12}
e_{6}$$e_{13}
e_{17}$$e_{14}$$\ldots
Given a perfect matching , each component(cycle) in has two partition edges belong to . Let us code component which and matching to a binary variable.
[TABLE]
Now there are two cases for the number of perfect matching.
- Label edge.
In that cases, the is different with . If there are number of components(cycles), then there are perfect matching. 2. Unlabel edge.
In that cases, the is isomorphic to . The same principle that is isomorphic to but is not isomorphic to .
Then let us summary the maximal number of perfect matching in these two cases.
Lemma 4
The maximal number of labeled perfect matching in a projector graph is , but the maximal number of unlabeled perfect matching in a projector graph is .
Proof
According to the theorem 1.1, there at most components with a components which is length of . When =2, there are only one perfect matching in ; When , there are components which is , and so on when , there are components which is , etc, so on. According to the lemma 2, each simple cycle has divided the perfect matching into two class. So maximal number perfect matching in the non isomorphism cycle which is . Since in unlabeled cases, every cycle is isomorphism, the maximal number of perfect matching is .
Review the example 1 again, it is easy find that follow proposition.
Proposition 1
Given two perfect matching and in projector graph , if , then the .
5.1 Proof of Theorem 1.3
Now let us proof the theorem 1.3.
Proof
Let be a project balanced bipartition of . According theorem 1.1, the graph is equivalent to find a perfect match in a project .
According to the lemma 4, the maximal number non isomorphism perfect matching in is only .
Thus it is only need exactly enumerate all of non isomorphism perfect matching , then obtain the ,if , then the is also , where is a Hamiltonian cycle.
Since the complexity of rank of matrix is , finding a simple cycle in a component with degree is , and obtaining a perfect matching of a bipartite graph is [3]. Then all exactly algorithms need to calculate the time . Thus the complexity is .
Since the non isomorphism perfect matching comes from the coding of edges in the component of , it is not easy implementation.
Let us give two recursive equation to obtain a perfect matching from . Suppose there are component in where is a component with degree and .
[TABLE]
[TABLE]
where , when , is the initial perfect matching from .
When , According the theorem 1.1, the is a Hamiltonian cycle solution. If all of , then there has no Hamiltonian cycle in .
Since the non isomorphism perfect matching in is poset, the function in is monotonic, so this approach is exactly approach.
Let us give a example to illustrate the approach in detail.
Example 1
Considering the digraph in figure 1, then the projector graph in figure 2.
Let .
Thus the . Let ,then , thus and then turn to ,. At last it obtain the solution.
Considering the equation 11, let it substituted by following equations when and .
[TABLE]
It is obvious that all non-isomorphism Hamiltonian cycle could obtain by the repeat check the equation 12 and the equation .
In conversely, if a Hamiltonian cycle of digraphs is given, it represents a perfect matching in its projector graph . Thus the equation 12 and Theorem 1.3 follows a corollary.
Corollary 3
Given a Hamiltonian digraph, the complexity of determining another non-isomorphism Hamiltonian cycle is polynomial time.
5.2 The HCP in digraph with bound two
Let us extend the Theorem 1.3 to digraphs with and in this section.
Theorem 5.1
The complexity of finding a Hamiltonian cycle existing or not in digraphs with degree and is polynomial time.
Proof
Suppose a digraph having a vertex is shown as figure , which is
\begin{picture}(8.0,4.0)\par \par \par\put(1.0,0.0){Figure 3. A vertex with degree than 2} \put(1.0,1.0){\vector(2,1){1.8}} \par\par\put(1.0,3.0){\vector(2,-1){1.8}} \par\put(3.0,2.0){\circle{0.5}} \par\put(1.2,1.4){} \put(1.2,3.1){} \par\put(3.2,2.0){\vector(2,1){1.8}} \put(3.2,2.0){\vector(2,-1){1.8}} \par\put(4.2,1.0){} \par\put(4.2,2.8){} \par\par\end{picture}
Figure 3. A vertex with degree than 2
a1$$a2
Let us spilt this vertex to two vertices that one of vertex has degree with in degree 2 or out degree 1 , another vertex has degree with in degree 1 or out degree 2 as shown in figure . Then the is derived to a new graph .
\begin{picture}(10.0,4.0) \par\put(1.0,0.0){Figrue 4 A vertex in is mapping to a vertex in digraph} \par\put(1.0,1.0){\vector(2,1){1.8}} \par\put(1.0,2.0){\vector(1,0){1.8}} \par\put(3.0,2.0){\circle{0.3}} \par\put(1.2,1.4){} \put(1.2,2.1){} \par\put(3.2,2.0){\vector(1,0){1.8}} \par\par\put(5.6,1.4){} \par\par\par\put(5.0,2.0){\circle{0.3}} \put(6.2,2.8){} \put(5.2,2.0){\vector(2,1){1.8}} \put(5.2,2.0){\vector(1,0){1.8}} \par\end{picture}
Figrue 4 A vertex in is mapping to a vertex in digraph
a1$$a2
It is obvious that each vertex in the graph has increase vertices and arcs of . Suppose the worst cases is each vertex in has in degree 2 and out degree 2, the total vertices in has vertices.
According to the theorem 1.3, obtain a Hailtonian cycle in is no more then , then the will has a Hamiltonian cycle .
6
Discussion P versus NP
The versus is a famous open problem in computer science and mathematics, which means to determine whether very language accepted by some nondeterministic algorithm in polynomial time is also accepted by some deterministic algorithm in polynomial time [6]. Cook give a proposition for the versus .
Proposition 2
If L is NP-complete and , then .
According above proposition and the result above section, versus problem has a answer.
Theorem 6.1
**
Proof
As the result of [2], the complexity of HCP in digraph with bound two is . According the theorem 5.1, the complexity of HCP in digraph with bound two is also , thus according to proposition 2, .
In fact, the [2] proves that , since is a problem, which also implies that .
7 Conclusion
According to the theorem 5.1, the complexity of determining a Hamiltonian cycle existence or not in digraph with bound degree two is in polynomial time. And according to the theorem 6.1, versus problem has closed, .
Acknowledgements
The author would like to thank Prof. Kaoru Hirota for valuable suggestions, thank Prof. Jørgen Bang-Jensen who called mine attention to the paper [2], and thank Andrea Moro for useful discussions.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Papadimitriou, C. H. Computational complexity , in Lawler, E. L., J. K. Lenstra, A. H. G. Rinnooy Kan, and D. B. Shmoys, eds., The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization. Wiley, Chichester, UK. (1985), 37–85
- 2[2] J.Plesník, The NP-Completeness of the Hamiltonian Cycle Problem in Planar digraphs with degree bound two , Journal Information Processing Letters, Vol.8(1978), 199–201
- 3[3] J.E. Hopcroft and R.M. Karp , An n 5 / 2 superscript 𝑛 5 2 n^{5/2} Algorithm for Maximum Matchings in Bipartite Graphs . SIAM J. Comput. Vol.2, (1973), 225–231
- 4[4] P. Hall, On representative of subsets , J. London Math. Soc. 10, (1935), 26–30
- 5[5] Pearl, M, Matrix Theory and Finite Mathematics ,Mc Graw-Hill, New York,(1973), 332–404.
- 6[6] Stephen Cook. The P Versus NP Problem ,”http://citeseer.ist.psu.edu/302888.html” ,2000.
