LONG CYCLES IN CERTAIN GRAPHS OF LARGE DEGREE

Let G be a connected graph of order n and X = {x ∈ V : d(x)≥n/2}. Suppose |X| ≥ 3 and G satisfies the modified Fan’s condition. We show that the vertices of the block B of G containing X form a cycle. This generalizes a result of Fan. We also give an efficient algorithm to obtain such a cycle. The complexity of this algorithm is O(n2). In case G is 2-connected, the condition |X| ≥ 3 can be removed and G is hamiltonian.


Introduction.
We consider only finite undirected graphs without loops or multiple edges.Our terminology is standard and can be found in [4,8].Let G = (V , E) be a graph of order n (= |V |).For each vertex x ∈ V , let N(x) = {v ∈ V : v is adjacent to x}.Then d(x) = |N(x)| is the degree (valency) of x in G. Denote by dist(x, y) the distance between x and y in G (x,y ∈ V ).
A graph G is said to satisfy Fan's condition, if min{max{d(x), d(y)} : dist(x, y) = 2 (x, y ∈ V )} ≥ n/2.In [7], it was shown that a 2-connected graph which satisfies Fan's condition is hamiltonian.Fan's theorem is a direct generalization of Dirac's theorem [4,page 54,Theorem 4.3] and it opened an entirely new approach to study hamiltonian graphs.In [3], Fan's theorem was strengthened, where the same conditions were shown to imply the graph is pancyclic, with a few minor exceptions (also see [1]).Some generalizations of Fan's theorem can be found in [2,5,11,12].A similar result is obtained for bipartite graphs [13].
The purpose of this paper is to generalize Fan's theorem and give an algorithm to find a hamiltonian cycle.Let 3).If, in addition, G satisfies the modified Fan's condition, then the vertices of B form a cycle (Theorem 2.10).From this proof, we obtain an algorithm to find such a cycle.The complexity of the algorithm is O(n 2 ).If G is 2-connected, the condition |X| ≥ 3 can be removed and G is hamiltonian (Corollary 2.12).

Existence of long cycles.
Let G = (V , E) be a connected graph of order n and Proof.Suppose the lemma is not true.Then |N(u) ∩ N(v)| ≤ 1 and so This is impossible and so the lemma is true.
The following lemma is probably known.For completeness, we give a proof.
Proof.If u 1 is adjacent to u k , then the lemma is true.Hence we can assume that If there exists a vertex x ∈ P such that x is adjacent to both u 1 and u k , then the lemma is true.Therefore, we can assume that N(u 1 )∩N(u k ) ⊂ P .By Lemma 2.1, |N(u 1 )∩N(u k )| ≥ 2 and so k ≥ 4. Hence there exists some A block of a graph is a subgraph that has no cut vertices and is maximal with respect to this property (see [4, page 44]).
Proof.Let u, v, w ∈ X.If these three vertices are adjacent to each other, then we have a triangle uvw.If u is not adjacent to v, then by Lemma 2.1, we have a 4-cycle containing u and v. Hence we can assume that there is a cycle C in G containing at least two vertices u, v ∈ X. Suppose there exists a vertex w ∈ X and w ∉ C. We show that there exists a cycle C containing the vertices X ∩ C and {w}.First we claim that there is a path P of length at most 4 passing through w and connecting two vertices of C that is internally disjoint from C.
Case 1. Assume w is adjacent to u.If w is also adjacent to v, then our claim is clearly true.Hence we can assume that w is not adjacent to v. Then by Lemma 2.1, there is a 4-cycle containing v and w.Therefore, there exists a vertex x such that x is adjacent to v and w.If x ∈ C, then P = xwu; otherwise P = vxwu.
Case 2. Assume that w is not adjacent to u or v. Then by Lemma 2.1, Hence there exist two vertices x and y such that x is adjacent to w and u, and y is adjacent to w and v.If both x and y ∉ C, then P = uxwyv; otherwise we have a shorter path.This proves our claim.
Let {w i ,w j } = P ∩ C. If the section of cycle C from w i to w j contains all vertices of X ∩ C, then C = w i •••w j ∪ P is the required cycle.Hence we can assume that the section of C from w i to w j contains a vertex u ∈ X ∩ C and the section of C from w j to w i contains a vertex v ∈ X ∩ C. Furthermore, we can assume that the section of C from u to w j on C contains no interior vertex which is in X and the section of C from v to w i contains no interior vertex which is in X.Since u, v ∈ X, it follows from Lemma 2.2 that the path Since X is finite, we can always obtain a cycle containing all vertices of X.This completes the proof.
and v 4 ; v 2 is adjacent to v 3 ; v 4 is adjacent to v 5 and v 6 ; v 5 is adjacent to v 6 .Then |X| = 2 and there is no cycle containing X in G.
Remark 2.5.Suppose G is 2-connected.Then every two vertices of G is contained in a cycle.Hence we can always find a cycle containing all vertices of X by the proof of Lemma 2.3.Therefore, the condition |X| ≥ 3 in Lemma 2.3 can be removed, if G is assumed to be 2-connected.
A graph G is said to satisfy the modified Fan's condition, if for any vertex w ∈ V with d(w) ≥ 3, we have x, y ∈ N(w) implies either x is adjacent to y or max{d(x), d(y)} ≥ n/2.Remark 2.6.Let G be the graph with Then |X| ≥ 3, but G is not hamiltonian and G does not satisfy the modified Fan's condition.
Remark 2.7.If G satisfies Fan's condition, then G satisfies the modified Fan's condition, but not vise versa.
Example 2.8.Let n = 4k (k ≥ 2) and G the graph given in Figure 2.1.Then G satisfies the modified Fan's condition, but not the Fan's condition.It is easy to see that the diameter of G is equal to k+1.However, the diameter of any graph satisfying Fan's condition is less than or equal to 6.

Proof. Write
Let w i and w j (i < j) be two vertices of C which are adjacent to z.If z is adjacent to w i+1 , then is the required cycle.Therefore, we can assume that z is not adjacent to w i+1 ,w i−1 , w j+1 , or w j−1 .Since d(w i ) ≥ 3 and z is not adjacent to w i+1 , we have d(w i+1 ) ≥ n/2.Similarly, d(w j+1 ) ≥ n/2.
Then by Lemma 2.2, there exists a cycle C containing P .This proves Lemma 2.9.
Then by constructing a tree rooted at z, we can find a path Hence we can assume that w i and w j are nonconsecutive vertices of Case 2. Suppose a ≥ 3 and choose z ∈ A such that d(z) = a ≥ 3.By Lemma 2.9, we can assume |N(z)∩C| ≤ 1.We show that N(z)∩C ≠ ∅.Suppose this is not true.Then d(u) < n/2 for all u ∈ N(z) and so N(z)∪{z} forms a complete subgraph of G. Hence Since B is finite, we can always obtain a cycle containing all vertices of B. This completes the proof of the theorem.
Remark 2.11.If |X| ≤ 2, then Theorem 2.10 is not true.See the example given in Remark 2.4.By using Remark 2.5 and the proof of Theorem 2.10, we have the following result which generalizes Fan's theorem.Corollary 2.12.Suppose G is 2-connected and satisfies the modified Fan's condition, then G is hamiltonian.
Step 3. If there exists a vertex x ∈ N(u 1 ) such that g(x) ≠ 0 and h(x) = 0, then x ∈ N(u 1 ) ∩ N(u k ) and x ∈ P .Let C ← u 1 u 2 •••u k x and stop.
Step 4. Find t (t ≠ 2 or k) such that f (u t ) ≠ 0 and g(u t−1 ) The correctness of the algorithm follows from Lemma 2.2 and its complexity is clearly O(n).Algorithm 3.2.(Assume |X| ≥ 3. Then the vertices of X is contained in a cycle C of G.) Step 1. Find a cycle C containing at least two vertices in X.
Step 2. Let X = X − C. If X = ∅, stop.Otherwise let w ∈ X and u, v ∈ X.
Step 3. Find a path P of length at most 4 passing through w and connecting two vertices {w i ,w j } of C that is internally disjoint from C. Step Step 6. Apply Algorithm 3.1 to the path P and obtain a cycle C containing all vertices of P .Go to Step 2.
The correctness of the algorithm follows from Lemma 2.3.We show that Algorithm 3.2 can be implemented in O(n 2 ) time.Pick u, v, w ∈ X and set f (x) ≠ 0 for all x ∈ N(u) and g(x) ≠ 0 for all x ∈ N(v).If f (v) ≠ 0, f (w) ≠ 0 and g(w) ≠ 0, then let C ← uvw.Otherwise, we can assume v is not adjacent to u, that is, f (v) = 0. Then by Lemma 2.1, there exist x, y ∈ N(u) such that g(x) ≠ 0 and g(y) ≠ 0. Let C ← uxvy.Hence Step 1 takes O(n) time.
Let f (z) ≠ 0 for all z ∈ N(u), g(z) ≠ 0 for all z ∈ N(v), h(z) ≠ 0 for all z ∈ N(w), and H(z) ≠ 0 for all z ∈ C. Suppose first that u is adjacent to w; that is, h(u) ≠ 0. If h(v) ≠ 0, then let P ← uvw.If h(v) = 0, then by Lemma 2.1, we can find a vertex x ∈ N(w) such that g(x) ≠ 0. If H(x) ≠ 0, then let P ← xwu; otherwise let P ← vxwu.Now assume that u and v are not adjacent to w, that is, h(u) = 0 and h(v) = 0. Then there exists two vertices x and y such that x ∈ N(u) and h(x) ≠ 0, y ∈ N(v) and h(y) ≠ 0. If both H(x) = 0 and H(y) = 0, let P ← uxwyv.Otherwise we have a shorter path P .Hence Step 3 takes O(n) time.
It is easy to see that Steps 4, 5, and 6 can be implemented in O(n) time.Combine this with Step 2, we have an O(n 2 ) algorithm.
Let B be the block of G containing X. Then B can be found using the depth-first search for blocks algorithm by Hopcroft and Tarjan (see [6] or [10]).The complexity of this algorithm is O(max(n, |E|)).For our graphs, |E| = O(n 2 ).Therefore it takes O(n 2 ) time to find the block B of G.

Lemma 2 . 9 .
Suppose |X| ≥ 3 and G satisfies the modified Fan's condition.Let C be a cycle containing X.If z ∉ C and |N(z) ∩ C| ≥ 2, then there exists a cycle C containing z and C.

Theorem 2 . 10 .
Suppose |X| ≥ 3 and G satisfies the modified Fan's condition.Let B be the block of G containing X. Then the vertices of B form a cycle.Proof.By Lemma 2.3, there exists a cycle C containing the vertices of X.Let A = V (B) − V (C) and suppose A ≠ ∅.We show that there is a larger cycle C containing all the vertices of C. Let a = max{d(v) : v ∈ A} and write d(u) ≥ d(z) and by the maximality of d(z), we have d(u) = d(z) for all u ∈ N(z).But G is connected and this is impossible.Hence |N(z) ∩ C| = 1.Let {w i } = N(z) ∩ C. Then the set H = (N(z) − {w i }) ∪ {z} forms a complete subgraph of G. Hence d(u) ≥ d(z) − 1 for all u ∈ H and d(u) = d(z) − 1 if and only if u is adjacent only to vertices of H. Since w i is not a cut vertex of B, there exists some vertex v ∈ H such that v ∈ N(w i ) and d(v) > d(z)−1.By the maximality of d(z), we have d(v) = d(z).Then there exists a y ∈ H ∪{w i } such that y is adjacent to v. Suppose d(y) < n/2.Since d(z) < n/2 and d(v) = d(z) ≥ 3, it follows that y is adjacent to z. Hence y ∈ H, which is impossible.Therefore d(y) ≥ n/2 and so y ∈ C. Write y = w j .Since d(v) = d(z), v is not adjacent to w j−1 or w j+1 .Let Q = w i zvw j .Then by the proof of Case 1, we can find a larger cycle C containing all vertices of C.

Algorithm 3 . 1 .
(If d(u 1 )+d(u k ) ≥ n, we find a cycle C containing all the vertices of P .)

Algorithm 3 . 3 .
(Assume |X| ≥ 3 and G satisfies the modified Fan's condition.We find a cycle containing the vertices of B.)