long paths in hypercubes with a quadratic number of faults

9
Long paths in hypercubes with a quadratic number of faults Tomáš Dvor ˇák * ,1 , Václav Koubek 2 Faculty of Mathematics and Physics, Charles University, Malostranské nám. 25, 118 00 Prague, Czech Republic article info Article history: Received 11 February 2009 Received in revised form 8 June 2009 Accepted 22 June 2009 Keywords: Faulty vertex Hypercube Linear-time algorithm Long path abstract A path between distinct vertices u and v of the n-dimensional hypercube Q n avoiding a given set of f faulty vertices is called long if its length is at least 2 n 2f 2. We present a function /ðnÞ¼ Hðn 2 Þ such that if f 6 /ðnÞ then there is a long fault-free path between every pair of distinct vertices of the largest fault-free block of Q n . Moreover, the bound pro- vided by /ðnÞ is asymptotically optimal. Furthermore, we show that assuming f 6 /ðnÞ, the existence of a long fault-free path between an arbitrary pair of vertices may be verified in polynomial time with respect to n and, if the path exists, its construction performed in lin- ear time with respect to its length. Ó 2009 Elsevier Inc. All rights reserved. 1. Introduction The n-dimensional hypercube Q n is a graph with all binary strings of length n as vertices, an edge joining two vertices that differ in a single position. The applications of hypercubes as prospective interconnection networks for parallel or distributed computing [9] inspired the investigation of their fault-tolerant properties. This paper studies long paths in hypercubes that avoid a given set of faulty vertices, corresponding to the nodes of the network that are unavailable. It is well-known that for any pair u; v of distinct vertices of Q n there is a path between them of length at least 2 n 2 [5,10]. Suppose we are given a set of f faulty vertices of Q n . What can be said about the maximum length of a path between u and v avoiding all faults? We call such a path long if its length is at least 2 n 2f 2. The motivation for this concept lies in the observation that if all faulty vertices are of the same parity as u or v, then no fault-free path between u and v can be longer than the long path between them. The existence of long fault-free paths in faulty hypercubes was studied by Fu [4] who showed that such a path exists be- tween an arbitrary pair of distinct fault-free vertices provided f 6 n 2. Kueng et al. [8] improved that bound to f 6 2n 5 under the assumption that n P 3 and every fault-free vertex has at least two fault-free neighbors. The research of linear bounds on f has been satisfactory completed by a recent result of Fink and Gregor [3]. They proved that if f 6 2n 4 and n P 5, a long fault-free path between u and v exists if and only if both u and v possess at least one fault-free neighbor dif- ferent from u and v. Moreover, the latter bound on f is tight, as for every n P 5 there is a configuration of 2n 3 faulty ver- tices and two distinct fault-free vertices u; v satisfying the above necessary condition, but no fault-free path between them is long. The second result of [3] says that if n 6 15 and the number of faulty vertices f is at most /ðnÞ¼ n 2 10 þ n 2 þ 1, then there exists a fault-free cycle of length at least 2 n 2f . Our aim is to continue on this result. In this paper we show that if f 6 /ðnÞ then there is a long fault-free path between every pair of distinct vertices of the largest fault-free block of Q n . As a corollary, we obtain the above quoted result of [3] on the existence of a long fault-free 0020-0255/$ - see front matter Ó 2009 Elsevier Inc. All rights reserved. doi:10.1016/j.ins.2009.06.029 * Corresponding author. E-mail addresses: [email protected] (T. Dvor ˇák), [email protected] (V. Koubek). 1 Partially supported by the Grant Agency of Charles University under Grant No. 69408. 2 Partially supported by the Information Society Grant No. 1ET100300517. Information Sciences 179 (2009) 3763–3771 Contents lists available at ScienceDirect Information Sciences journal homepage: www.elsevier.com/locate/ins

Upload: tomas-dvorak

Post on 26-Jun-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Information Sciences 179 (2009) 3763–3771

Contents lists available at ScienceDirect

Information Sciences

journal homepage: www.elsevier .com/locate / ins

Long paths in hypercubes with a quadratic number of faults

Tomáš Dvorák *,1, Václav Koubek 2

Faculty of Mathematics and Physics, Charles University, Malostranské nám. 25, 118 00 Prague, Czech Republic

a r t i c l e i n f o

Article history:Received 11 February 2009Received in revised form 8 June 2009Accepted 22 June 2009

Keywords:Faulty vertexHypercubeLinear-time algorithmLong path

0020-0255/$ - see front matter � 2009 Elsevier Incdoi:10.1016/j.ins.2009.06.029

* Corresponding author.E-mail addresses: [email protected] (T.

1 Partially supported by the Grant Agency of Charl2 Partially supported by the Information Society G

a b s t r a c t

A path between distinct vertices u and v of the n-dimensional hypercube Qn avoiding agiven set of f faulty vertices is called long if its length is at least 2n � 2f � 2. We presenta function /ðnÞ ¼ Hðn2Þ such that if f 6 /ðnÞ then there is a long fault-free path betweenevery pair of distinct vertices of the largest fault-free block of Qn . Moreover, the bound pro-vided by /ðnÞ is asymptotically optimal. Furthermore, we show that assuming f 6 /ðnÞ, theexistence of a long fault-free path between an arbitrary pair of vertices may be verified inpolynomial time with respect to n and, if the path exists, its construction performed in lin-ear time with respect to its length.

� 2009 Elsevier Inc. All rights reserved.

1. Introduction

The n-dimensional hypercube Q n is a graph with all binary strings of length n as vertices, an edge joining two vertices thatdiffer in a single position. The applications of hypercubes as prospective interconnection networks for parallel or distributedcomputing [9] inspired the investigation of their fault-tolerant properties. This paper studies long paths in hypercubes thatavoid a given set of faulty vertices, corresponding to the nodes of the network that are unavailable.

It is well-known that for any pair u;v of distinct vertices of Q n there is a path between them of length at least 2n � 2[5,10]. Suppose we are given a set of f faulty vertices of Qn. What can be said about the maximum length of a path betweenu and v avoiding all faults? We call such a path long if its length is at least 2n � 2f � 2. The motivation for this concept lies inthe observation that if all faulty vertices are of the same parity as u or v, then no fault-free path between u and v can belonger than the long path between them.

The existence of long fault-free paths in faulty hypercubes was studied by Fu [4] who showed that such a path exists be-tween an arbitrary pair of distinct fault-free vertices provided f 6 n� 2. Kueng et al. [8] improved that bound to f 6 2n� 5under the assumption that n P 3 and every fault-free vertex has at least two fault-free neighbors. The research of linearbounds on f has been satisfactory completed by a recent result of Fink and Gregor [3]. They proved that if f 6 2n� 4 andn P 5, a long fault-free path between u and v exists if and only if both u and v possess at least one fault-free neighbor dif-ferent from u and v. Moreover, the latter bound on f is tight, as for every n P 5 there is a configuration of 2n� 3 faulty ver-tices and two distinct fault-free vertices u;v satisfying the above necessary condition, but no fault-free path between them islong. The second result of [3] says that if n 6 15 and the number of faulty vertices f is at most /ðnÞ ¼ n2

10þ n2þ 1, then there

exists a fault-free cycle of length at least 2n � 2f . Our aim is to continue on this result.In this paper we show that if f 6 /ðnÞ then there is a long fault-free path between every pair of distinct vertices of the

largest fault-free block of Q n. As a corollary, we obtain the above quoted result of [3] on the existence of a long fault-free

. All rights reserved.

Dvorák), [email protected] (V. Koubek).es University under Grant No. 69408.rant No. 1ET100300517.

3764 T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771

cycle (Section 5). Moreover, the bound provided by /ðnÞ is asymptotically optimal in the sense that for every n P 6, there is aconfiguration of Hðn2Þ faulty vertices such that no long fault-free path between any pair of vertices exists (Section 6). Turn-ing to the computational complexity, we show that if f 6 /ðnÞ then the existence of a long fault-free path between an arbi-trary pair of vertices may be verified in polynomial time with respect to n and, if the path exists, then its constructionperformed in linear time with respect to its length (Section 7). The paper is concluded with possible applications of this prob-lem and directions for further research.

2. Preliminaries

The graph-theoretic terms used in this paper but not defined below can be found e.g. in [6]. Throughout the paper, n al-ways is a positive integer while [n] denotes the set f1;2; . . . ;ng.

Given a graph G with vertices VðGÞ and a set V # VðGÞ;G� V denotes the induced subgraph of G on the set VðGÞ n V . Max-imal connected subgraphs of G are components of G. A cutvertex of G is a vertex v such that G� fvg has more componentsthan G. A connected graph on at least three vertices which contains no cutvertices is called biconnected. Set B # VðGÞ is calleda block of G if either B is vertex set of a maximal biconnected subgraph of G, or B consists of endvertices of an edge which isnot contained in any biconnected subgraph. A block is called largest if it has maximum number of vertices among all blocks ofG. Given a set F of faulty vertices of G, the blocks of G�F are called fault-free blocks of G.

A one-to-one sequence a ¼ x0; x1; . . . ; xn ¼ b of vertices such that xi and xiþ1 are adjacent for all i ¼ 0;1; . . . ;n� 1 is a pathbetween a and b of length n. We denote such a path, its vertices and its length by Pab;VðPabÞ and lðPabÞ, respectively. Let Pab andPbc be paths such that VðPabÞ \ VðPbcÞ ¼ fbg. Then Pab þ Pbc denotes the path between a and c, obtained as a concatenation ofPab with Pbc (where b is taken only once). Observe that the operation + is associative. Path R is called a subpath of a path P ifP ¼ Sþ Rþ T for some paths S; T . If Pad and Pbc are paths such that VðPadÞ \ VðPbcÞ ¼ fb; cg and Pad ¼ Pab þ b; c þ Pcd, thenPadðPbcÞ denotes the path Pab þ Pbc þ Pcd.

In this paper we deal with the n-dimensional hypercube Q n, which is a graph with all binary strings of length n as vertices,an edge joining two vertices that differ in a single position. The parity pðvÞ of a vertex v ¼ v1; v2 . . . vn is defined asjfijv i ¼ 1gjmod2. Note that the distance dðu;vÞ of vertices u and v of Q n is odd if and only if pðuÞ–pðvÞ.

Given a string v ¼ v1; v2 . . . vn and a set D # ½n�, we use vD to denote the string v j1 ;v j2 . . . v jd where j1; j2; . . . ; jd is anincreasing sequence of all elements of D. Given a set D # ½n� of size d and a vertex u 2 VðQn�dÞ, the subgraph of Qn inducedby vertex set fv 2 VðQ nÞjvD ¼ ug where D ¼ ½n� n D is denoted by QDðuÞ and called a subcube of dimension d. Subcubes QDðuÞand Q DðvÞ are called adjacent if u and v are adjacent vertices of Qn�d. Note that

� QDðuÞ is isomorphic to Qd,� If QDðuÞ and Q DðvÞ are adjacent subcubes, then an arbitrary vertex in one of them has a unique neighbor in the other.

Given a set F# VðQ nÞ of faulty vertices, FDðuÞ denotes the set F \ VðQDðuÞÞ. If there is a unique largest fault-free block ofQDðuÞ, we denote it by BDðuÞ.

Recall that a fault-free path Pab in Q n with f faulty vertices is called long if

lðPabÞP 2n � 2f � 2:

Since Q n is a bipartite graph, we have lðPabÞ � dða; bÞmod 2. In particular, if dða; bÞ is odd and Pab is long then

lðPabÞP 2n � 2f � 1: ð2:1Þ

For the purpose of algorithms description we employ two fundamental data structures:

� queue Q; item x is added to the tail of the queue using ENQUEUEðx;QÞ and retrieved from the head using DEQUEUEðQÞ in aconstant time,

� trie T over the alphabet {0,1}; binary string x of length n is inserted into T using INSERTðx; TÞ in OðnÞ time, we assume thateach leaf of T may include additional information related to the string x it represents (e.g. the number of occurrences of x).

3. Lemmas

This section is devoted to auxiliary results that will be used later to verify certain steps of our algorithm. For the basis ofour construction we employ the following special case of a more general result by Fink and Gregor.

Theorem 3.1 [3]. Let F be a set of at most six faulty vertices in Q5. Then for every pair of distinct fault-free vertices u and v, thereis a long fault-free path between them if and only if both u and v possess at least one fault-free neighbor different from u and v.

For larger dimensions we use the strategy of splitting the faulty hypercube into subcubes with only a small number offaults. As observed in [3], this task may be performed easily using a recent result by Wiener [13, Theorem 2.5]. As it wasoriginally stated for set systems, here we provide an equivalent formulation using the above introduced terminology.

T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771 3765

Theorem 3.2 [13]. Let F be a set of faulty vertices of Qn of size f with f P 2n and d ¼ d n2

2f�n�2e. Then there is a set D # ½n� suchthat jDj ¼ d and jFDðuÞj 6 dþ 1 for every u 2 f0;1gn�d.

The rest of this section is devoted to properties of fault-free blocks.

Proposition 3.3. Let F be a set of faulty vertices of Q 5 with jFj 6 6. Then there is a unique largest fault-free block which consistsof all vertices of Q5 with at least two non-faulty neighbors. Moreover, it has size at least 24 and contains at least 10 vertices of eachparity.

Proof. Let V1 denote the set of all vertices of degree at most 1 in Q 5 �F and V2 ¼ VðQ5Þ n ðF [ V1Þ. By classical results onthe isoperimetric problem in Q n (see e.g. [1, Theorem 7.2]), every set V of 3 vertices of Q 5 has at least 10 neighbors inVðQ 5Þ n V . Hence, if jV1jP 3 then jFj þ 3 P 10, contrary to our assumption that jFj 6 6. Therefore, jV1j 6 2 and hencejV2jP jVðQ 5Þj � jFj � jV1jP 24.

Select an arbitrary u 2 V2 and let v ;w be its two fault-free neighbors. Since dðv ;wÞ ¼ 2, the total number of neighbors offv ;wg in Q5 is 8 > jFj þ 1 and therefore there exists a neighbor u0 of fv ;wg with u0 R F [ fug. Thus at least one of v and w,say v, belongs to V2. By Theorem 3.1, there is a long fault-free path Puv . Thus u lies on a fault-free cycle of length at leastjVðQ5Þj � 2jFjP 20 and therefore belongs to the largest fault-free block of Q5. Since u is arbitrary, this block consists of allvertices of V2 and therefore has size at least 24. Moreover, since it contains a cycle of length at least 20, it also includes 10vertices of each parity. h

Lemma 3.4. Let F be a set of faulty vertices of Q n and D # ½n� be such that jDj ¼ 5 and jFDðuÞj 6 6 for every u 2 f0;1gn�5. LetQ DðuÞ and QDðvÞ be adjacent subcubes. Then

(i) every long path in BDðuÞ contains consecutive vertices a; b such that both a and b have neighbors in BDðvÞ,(ii) for every a 2 BDðuÞ and b 2 BDðvÞ there exists c 2 BDðuÞ such that dða; cÞ is odd and c has a neighbor in BDðvÞ different

from b.

Proof. Let P be a long path, then P consists of lðPÞ þ 1 P 25 � 2jFj � 1 vertices. If for every pair a; b of consecutive vertices ofP the neighbor of a in QDðvÞ or the neighbor of b in QDðvÞ does not belong to BDðvÞ, then

jVðQDðvÞÞ n BDðvÞjP bjVðPÞj=2cP bð25 � ð2� 6þ 1ÞÞ=2c ¼ 9:

Hence, jBDðvÞj 6 32� 9 ¼ 23, contrary to Proposition 3.3. This verifies part (i).By Proposition 3.3, BDðuÞ contains a set S of 10 vertices having the parity opposite to a. Neighbors of vertices of S in BDðvÞ

share their parities with a and, by Proposition 3.3, VðQDðvÞÞ n BDðvÞ contains at most jVðQDðvÞÞj=2� 10 ¼ 6 such vertices.Hence, at least four vertices of S possess a neighbor in BDðvÞ, and one of these neighbors must be different from b. Thus (ii)follows. h

We conclude this section with an observation saying that sufficiently large fault-free blocks of subcubes must be con-tained in the largest fault-free block of the original hypercube.

Lemma 3.5. Let F be a set of faulty vertices of Q n;D # ½n� and d ¼ jDj. If jBDðuÞj > 12 jVðQDðuÞÞj for all u 2 VðQn�dÞ, then

SuBDðuÞ

is contained in the largest fault-free block of Q n.

Proof. Observe that for every u;v 2 VðQn�dÞ,

jBDðuÞjP 2d�1 þ 1 ¼ 2d � ð2d�1 þ 1Þ þ 2 P jVðQ DðvÞÞ n BDðvÞj þ 2:

Hence, if QDðuÞ and Q DðvÞ are adjacent, there are at least two vertices of BDðuÞ with a neighbor in BDðvÞ. Thus the fault-freesubgraph of Q n induced by

SuBDðuÞ is biconnected. Since it covers more that half the vertices of Q n, it must be contained in

the largest fault-free block of Q n. h

4. Construction

This section describes an auxiliary construction of long fault-free paths between a given pair of endvertices satisfying spe-cial conditions. More precisely, assume that F is a set of faulty vertices of Qn and D # ½n� of size 5 such that jFDðuÞj 6 6 forevery u 2 VðQ n�5Þ. Note that for each such u, there is a uniquely determined largest fault-free block BDðuÞ by Proposition 3.3.We describe a construction of a long fault-free path between vertices a; b of Qn such that if a 2 VðQ DðuÞÞ (or b 2 VðQDðuÞÞ) forsome u 2 VðQ n�5Þ then a 2 BDðuÞ (or b 2 BDðuÞ, respectively).

First assume that we are given a hamiltonian path u1;u2; . . . ;um of Q n�5 (thus m ¼ 2n�5) such that a 2 BDðu1Þ and b 2 BDðujÞfor some j 2 ½m�. We shall construct fault-free paths Pabi

for all i 2 ½m� by induction over i such that

(i) VðPabiÞ \ VðQDðukÞÞ is empty for k > i while for k 6 i it forms a long fault-free path in BDðukÞ, moreover, it is a path

between vertices of distinct parities if k–j;

3766 T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771

(ii) If i P j then bi ¼ b, if i < j then bi 2 BDðuiÞ; pðbiÞ–pðaÞ and the neighbor of bi in QDðuiþ1Þ is different from b and belongsto BDðuiþ1Þ.

The initial step. Find BDðu1Þ. If j ¼ 1 then, by Theorem 3.1, there exists a long fault-free path Pab between a and b in QDðu1Þ.Set Pab1 ¼ Pab. If j > 1 then, by Lemma 3.4(ii), there exists a vertex b1 2 BDðu1Þ such that pðaÞ–pðb1Þ and the neighbor of b1 inQDðu2Þ is different from b and belongs to BDðu2Þ. By Theorem 3.1, there exists a long fault-free path Pab1 between a and b1 inQDðu1Þ. Since the dimension of QDðu1Þ is 5, it requires only a constant time.

The induction step. Find BDðuiÞ. First assume that i 6 j. Let ai denote the neighbor of bi�1 in Q DðuiÞ. Thenai 2 BDðuiÞ; pðaiÞ ¼ pðaÞ and ai–b by condition (ii). If i < j then, by Lemma 3.4(ii), there exists a vertex bi of BDðuiÞ such thatpðaÞ–pðbiÞ and the neighbor of bi in Q Dðuiþ1Þ is different from b and belongs to BDðuiþ1Þ. If i ¼ j then set bi ¼ b. By Theorem 3.1,there exists a long fault-free path Paibi

between ai and bi in Q DðuiÞ. Set Pabi¼ Pabi�1

þ bi�1; ai þ Paibi. If i > j then, by Lemma

3.4(i), there exists a pair c; d of consecutive vertices of Pabi�1such that c; d 2 BDðui�1Þ and neighbors c0 and d0 of c and d in

QDðuiÞ belong to BDðuiÞ. By Theorem 3.1, there exists a long fault-free path Pc0d0 between c0 and d0 in Q DðuiÞ. SetPcd ¼ c; c0 þ Pc0d0 þ d0; d and Pabi

¼ Pabi�1ðPcdÞ (note that this implies that bi ¼ b for all i P j). Since the dimension of Q DðuiÞ is

5, it requires only a constant time.Since Pabm is a fault-free path between a and b by condition (ii), it only remains to prove that lðPabm ÞP 2n � 2f � 2. Recall

that by (i), jVðPabm Þj ¼Pm

i¼1jVðPiÞj where each Pi is a long fault-free path in Q DðuiÞ. Moreover, if i–j, then endvertices of Pi areof different parities and therefore jVðPiÞj ¼ lðPiÞ þ 1 P 2n � 2jFDðuiÞj by (2.1). It follows that

jVðPabm ÞjPXm

i¼1;i–j

ð25 � 2jFDðuiÞjÞ þ ð25 � 2jFDðujÞj � 1Þ ¼ 2n � 2f � 1:

Since lðPabm Þ ¼ jVðPabm Þj � 1, we can conclude that Pabm is indeed a long fault-free path between a and b.To complete the construction, we need an efficient algorithm providing the hamiltonian path u1;u2; . . . ;um which is re-

quired above. It is well-known that a hamiltonian cycle of Qn may be constructed for every n P 2 in linear time with respectto its length [7, Algorithm L]. Tracing that cycle from a given vertex u, we obtain a hamiltonian path starting at u. Thus we cansummarize:

Theorem 4.1. Let F be a set of faulty vertices of Qn and D # ½n� be a set of size 5 such that jFDðuÞj 6 6 for every u 2 VðQn�5Þ. Let aand b are distinct vertices of Q n such that if a 2 VðQDðuÞÞ (or b 2 VðQDðuÞÞ) for u 2 VðQn�5Þ then a 2 BDðuÞ (or b 2 BDðuÞ,respectively). There is an algorithm which constructs a long fault-free path Pab such that VðPabÞ#

Su2VðQn�5ÞBDðuÞ in time OðlðPabÞÞ.

5. Results

Theorem 5.1. Let n P 15 and Qn contain at most n2

10þ n2þ 1 faulty vertices. Then there is a long fault-free path between every pair

of distinct vertices of the largest fault-free block of Qn.

Proof. Let F be the set of faulty vertices and B be the largest fault-free block of Qn. By Theorem 3.2 there is a set D # ½n� ofsize 5 such that jFDðuÞj 6 6 for every u 2 VðQn�5Þ. Moreover, for each such u there is a unique largest fault-free block BDðuÞwhich contains more than half the vertices of Q DðuÞ by Proposition 3.3. Put

SB ¼

SuBDðuÞ and observe that by Lemma 3.5,S

B is included in B.Let a; b be an arbitrary pair of distinct vertices of B. Select another vertices x; y 2

SB such that a; b; x; y are pairwise

distinct and observe that as all four vertices lie in B and the subgraph induced by B is biconnected, there must be two vertex-disjoint paths Pa; Pb in B connecting a; b with x; y. Let Paa0 and Pbb0 be the subpaths of Pa and Pb, respectively, such that the onlyvertices of

SB on them are a0 and b0. It remains to apply Theorem 4.1 to obtain a path Pa0b0 in

SuBðuÞ of length at least

2n � 2jFj � 2 and observe that Pab ¼ Paa0 þ Pa0b0 þ Pb0b is the desired long fault-free path. h

A fault-free cycle in Q n with f faulty vertices is called long if its length is at least 2n � 2f . Similarly as in the case of longpaths, this concept is motivated by the observation that if all faulty vertices are of the same parity, no fault-free cycle may belonger than a long one. As a corollary of Theorem 5.1 we obtain a recent result of Fink and Gregor on the existence of longfault-free cycles in hypercubes with a quadratic number of faults.

Corollary 5.2 [3]. Let n P 15. Then Qn with at most n2

10þ n2þ 1 faulty vertices contains a long fault-free cycle.

Proof. Select an arbitrary pair of adjacent vertices in the largest fault-free block of Qn and apply Theorem 5.1. h

Keeping our assumptions on n and on the number of faults, in the rest of this section we characterize pairs od distinctvertices of Q n such that there exists a long fault-free path between them.

Lemma 5.3. Let F be a set of at most n2

10þ n2þ 1 faulty vertices in Q n;n P 15, and B be the largest fault-free block of Qn. Then

there is a long fault-free path between a and b in Qn if and only if there are fault-free vertex-disjoint paths Paa0 and Pbb0 for somea0; b0 2 B.

T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771 3767

Proof. Assume that a and b are vertices of Qn such that there exists a long fault-free path Pab. Since Pab is a long path and Bcontains a long path by Theorem 5.1, we have jVðPabÞj; jBjP 2n � 2jFj � 1. It follows that

jVðPabÞj þ jBjP 2nþ1 � 4n2

10þ n

2þ 1

� �� 2 > jVðQ nÞj þ 2;

and therefore Pab and B share two vertices, say a0 and b0. Consequently, Pab ¼ Paa0 þ Pa0b0 þ Pb0b and Paa0 ; Pb0b are the desiredvertex-disjoint paths.

On the other hand, assume that Paa0 and Pbb0 are fault-free vertex-disjoint paths in Qn and a0; b0 2 B. Further assuming thatthese paths are as short as possible, we obtain that a0 and b0 are the only vertices they share with B. By Theorem 5.1 there is along fault-free path Pa0b0 . Since a0; b0 2 B and the subgraph induced by B is biconnected, it follows that VðPa0b0 Þ# B.Consequently, a0 and b0 are the only vertices that Pa0b0 shares with Paa0 or Pbb0 and Paa0 þ Pa0b0 þ Pb0b is therefore the desired longfault-free path. h

We conclude this section with another, perhaps more illuminating characterization of pairs that may be interconnectedby a long fault-free path. Before formulating the condition, we need to introduce the following notation.

The block-cutvertex graph bc(G) of a graph G is the graph whose vertices are blocks and cutvertices of G and whose edgesjoin cutvertices with blocks containing them. It is well-known that if G is a connected graph, then bcðGÞ is a tree and it maybe constructed in time OðjEðGÞjÞ [6]. We define a mapping bcG : VðGÞ ! bcðGÞ by

bcGðvÞ ¼v ; if v is a cutvertex;

block of G containing v; otherwise:

Theorem 5.4. Let F be a set of at most n2

10þ n2þ 1 faulty vertices of Qn; n P 15, and B be the largest fault-free block of Q n. Then

there is a long fault-free path between a and b in Qn if and only if a and b belong to the same component C of Q n nF and theunique path between bcCðaÞ and bcCðbÞ in bcðCÞ passes through vertex B.

Proof. Assume that a and b are vertices of Q n such that there exists a long fault-free path between them. Clearly, a and b thenbelong to the same component C of Qn nF. Moreover, by Lemma 5.3 there are a0; b0 2 B and vertex-disjoint fault-free pathsPaa0 and Pbb0 in Qn. Assuming that these paths are as short as possible, we obtain that a0 and b0 are the only vertices they sharewith B. Since B is a block, there is a path Pa0b0 with VðPa0b0 Þ# B. Then Pab ¼ Paa0 þ Pa0b0 þ Pb0b is a fault-free path with at least twoconsecutive vertices in B. We only need to transform this path onto a path between bcCðaÞ and bcCðbÞ in bcðCÞ passingthrough vertex B.

Assume that Pab consists of a ¼ x1; x2; . . . ; xm ¼ b. Note that for every i 2 ½m� 1� there exists exactly one block Bi of Qn nFwith xi; xiþ1 2 Bi. We transform the sequence fBigm�1

i¼1 by the following rules:

(i) If Bi ¼ Biþ1 then we omit Biþ1.(ii) If Bi–Biþ1 then xiþ1 is a cutvertex and we insert xiþ1 between Bi and Biþ1.

Finally, if bcCðaÞ or bcCðbÞ is a cutvertex, we insert bcCðaÞ at the beginning or bcCðbÞ at the end of the new sequence, whichwe denote by fzigk

i¼1. Note that now z1 ¼ bcCðaÞ; zk ¼ bcCðbÞ, and as Pab included two consecutive vertices of B; zi ¼ B forsome i 2 ½k�. Moreover, zi is a vertex of bcðCÞ for every i 2 ½k� and ziziþ1 is an edge of bcðCÞ for every i 2 ½k� 1�.

We claim that the elements of fzigki¼1 are pairwise distinct. Indeed, there cannot be repeated cutvertices, since then they

would also repeat in Pab, contrary to the fact that Pab is a path. If there were two identical blocks zi ¼ zj for some i < j, thenrules (i)–(ii) imply iþ 2 < j. But then zi; ziþ1; . . . ; zj forms a cycle in bcðCÞ, contrary to the fact that bcðCÞ is a tree. Hence, wecan conclude that fzigk

i¼1 is a path between bcCðaÞ and bcCðbÞ in bcðCÞ passing through vertex B. The path must be uniquebecause bcðCÞ is a tree.

Conversely assume that a and b belong to the same component C of Q n nF and the unique path between bcCðaÞ andbcCðbÞ in bcðCÞ passes through vertex B. Modify the path between bcCðaÞ and bcCðbÞ so that if bcCðaÞ (or bcCðbÞ) is a block,insert a at the beginning (or b at the end) and denote the resulting sequence by fzigk

i¼1. Note that now z1 ¼ a; zk ¼ b, andzl ¼ B for some 1 < l < k. Next, recall that bcðCÞ is a tree, and therefore for every block zi and j–i we have

(i) If zj is a cutvertex and zj 2 zi, then ji� jj ¼ 1.(ii) If zj is a block and zi \ zj–;, then ji� jj ¼ 2.

Furthermore, for every even i 2 ½k�; zi is a block while zi�1; ziþ1 two of its vertices, and therefore there exists a path Pi in zi

between zi�1 and ziþ1. In that way we have obtained paths P2; P4; . . . ; Pk�1 so that distinct Pi; Pj have exactly one commonvertex if ji� jj ¼ 2, and are vertex-disjoint otherwise by the above conditions (i) and (ii). Recall that as zl ¼ B, we haveVðPlÞ# B. It remains to replace Pl with a long path in B with the same endvertices, which exists by Theorem 5.1, and concludethat then P2 þ P4 þ � � � þ Pk�1 is the desired long fault-free path between a and b. h

3768 T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771

6. Optimality

Let /ðnÞ denote the maximum number such that for every set of faulty vertices of Qn of size at most /(n) and for everypair of distinct vertices of the largest fault-free block there exists a long fault-free path between them. Let wðnÞ denote themaximum number such that for every set of faulty vertices of Qn of size at most w(n) there exist a pair of distinct vertices anda long fault-free path between them. By Theorem 5.1, /ðnÞ;wðnÞP cn2 for some constant c > 0. The aim of this section is togive an upper bound on /ðnÞ and wðnÞ.

Theorem 6.1. /ðnÞ 6 n2

� �� 2 for n P 4 and wðnÞ 6 2 n

2

� �� 1 for n P 6.

Proof. To verify the first inequality assume that n P 4 and that the set F of faulty vertices consists of all but one vertex at

distance two from an arbitrary vertex x 2 VðQnÞ. Then jFj ¼ n2

� �� 1. From n P 4 it follows that the largest block B of

Qn �F contains all vertices of Q n �F except the closed neighborhood of x. Hence

jfy 2 BjpðyÞ ¼ pðxÞgj ¼ 2n�1 � jF [ fxgj ¼ 2n�1 �n

2

� �:

Since B contains at least two adjacent vertices, we can select u;v 2 B such that pðuÞ–pðvÞ. Note that as B is a block of Qn �F,

an arbitrary fault-free path Puv cannot leave B and therefore may contain at most 2n�1 � n2

� �vertices of parity pðxÞ. It fol-

lows that lðPuv Þ 6 2n � 2 n2

� �� 1 < 2n � 2jFj � 2 and therefore Puv is not a long path. Hence, we can conclude that

/ðnÞ 6 jFj � 1 ¼ n2

� �� 2.

To verify the latter inequality, assume that n P 6. Let x; y 2 VðQnÞ be arbitrary vertices at distance six and let F consist of

all vertices at distance two from x or y. Then jFj ¼ 2 n2

� �while Qn �F consists of three components, namely the closed

neighborhood of x, the closed neighborhood of y, and C containing the remaining vertices of Qn �F. Observe that frompðxÞ ¼ pðyÞ we obtain

jfz 2 VðCÞjpðzÞ ¼ pðxÞgj ¼ 2n�1 � jF [ fx; ygj ¼ 2n�1 � 2n2

� �� 2:

Consequently, an arbitrary fault-free path between two vertices of C may contain at most 2n�1 � 2 n2

� �� 2 vertices of parity

pðxÞ. It follows that the length of any path between them is at most 2n � 4 n2

� �� 4 < 2n � 2jFj � 2 and therefore it is not a

long path. Hence we can conclude that wðnÞ 6 jFj � 1 ¼ 2 n2

� �� 1. h

Putting together Theorems 5.1 and 6.1, we obtain bounds on /ðnÞ and wðnÞ that are asymptotically tight.

Corollary 6.2. /ðnÞ;wðnÞ 2 Hðn2Þ.

7. Algorithm

This section describes an algorithm which finds a long fault-free path between an arbitrary pair of given vertices, or de-tects that it does not exist. In order to make use of the construction of Section 4, we need to get rid of the additional assump-tions imposed on given vertices by Theorem 4.1. Armed with the characterization provided by Lemma 5.3, we accomplishthis task using the following variant of the classical problem on the existence of two vertex-disjoint paths.

Definition 7.1 (DISJOINTPATHSða; b;V ;BÞ).

INPUT: Distinct vertices a; b of Q n, sets V ;B such that B # V # VðQnÞ.OUTPUT: Vertex-disjoint paths Paa0 ; Pbb0 in the subgraph of Qn induced by V such that a0; b0 2 B if they exist; ‘‘no” otherwise.

Lemma 7.2. There is an algorithm for the DISJOINTPATHSða; b;V ;BÞ problem running in OðnjV j3=2Þ time.

Proof. Let G be the subgraph of Qn, induced by V, furnished with new vertices x; y and edges connecting x with a; b and ywith each vertex of B. Observe that there is one-to-one correspondence between solutions of the DISJOINTPATHS problemand the existence of two paths between x and y in G whose internal vertices are pairwise distinct. Is well-known that thereis an algorithm for the latter problem [6] running in OðjVðGÞj1=2jEðGÞjÞ ¼ OðnjV j3=2Þ time. h

T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771 3769

To keep the running time of the algorithm for DISJOINTPATHS within reasonable bounds, its application may be limited only to acertain subgraph of Q n. The following procedure constructs such a subgraph by a breadth-first search starting at vertices a; b.

Lemma 7.3. Let D # ½n� be a set of size 5, let a; b be distinct vertices and F be a set of f faulty vertices of Q . Put

nSB ¼

Su2VðQn�5ÞBDðuÞ. Procedure BFSða; b;F;DÞ computes sets V and B such that

(i) every fault-free path Pxy in Qn with x 2 fa; bg and VðPxyÞ \S

B ¼ fyg satisfies VðPxyÞ# V,(ii) B ¼ V \

SB.

Moreover, if jVðQnÞ nS

Bj ¼ Oðf Þ, then jV j ¼ Oðnf Þ and the running time of the procedure is bounded by Oðn2f Þ.

Proof. Since BFS realizes a breadth-first search of Q n �F starting at a and b, which stops only when reaching a vertex ofS

B,it visits every vertex on each path Pxy between fa; bg and

SB such that VðPxyÞ \

SB ¼ fyg. This verifies part (i). Part (ii) fol-

lows from the fact that each y 2 V is inserted into B iff y 2 BDðyDÞ (line 8).To verify the rest, let jVðQnÞ n

SBj ¼ Oðf Þ. Observe that each vertex of Qn is ENQUEUEd at most once, and no vertex of

SB is

ENQUEUEd. Hence that total number of ENQUEUEd vertices is bounded by jVðQnÞ nS

Bj ¼ Oðf Þ. Since the degree of each vertex ofQn is n, the forall-loop (lines 5-8) executes no more that Oðnf Þ times. It follows that jV j ¼ Oðnf Þ. Furthermore, as QDðyDÞ is asubcube of dimension 5, its largest fault-free block is uniquely determined by Proposition 3.3 and may be found in a constanttime.

Note that we may use trie T to store vertices of Qn visited during the search. Assume that each leaf of T includes flagsindicating whether the vertex it represents belongs to F, B, or V :T may be initialized with all vertices of F in Oðnf Þ time.Testing the presence of y in F or V as well as inserting y into V or B then may be realized in OðnÞ time, which is also an upperbound on the time consumed by each iteration of the forall-loop. Therefore, we conclude that the total running time isbounded by Oðn2f Þ. h

At this point we are ready to describe an algorithm which, given quadratically many faulty vertices in Qn of a sufficientlylarge dimension n and a pair of distinct vertices, returns a long fault-free path between them if it exists.

Theorem 7.4. Let n P 15 and Qn contain at most n2

10þ n2þ 1 faulty vertices. Then for every pair of distinct vertices of Qn, Algorithm

7.2 verifies the existence of a long fault-free path between them in Oðn8Þ time and, if it exists, constructs the path in linear time with

respect to its length.

Proof. First we give a more detailed description of all steps of the algorithm.The first step finds a set D # ½n�with jDj ¼ 5 and jFDðuÞj 6 6 for every u 2 VðQn�5Þ. Recall that the existence of such a set is

guaranteed by Theorem 3.2. In order to be able to perform the test on line 2 efficiently, we shall use a trie T over the alphabet{0,1} such that each leaf t of T includes a counter ct , initialized to zero, that counts the number of INSERTs that have ended at t.Consider the following procedure.

The procedure is correct because for x; y 2F we have x; y 2 VðQ DðuÞÞ for some u 2 VðQn�5Þ if and only if INSERTðxD; TÞ andINSERTðyD; TÞ end at the same leaf. Since the running time of operation INSERTðx; TÞ is linear in the length of x, we infer that pro-cedure TEST requires time OðnjFjÞ ¼ Oðn3Þ assuming that jFj ¼ Oðn2Þ. We call TESTðD;FÞ systematically on sets D # ½n� of size5 until it returns ‘‘yes”. Then D is the required subset of ½n�. Since the number of five-element subsets of ½n� is Oðn5Þ, we findthe subset D with the desired property in Oðn8Þ time.

As the next step, procedure BFS first computes sets B # V , and then procedure DISJOINTPATHS verifies the existence of twovertex-disjoint paths in V connecting a; b with B. By Lemma 7.3, the running time of BFS is bounded by Oðn2f Þ ¼ Oðn4Þ, whilejV j ¼ Oðnf Þ ¼ Oðn3Þ. Therefore by Lemma 7.2, procedure DISJOINTPATHS requires Oðn5:5Þ time.

Regarding the correctness of this part of the algorithm, note that by Lemma 5.3, the positive solution of our problem isequivalent to the existence of two vertex-disjoint paths connecting a; b with the largest fault-free block. Lemma 7.3 revealsthat it suffices to consider only paths in V, and that is exactly what is tested by procedure DISJOINTPATHS, as confirmed byLemma 7.2. In particular, ‘‘path does not exist” (line 5) is returned exactly when there is indeed no solution of our problem.Note that up to this point, our algorithm has correctly decided on the existence of the solution in Oðn8Þ time. This settles thefirst part of the theorem.

To see why the other part is true, note that after paths Paa0 and Pbb0 are returned by procedure DISJOINTPATHS, a long fault-free path Pa0b0 in B is constructed by Theorem 4.1 in OðlðPa0b0 ÞÞ time. Since paths Paa0 and Pbb0 have only vertices a0; b0 incommon with B, it follows that path Paa0 þ Pa0b0 þ Pb0b, returned by the algorithm, is indeed the desired long fault-free path. Itonly remains to recall that the total running time is bounded by Oðn8 þ lðPa0b0 ÞÞ ¼ Oð2nÞ, which is a linear function of thelength of the resulting path. h

3770 T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771

8. Concluding remarks

It this paper we have described an algorithm to construct a long fault-free path between a given pair of vertices ofn-dimensional faulty hypercube. Its time complexity is bounded by a linear function of the output length, which is asymp-totically optimal result. There is, however, the upper bound Oðn2Þ imposed on the number of faults. Even though we haveconstructed instances with Hðn2Þ faults but no fault-free path at all, it still makes sense to ask what is the time complexityof this problem in general. In particular, is it true that for any positive integer k there is a polynomial-time algorithm whichwould accomplish this task for OðnkÞ faults?

Considering only the decision version, we have shown that our algorithm requires Oðn8Þ time to decide whether the prob-lem with Oðn2Þ faults has a solution. Is true that for any positive integer k there is f ðkÞ such that the problem with OðnkÞ faultsmay be decided in Oðnf ðkÞÞ time?

As mentioned in the introduction, our results contribute to the study of fault-tolerant properties of hypercubic intercon-nection networks. There is, however, a different field with a related problem: Given a set of n-bit binary strings, find itsordering so that the sum of (Hamming) distances of consecutive strings is minimized. This problem, known to be NP-hard[2], is useful for compression of bitmap indices of scientific databases [11]. A popular heuristic that has been used to approx-

T. Dvorák, V. Koubek / Information Sciences 179 (2009) 3763–3771 3771

imate the optimal solution is to assign to each of given strings its order on a hamiltonian cycle of Q n [12]. We suggest that itmay be feasible to modify our algorithm to obtain an alternative approximative solution.

Acknowledgement

The authors are grateful to Petr Gregor for enlightening suggestions in discussion on this topic.

References

[1] Sergei L. Bezrukov, Isoperimetric problems in discrete spaces, in: P. Frankl, Z. Füredi, G. Katona, D. Miklós (Eds.), Extremal problems for finite sets,Bolyai Society Mathematical Studies, Budapest, vol. 3, 1994, pp. 59–91.

[2] Tomáš Dvorák, Petr Gregor, Partitions of faulty hypercubes into paths with prescribed endvertices, SIAM Journal on Discrete Mathematics 22 (4) (2008)1448–1461.

[3] Jirí Fink, Petr Gregor, Long paths and cycles in hypercubes with faulty vertices, Information Sciences 179 (2009) 3634–3644.[4] Jung-Sheng Fu, Longest fault-free paths in hypercubes with vertex faults, Information Sciences 176 (7) (2006) 759–771.[5] Ivan Havel, On hamiltonian circuits and spanning trees of hypercubes, Casopis Pro Pestování Matematiky 109 (1984) 135–152.[6] Dieter Jungnickel, Graphs Networks and Algorithms (Algorithms and Computation in Mathematics), Springer-Verlag, New York, 2004.[7] Donald E. Knuth, The Art of Computer Programming, Volume 4, Fascicle 2: Generating All Tuples and Permutations, Addison-Wesley Professional,

2005.[8] Tz-Liang Kueng, Tyne Liang, Lih-Hsing Hsu, Jimmy J.M. Tan, Long paths in hypercubes with conditional node-faults, Information Sciences 179 (5)

(2009) 667–681.[9] Frank Thomson Leighton, Introduction to Parallel Algorithms and Architectures: Arrays Trees Hypercubes, Morgan Kaufmann, San Mateo, CA, 1992.

[10] Martin Lewinter, William Widulski, Hyper-hamilton laceable and caterpillar-spannable product graphs, Computers and Mathematics withApplications 34 (1997) 99–104.

[11] Ali Pinar, Tao Tao, Hakan Ferhatosmanoglu, Compressing bitmap indices by data reorganization, in: ICDE’05: Proceedings of the 21st InternationalConference on Data Engineering, IEEE Computer Society, 2005, pp. 310–321.

[12] Dana S. Richards, Data compression and Gray-code sorting, Information Processing Letters 22 (4) (1986) 201–205.[13] Gábor Wiener, Edge multiplicity and other trace functions, Electronic Notes in Discrete Mathematics 29 (2007) 491–495.