Pergamon Mathl. Conaput. Modelling Copyright@1997 Vol. 25, No. 11, pp. 83-88, 1997 Elsevier Science Ltd Printed in Great Britain. All rights reserved PII: SOS957177(97)00086-l 08957177/97 $17.00 + 0.00
The Hamiltonian Property
of the Consecutive-3 Digraph
G.J.
CHANG, F. K. HWANG AND LI-DATONG
Department of Applied Mathematics
National Chiao Tung University
Hsinchu 30050, Taiwan
(Received February 1997; accepted March 1997)
Abstract-A consecutive-d digraph is a digraph G(d, n, q, T) whose n nodes are labeled by the residues modulo n and a link from node i to node j exists if and only if j I pi + k (mod n) for some k with r 5 k 5 r + d - 1. Consecutive-d digraphs are used as models for many computer networks and multiprocessor systems, in which the existence of a Hamiltonian circuit is important. Conditions for a consecutive-d graph to have a Hamiltonian circuit were known except for gcd(n, d) = 1 and
d = 3 or 4. It was conjectured by Du, Hsu, and Hwang that a consecutivo3 digraph ls Hamiltonian. This paper produces several infinite classes of consecutive-3 digraphs which are not (respectively, are) Hamiltonian, thus suggesting that the conjecture needs modification.
Keywords-Hamiltonian circuit, Consecutive-d digraph, Network, Loop. 1.
INTRODUCTION
Define
G(d, n, q, r),also known as a
consecutive-d digraph, tobe a digraph whose n nodes are
labeled by the residues modulo n, and a link i + j from node i to node j exists if and only if
j E {@+Ic (mod n)
: T 5 k 5 r+d-1) where 1 I
q,d 5n - 1 and 0 I r I: n - 1 given.
Many computer networks and multiprocessor systems use consecutive-d digraphs as the topology
of their interconnection
networks. For example, q = 1 yields the multiloop
networks[l], also
known as circulant
digraphs [2],with the skip set {r,
r +1,.
. . , r + d -1). q =
dand
r = 0yields
the
generalized de Bruijn digraphs [3,4],and q = r = n -
dyields the
Imase-Itoh digraphs [5].In some applications, it is important to know whether a Hamiltonian circuit (of length n) is
embedded in a consecutive-d digraph. Hwang [6] gave a necessary and sufficient condition for
G(l, n, q, r) to be Hamiltonian.
This is also equivalent to the existence of a linear congruential
sequence of full period n in the theory of random number generators (see [7,8]). Du and Hsu [9]
observed that G(2, n, q, r) is Hamiltonian if and only if G(l, n, q,
r)or G(l, n, q, r+ 1) is. Du, Hsu,
and Hwang [lo] proved that a consecutive-d digraph is always Hamiltonian for
d 1 5.They also
conjectured that consecutive-3 digraphs are Hamiltonian. Some partial support of this conjecture
was given in [9,11]. In this paper, we produce several infinite classes of consecutive-3 digraphs
which are not Hamiltonian, thus suggesting that the conjecture needs modification.
We also
construct several infinite classes of consecutive-3 digraph which are Hamiltonian.
After this paper was submitted, we proved that all consecutive-4 digraphs are Hamiltonian,
and thus completely settled the conjecture, see
(121.Supported in part by the National Science Council under Grant NSC86-2115MO09002.
83
2. SOME PRELIMINARY
RESULTS
We first state some results obtained in [6] which will be used in this paper.THEOREM 1. (See [6-81.) G( 1, n, q, r) is Hamiltonian if and only if it satisfies the following three conditions.
(i) gcd(n,q) = 1.
(ii) Any prime p dividing n divides q - 1. (iii) If 4 divides n, then 4 divides q - 1.
A node i in G(l,n, q,r) is called a loop if i + i is a link, or equivalently, i E qi + r (mod n). THEOREM 2. (See [61.) G(l,n,q, r contains a loop if and only if gcd(n, q - 1) = gcd(n, q - 1, r). ) Furthermore, if G(l, n, q, r) contains a loop, then the number of loops it contains is gcd(n, q - 1). The loops have the same residue modulo n/gcd(n, q - 1).
The following result is in [lo].
THEOREM 3. (See [IO].) Suppose gcd(n, q) 1 2. Then, G(d, n, q,r) is Hamiltonian if and only if d > gcd(n,q).
According to Theorem 3, we may assume that gcd(n,q) = 1. In this case, for any i E
{O,l, * * * 7 n - l}, there is a unique j such that j + i is a type-r (respectively, type-(r + 2)) link; we use i’ (respectively, i”) to denote this j.
Call i + j an odd link if i is odd and an even link if i is even. Let Go( 1, n, q, r) and GE( 1, n, q, r) denote the set of odd links and even links, respectively, of G(l,n,q,r).
LEMMA
4. Suppose gcd(n, q) = 1. If H is a Hamiltonian circuit of G(l, n, q, r) U G(l, n, q, r + 2)using both type-r links and type-(r + 2) finks, then n is even and H is either Go(1, n, q, r)U Gdl,n,q,r+2) orGE(l,n,q,r)UGo(l,n,q,r+2).
PROOF.
Suppose H contains a type-r link i’ + i. Then, the type-(r + 2) link i’ + i + 2 is notin H, which forces the type-r link (i + 2)’ + i + 2 to be in H. Hence, i’ + i in H implies (i + 2)’ --f i + 2 in H. If n w&s odd, then H contained ah the n type-r links j’ -+ j, which contradicts the assumption. Thus, n is even. Also, note that if i and j have the same parity, then so does i’ and j’. Hence, H contains either ail links of G(l, n,q,r) of the same parity or
none. Lemma 4 follows immediately. I
LEMMA 5.
Suppose gcd(n, q - 1) = gcd(n,q - 1,r + 1) = n/k and q2 E 1 (mod n).(i) Consideranodeu=i+z(qr+r+2) (modn)forsomea:E{O,l,...,n-11). Ifzl-+vin G(l,n,q,r) and u + w in G(l,n,q,r + 2), then w E i + (z + l)(qr + r + 2) (mod n). (ii) Consider a node u E i + z(qr + 2q + r) (mod n) for some x E (0, 1,. . . , n - 1). If u --) o
in G( 1, n, q, r + 2) and v + w in G(l,n,q,r), then w - i + (x + l)(qr + 2q + r) (mod n).
PROOF.
(i) w E q(qu + r) + r + 2 E u + qr + r + 2 E i + (z + l)(qr + r + 2) (mod n).
(ii) w E q(qu + r + 2) + r E u + qr + 2q + r E i + (z + l)(qr + 2q + r) (mod n). I
LEMMA
6. Suppose gcd(n,q - 1) = gcd(n,q - 1,r + 1) = n/k and q + 1 = 0 (mod k). Then,i + j in G(l,n,q,r + 1) implies j --+ i in G(l,n,q,r + 1).
PROOF.
Note that (q + l)(r + 1) E (q + l)(q - 1) E 0 (mod n). Thus, in G(l, n,q, r + l), i + jimplies j z qi + r + 1 ---) q(qi + r + 1) + r + 1 E i + (q + l)(r + 1) E i (mod n). I
LEMMA 7.
Let H be a Hamiltonian circuit in G(3, n, q, r). If H contains two type-r (respectively,two type-(r + 2)) links i’ + i and (i + 1)’ -+ i + 1 (respectively, finks i” --) i and (i + 1)” -+ i + 1) for some i E {O,l,. . . , n - l}, then H = G(l,n,q,r) (respectively, G(l, n,q,r + 2)).
PROOF.
Consider the node (i - 1)’ such that q(i - 1)’ + r = i - 1 (mod n). Then, (i - 1)’ alsoConsecutive-3 Digraph 85 is in G(l, n, q, r), must be in H. Iterate this argument, we have H = G(l, n, q, T). The case for
H = G(l, n, q, T + 2) is analogous. I
3. THE MAIN RESULTS
THEOREM 8. Let I be an independent set of edges of the (undirected) cycle 0, 1,
.
. . , n - 1,O. IfI U G(l, n, q, r + 1) is connected (not necessarily strongly), then G(3, n, q, r) is Hamiltonian. PROOF. We use a link-interchange method first introduced in [lo]. Suppose that G(l, n, q, T + 1) consists of m disjoint cycles Ci
,
CZ, . . . , C,,,. If m = 1, then there is nothing to prove. So assume m > 1. Let eij = (lc, Ic + 1) E I be the edge connecting k E Ci and k + 1 E Cj. Let z + k be in Ci and y + k + 1 in Cj. Replace the two links x + k and y + k + 1 by the two links x + k + 1 and y + k. Then, Ci and Cj are connected into one cycle Cij. Note that x + k + 1 is a type-(r + 2) link and y + k is a type-r link. Now do the same for the set of m - 1 cycles with Cij replacing Ci and Cj. Since I U Cl U . . - U C,,, is connected, eij as described above alwaysexists. Furthermore, since I is an independent set, the eij = (k, k + 1) chosen each time induces the interchange of two type-(r + 1) links with a type-(r + 2) and a type-r link. I
For even n, let I0 denote the independent set (2i - 1 -+ 2i : i = 1,2,. . . , n/2}.
THEOREM 9. Suppose gcd(n,q) = 1 and n is even. Then, g(3,n,q,r) is Hamiltonian if either
gcd(n, q - 1) = 2 and T is odd, or gcd(n, q + 1) = 2 and T is even.
PROOF. By Theorem 8, it suffices to show that Go E 1’ U G(l, n, q, T + 1) is connected. Since 2i-1 + 2i, 2i-1 + (2i-l)q+r+l, 2i + 2iq+r+l are ail in Go, (2i-l)q+r+l and 2iq+r+l are connected in Go. If we replace all links 2i - 1 + (2i - l)q + r + 1 and 2i + 2iq + T + 1 for i = 1,2,... n/2 by links (2i - 1)q + r + 1 ---) 2iq + T + 1 for i = 1,2,. . . , n/2, and call the new
graph G’, then Go must be connected if G’ is.
Let group i consist of the two nodes 2i - 1 and 2i. Then each group induces a connected graph, so we only need to concern the inter-group connectivity. Note that gcd(n,q) = 1 and n even implies q is odd. Suppose r is odd. Then, (2i - 1)q + r + 1 is odd. If (2i - 1)q + r + 1 is in group j, then 2iq + T + 1 must be in group j + (q - 1)/2 (mod n/2). This difference of (q - 1)/2 is independent of i. So group j and group j + (q - 1)/2 are connected for j = 1,2, . . . , n/2. Since
gcd(n,q - 1) = 2 implies gcd(n/2, (q - 1)/2) = 1, the n/2 groups are connected through these
distance-(q - 1)/2 links. The proof for the even r case is analogous. I 3 ----_-- 0 3---o
2 II _--Go-- II 1 2 = 1 G
Figure 1. I0 U G( 1,4,3,1) is connected.
Note that Theorem 9 does not imply that if the parity of T is wrong, then G(3, n, q, T) is not Hamiltonian. It does not even necessarily imply that I0 is not the right set to choose. For example, for G(3,4,3,0), G* is not connected, but Go is (see Figure 1). However, there are cases that Ge is not connected. Consider G(3,12,11,0). G(1,12,11,1) is shown in Fig- ure 2a (each edge represents a 2-way link), and Ii U G(l, 12,11,1) in Figures 2b-2d, where I0 = {(1,2), (3,4), (5,6), (7,8), (9, lo), (11,12)), 1’ = ((0, l), (2,3), (4,5), (6,7), (8,9), (10, ll)}, I2 = {(1,2), (3,4), (5,6), (8,9), (10,ll)). Note that neither I0 nor I1 works, but I2 does.
Next, we give a sufficient condition for G(3, n, q, r) to be nonHamiltonian when G(l, n, q, T + 1) contains C(n) loops.
THEOREM 10. Suppose that gcd(n, q) = 1 and gcd(n,q - 1) = gcd(n,q - 1, r + 1) = n/k. If
q + 1 = 0 (mod k) for k L 3 and q+ 1 E 0 (mod 4) for k = 2, then G(3, n, q, r) is not Hamiltonian for n > 2k.
o.-_----
1 0~
1 O---l 0 -1 I I ll- 2 111 I 2 ll- 2 ll- 12 I 10 3 lo- 3 10’ --_A 3 101 -3 I I I 9- 4 9’ ----_A 4 9_ 4 9 I 4 I I I 8 5 8 5 81-15 8’_ 5 7--- 6 71 ~ 16 7 --- ~ 6 7 16 (a) (b) (c) (d)Figure 2. G(1,12,11,1) and various independent sets.
PROOF. First note that gcd(n, q - 1, r + 1) = n/k and q + 1 E 0 (mod k) imply q2 s 1 (mod n) and (q + l)(r + 1) ss 0 (mod n).
By Lemma 6, if i + j is in G(l, n, q, r + l), then so is j +i. LetibealoopinG(l,n,q,r+l).
Then, i t i-l inG(l,n,q,r) and i --f i+l in G(l,n,q,r+2). Furthermore, i’ + i in G(l,n,q,r) implies i’ t i+l in G(l,n,q,r+l) and i+l + i’ is also in G(l, n, q, r + 1). This in turns implies i+l+i’+lisinG(l,n,q,r+2). Infact,
i’ + 1 z q(i + 1) + r + 2 = q(qi + r + 2) + r + 2 E i + (q + l)(r + 2) = i + q + l(modn). Since q + 1 = 0 (mod k), i’ + 1 has the same residue as i (mod k); hence, i’ + 1 is also a loop in
G(l, n, q, r + 1) by Theorem 2. It follows that i’ + 1 + i’ is in G(l, n, q, r) and i’ + 1 + i’ + 2 is in G( 1, n, q, r + 2). Similarly, we have i - 1 --f i” - l=i-q-l,whichisaloop,inG(I,n,q,r+l)
and i” - 1 + i” in G(l,n,q,r + 2). We show these relations in Figure 3, where ---+ denotes a type-r link, - a type-(r + 1) and _ a type-(r + 2). We call the two loops i - q - 1 and i + q + 1 neighbors of loop i. By Lemma 7, there are only two paths through a loop i, either a type-r link followed by a type-(r + 2) link, or a type-(r + 2) link followed by a type-r link. Each path blocks a path of one if its two neighbor loops which has the same end points. For example, the path i + q + i t i + 1 blocks the path i + 1 + i + q + 1 + i + q because the union of both paths creates a Ccycle. Let L be the graph whose vertices are the loops and whose edges are pairs of end points of paths. Furthermore, an edge is incident to a vertex only if that loop has a path with that pair of end points. Then, L is a cycle. Note that each edge can only be assigned to one of its incident vertices.
.u \ 2 =i-q - i-1
b
/
/
Yi
/
/
/
b
i’=i+q -. i+l \ \ \k/
i’ + 1Figure 3. Relations between a loop and its neighbor loops.
Let H be a Hamiltonian circuit of G(3, n, q, r). Suppose H contains a type-(r + 1) link, say, i + q + i + 1. Then, this link blocks the path with (i + q, i + 1) as end points. So there are only
n/k - 1 paths left to cover for the n/k loops; one of the loops has no path passing it. Therefore, H contains no type-(r + 1) link.
Consecutive-3 Digraph 87 Note that q + 1 ZE 0 (mod k) implies k does not divide q - 1 for k 2 3, and q 4 1 E 0 (mod 4) implies 4 divides n, but not q - 1. By Theorem 1, neither G(l,~,q,~) nor G(l,n,q,r + ‘2) is Hamiltonian. By Lemma 4, we only need to look into G&, n,q,r) U G&n,q,r + 2) and
Go(1, n,q,r) U G&,n,q, r + 2) for a Hamiltonian circuit. We show that a (2k)-cycle exists in either case. Hence, G(3, n, q, T) is not Hamiltonian for n > 2k.
For G&m,q,r)UGo(l,m,q,rf2), we have0 -+ T + qr + T + 2. By Lemma 5 (i), after 2k moves, we reach the node
k(qr + Y -i- 2) = kfq - l)r + 2k(r + 1) z O(mod n).
For Go(l,m,q,r)UGE(l,m,q,r+2), we have0 -+ r-1-2 + qr+2q+r. By Lemma 5 (ii), after 2k moves, we reach the node
k(qr + 2q + r) = k(q + l)(r + 1) + k(q - 1) ra O(modn). I Note that for each k 2 2, the set NHk(n, q, r) of (n, q, r) satisfying the conditions of Theorem 10 is not empty. For example, {(k(tk - 2),tk - 1, tk - 3) : t 2 1) Cr NHk(n,q, r) for k 2 3 and ((8t - 4,4t - 1,4t - 3) : t > 1) C NH2(n,q,r).
We now apply Theorem 10 to obtain more specific results for various k.
THEOREM 11. Suppose that gcd(n, q) = 1 and gcdfn, q - 1) = gcd(n, q - 1, T f 1) = n/2 (hence, n is even). Then G(3, n, q, T) is not Hamiltonian if and only if n = 8t + 4 for some t > 1. PROOF. Since gcd(n,q - 1) = gcd(n, q - 1,r + 1) = n/2, necessarily n = 2k,q = k + 1,r = k - 1 or 2k - 1. gcd(n,q) = 1impliesk=2mandson=4m,q=2m+1,r=2m-1or4m-1.
For odd m = 2t f 1 with t 2 1, q + 1 E 0 (mod 4) and n = 8t f 4 > 4. By Theorem 10, G(3, n, q, r) is not Hamiltonian. For odd m = 2t + 1 with t = 0, gcd(n, q - 1) = 2m = 2 and T is odd. By Theorem 9, G(3, n, q, T) is Hamiltonian.
For even m = 2t, n = 8t. It is easily verified that gcd(n,r) = gca!(n,r + 2) = 1. Furthermore,
q - 1 = n/2 implies that every p > 2 dividing n divides q - 1 and n = 8t implies 4 divides both
n and q - 1. By Theorem 1, both G( 1, n, q, T) and G(l, n, q, r + 2) are Hamiltonian. a THEOREM 12. Supple that gcd(n, q) = 1 and gcd(n, q - 1) = gcd(n, q - 1, r + 1) = n/3 (hence, n ZE 0 (mod 3)). Then, G(3, n, q, r) is not Hamiltonian if and only if n = 9t + 3 or St -t 6 for some t z 1.
PROOF. There are six classes of (n, q, T) satisfying’ gcd(n, q - 1) = gcd(n, q - 1, T + 1) = n/3: n = 3m, q = m + 1 or 2m + 1, r = m - 1, 2m - 1 or 3m - 1. Since g~(n,q~ = 1, q = m + 1 implies m f 2 (mod 3) and q = 2m + 1 implies m $1 (mod 3).
For the case when q = m + 1 with m = 3t + 1 or q = 2m + 1 with m = 3t + 2, where t 2 1,
q + 1 3 0 (mod 3) and n > 6. By Theorem 10, G(3, n, q, T) is not Hamiltonian. It is easily verified
that G(3,3,2, T) and G(3,6,5, T) with odd r are Hamiltonian.
Furthermore, if m = 3t, then every prime p or 4 dividing n divides q- 1. It is also easily verified that gcd(n, T) = gcd( n, r + 2) = 1. Hence, both G( 1, n, q, r) and G( 1, n, q, f + 2) are H~iltoni~
by Theorem 1. I
THEOREM 13. Suppose that gcd(n, q) = 1 and gcd(n,q - 1) = gc&(n, q - 1, T + 1) = n/4 (hence, n z 0 (mod 4)). Then, G(3, n,q,r) is not Hamiltonian if and only if n = 16t + 8 for some t 2 1. PROOF. To satisfy the conditions of the theorem, necessarily n = 8m, q = 2m + 1 or 6m + 1, andr=2m-1,4m-1,6m-1or8m-1.
For odd m = 2t + 1 with t 2 1, q + 1 E 0 (mod 4) and n = 16t + 8 > 8. By Theorem 10, G(3, n, q, T) is not Hamiltonian. For odd m = 2t -I- 1 with t = 0, gcd(n, q - 1) = 2m = 2 and T is odd. By Theorem 9, G(3, n, q, r) is Hamiltonian.
For even m = 2t, every prime p and 4 dividing n divides q - 1, and gcd(n, T) = 1. By Theorem 1,
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
REFERENCES
C.K. Wong and D. Coppersmith, A combinatorial problem related to multimodule memory organizations,
J. Asso. Comput. Mach. 21, 392-402 (1974).
E.A. van Doorn, Connectivity of circulant digraphs, J. Graph Theory 10, Q-14 (1986).
M. Imsse and M. Itoh, Design to minimize a diameter on building block network, IEEE l’kzns. on Computers c-30, 439-443 (1981).
SM. Fleddy, D.K. Pradhan and J.G. Kuhl, Directed graphs with minimal diameter and maximal connectivity, School of Engineering, Oakland University Tech. Rep. (1980).
M. Imase and M. Itoh, A design for directed graph with minimum diameter, IEEE lens. on Computers C-32, 782-784 (1983).
F.K. Hwang, The Hamiltonian property of linear functions, Operations Research Letters 6, 125-127 (1987). T.E. Hull and A.R. Dobell, Random number generators, SIAM Review 4, 230-254 (1962).
D.E. Knuth, The Art of Computer Programming, Volume 2, p. 15, North-Holland, Amsterdam, (1966). D.-Z. Du and D.F. Hsu, On Hamiltonian consecutive-d digraphs, Banach Center Publications 25, 47-55 (1989).
D.-Z. Du, D.F. Hsu and F.K. Hwang, Hamiltonian property of d-consecutive digraphs, Mathl. Comput.
Modelling 17 (ll), 61-63 (1993).
D.-Z. Du, D.F. Hsu, F.K. Hwang and X.M. Zhang, The Hamiltonian property of generalized de Bruijn digraphs, J. Comb. Theory, Series B 52, l-8 (1991).
G.J. Chang, F.K. Hwang and L.-T. Tung, The consecutiv*4 digraphs are Hamiltonian, (submitted) (1997). D.-Z. Du, F. Cao and D.F. Hsu, De Bruijn digraphs, Kauts digraphs, and their generalizations, In Combi-