Hamiltonian cubic bipartite graphs
Misa Nakanishi
E-mail address : [email protected]
Abstract
We provide a new polynomial time algorithm to determine a cubic bipartite graph has a hamilton cycle or not.
keywords : hamilton cycle, cubic bipartite graph, NP-complete problem
MSC : 05C45
1 Notation and property
In this paper, a graph G:=(V,E) is finite, undirected, and simple with the vertex set V and edge set E. We follow [1] for basic notation. For a vertex v∈V(G), the open neighborhood, denoted by NG(v), is {u∈V(G): uv∈E(G)}, and the closed neighborhood, denoted by NG[v], is NG(v)∪{v}, also for a set W⊆V(G), let NG(W):=⋃v∈WNG(v) and NG[W]:=NG(W)∪W. For an edge e∈E(G), let V(e) be the set of two ends of e.
Proposition A** ([2]).**
Every bridgeless cubic graph has a perfect matching.
In a cubic graph, the complement of a perfect matching is always a 2-factor.
2 Hamiltonian cubic bipartite graphs
We introduce functions HC and DC as follows.
HC : Input a cubic bipartite graph G.
(1) Obtain a perfect matching M of G, and let F:=G−M. Note that F is a 2-factor of G.
(2) Let M′⊆M be a maximal subset of M such that for every m∈M′, both ends of m are not part of the same cycle of F. Let M′′:=M∖M′. Let J:=G.
(3) If DC(F,M′,M′′,J)=∅ then go to (7).
(4) Let C:=DC(F,M′,M′′,J). Let M(C):=M∩E(C) and F(C):=E(C)∖M(C). Let F:=F−F(C)+M(C). If F is a hamilton cycle then go to (7).
(5) For M:=E(G)∖E(F), redefine M′ and M′′ as (2). Let J:=G.
(6) Repeat (4) - (5) at most ∣V(G)∣ times.
(7) Return F.
DC : Input F,M′,M′′, and J.
(1) Choose m∈M′∪M′′ arbitrarily and let v1,v2∈V(m). If dJ(v1)=3 and v1 is an end of some marked edge, then for a vertex w∈NJ(v1)∖{v2} such that v1w is not marked, let J:=J−v1w. If dJ(v2)=3 and v2 is an end of some marked edge, then for a vertex w∈NJ(v2)∖{v1} such that v2w is not marked, let J:=J−v2w.
(2) Repeat (1) until in (1) all m∈M′∪M′′ are chosen.
(3) Choose m∈M′∪M′′ arbitrarily and let v1,v2∈V(m). If dJ(v1)=2, then for a vertex w∈NJ(v1)∖{v2}, mark v1w. If dJ(v2)=2, then for a vertex w∈NJ(v2)∖{v1}, mark v2w.
(4) Repeat (1) - (3) until in (3) all m∈M′∪M′′ are chosen.
(5) Choose m∈M′ arbitrarily and let v1,v2∈V(m). If dJ(v1)=3 and v1 is not an end of any marked edge, then let w1,w2∈NJ(v1)∖{v2}, x1∈NF(w1)∖{v1}, and x2∈NF(w2)∖{v1}. If w1∈V(m′) for some m′∈M′, and J−v1w2−w1x1 contains a cycle C such that v1w1∈E(C) and NJ−v1w2−w1x1(V(C))∖V(C)=∅, then mark v1w1 and let J:=J−v1w2. If w2∈V(m′) for some m′∈M′, and J−v1w1−w2x2 contains a cycle C such that v1w2∈E(C) and NJ−v1w1−w2x2(V(C))∖V(C)=∅, then mark v1w2 and let J:=J−v1w1. If dJ(v2)=3 and v2 is not an end of any marked edge, then let w1,w2∈NJ(v2)∖{v1}, x1∈NF(w1)∖{v2}, and x2∈NF(w2)∖{v2}. If w1∈V(m′) for some m′∈M′, and J−v2w2−w1x1 contains a cycle C such that v2w1∈E(C) and NJ−v2w2−w1x1(V(C))∖V(C)=∅, then mark v2w1 and let J:=J−v2w2. If w2∈V(m′) for some m′∈M′, and J−v2w1−w2x2 contains a cycle C such that v2w2∈E(C) and NJ−v2w1−w2x2(V(C))∖V(C)=∅, then mark v2w2 and let J:=J−v2w1.
(6) Repeat (1) - (5) until in (5) all m∈M′ are chosen.
(7) Choose m∈M′ arbitrarily and let v1,v2∈V(m). If dJ(v1)=3 and v1 is not an end of any marked edge, then let w1,w2∈NJ(v1)∖{v2}. If w1∈V(m′) for some m′∈M′, and w2∈V(m′′) for some m′′∈M′′, then mark v1w1 and let J:=J−v1w2. If w2∈V(m′) for some m′∈M′, and w1∈V(m′′) for some m′′∈M′′, then mark v1w2 and let J:=J−v1w1. If dJ(v2)=3 and v2 is not an end of any marked edge, then let w1,w2∈NJ(v2)∖{v1}. If w1∈V(m′) for some m′∈M′, and w2∈V(m′′) for some m′′∈M′′, then mark v2w1 and let J:=J−v2w2. If w2∈V(m′) for some m′∈M′, and w1∈V(m′′) for some m′′∈M′′, then mark v2w2 and let J:=J−v2w1.
(8) Repeat (1) - (7) until in (7) all m∈M′ are chosen.
(9) Choose m∈M′ arbitrarily and let v1,v2∈V(m). Apply either (*1) or (*2) if both conditions of (*1) and (*2) hold. (*1) If dJ(v1)=3 and v1 is not an end of any marked edge, then for two vertices w1,w2∈NJ(v1)∖{v2}, either (a) mark v1w1 and let J:=J−v1w2, or (b) mark v1w2 and let J:=J−v1w1. (*2) If dJ(v2)=3 and v2 is not an end of any marked edge, then for two vertices w1,w2∈NJ(v2)∖{v1}, either (a) mark v2w1 and let J:=J−v2w2, or (b) mark v2w2 and let J:=J−v2w1.
(10) Repeat (1) - (9) until in (9) all m∈M′ are chosen.
(11) Let K′ be the union of all disjoint cycles in J. Let k′ be the number of components in F∪K′.
(12) Choose m∈M′∩K′ arbitrarily and let v1,v2∈V(m). If NK′(v1)∖{v2} or NK′(v2)∖{v1} is an end of some edge in M′, then check m.
(13) Repeat (12) until in (12) all m∈M′∩K′ are chosen.
(14) Choose m∈M′∩K′ arbitrarily and let v1,v2∈V(m). If NK′(v1)∖{v2} or NK′(v2)∖{v1} is an end of some edge in M′′, then highlight m.
(15) Repeat (14) until in (14) all m∈M′∩K′ are chosen.
(16) Choose a cycle K⊆K′ arbitrarily. Let k be the number of components in F∪(K′−K). If E(K) dose not contain any checked edges and k=k′, then let K′:=K′−K.
(17) Repeat (16) until in (16) all cycles K⊆K′ are chosen.
(18) Choose a cycle K⊆K′ arbitrarily. Let k be the number of components in F∪(K′−K). If E(K) contains some highlighted edges and k=k′, then let K′:=K′−K.
(19) Repeat (18) until in (18) all cycles K⊆K′ are chosen.
(20) Choose a cycle K⊆K′ arbitrarily. Let k be the number of components in F∪(K′−K). If k=k′, then let K′:=K′−K.
(21) Repeat (20) until in (20) all cycles K⊆K′ are chosen.
(22) Return K′.
Let G be a cubic bipartite graph. HC(G) is a 2-factor constructed by applying HC to G. Note that HC(G) is not unique and taken arbitrarily.
Proposition 2.1**.**
If G is hamiltonian then HC(G) is a hamilton cycle.
Proof.
Suppose that G has a hamilton cycle H and a 2-factor F of G is not a hamilton cycle. Then all edges of (E(H)∖E(F))∪(E(F)∖E(H)) and their ends form the union of disjoint cycles K′′ and F∪K′′ is connected. Note that E(H)∖E(F)⊆M. Also note that every f∈E(F)∖E(H) is an edge between two ends of two edges of E(H)∖E(F). By the definition of J, K′=∅ in DC (22). Now, it is impossible for DC to return the empty set. Let Fn′ be F led after n′ times of HC (4), let Fn′′ be F led after n′′ times of HC (4), let cn′ be the number of cycles in Fn′, and let cn′′ be the number of cycles in Fn′′ (0≤n′<n′′≤∣V(G)∣−1). Then, by DC (5), (7), (16), (18), and (20), for every n′, there exists n′′ such that n′′−n′≤3 and cn′>cn′′. Therefore, HC returns a hamilton cycle at most ∣V(G)∣ times of the repetition.
∎
Theorem 2.1**.**
G* is hamiltonian if and only if HC(G) is a hamilton cycle.*
Proof.
Suppose that G is hamiltonian. By Proposition 2.1, the sufficiency holds. The necessity is obvious from the statement.
∎
Proposition 2.2**.**
All steps of HC (including DC) are computed in polynomial time.
Proof.
It is straightforward from the definitions of HC and DC.
∎