13
Restricted shortest paths in 2-circulant graphs T. Dobravec and B. Robiˇ c Faculty of Computer and Information Science University of Ljubljana, Slovenia {tomaz.dobravec, borut.robic}@fri.uni-lj.si Keywords: circulant graphs, routing, 1 -lattice, Diophantine equation, closest vector prob- lem Corresponding author: Tomaˇ z Dobravec University of Ljubljana, Slovenia Faculty of Computer and Information Science e-mail: [email protected] Version: draft (Januar 2010) 1

Restricted shortest paths in 2-circulant graphs

Embed Size (px)

Citation preview

Restricted shortest paths in 2-circulant graphsT. Dobravec and B. Robic

Faculty of Computer and Information ScienceUniversity of Ljubljana, Slovenia

{tomaz.dobravec, borut.robic}@fri.uni-lj.si

Keywords: circulant graphs, routing, ℓ1-lattice, Diophantine equation, closest vector prob-lem

Corresponding author:Tomaz DobravecUniversity of Ljubljana, SloveniaFaculty of Computer and Information Sciencee-mail: [email protected]: draft (Januar 2010)

1

Restricted shortest paths in 2-circulant graphs

Abstract

Semi-directed 2-circulant graph is a subgraph of an (undirected) 2-circulant graphin which the links of one type (i.e., short or long) are directed while the other linksare undirected. The shortest paths in semi-directed circulant graphs are called the re-stricted shortest paths in 2-circulant graphs. In this paper we show that the problemof finding the restricted shortest paths is equivalent (1) to solving an optimizationproblem which involves Diophantine equations and (2) to the closest vector problemin a subset of a point lattice of all cyclic paths of the graph. We also present ournew, efficient algorithm for constructing the restricted shortest paths which requiresO(log n) arithmetic operations.

1 Introduction

Circulant graphs are well-known and frequently studied mathematical structures. Due totheir powerful and useful properties (such as vertex symmetry, small diameter, scalabil-ity and efficient routing capabilities), they have been used in the development of VLSItechnology as well as for connection schemes in computer networks [1, 4, 12, 16]. With aview to taking full advantage of the routing capabilities of the underlying topology in thefamous computer ILLIAC IV, in FDDI-token, SILK and SONT rings [2, 15] as well asin some other parallel processing systems and projects (Intel Paragon, Cray T3D, MPP,MICROS), many theoretical studies concerning the routing problems in circulant graphshave been discussed [3, 5–8, 11, 13, 14].A subgraph of a 2-circulant graph in which the links of one type (i.e., short or long) arechanged from undirected to directed is called a semi-directed 2-circulant graph (see Fig. 1).In this way the node degrees are reduced from 4 to 3, thus making such graphs asymmetric(in terms of path reversibility) and hence diameter-related problems generally harder thanfor undirected graphs. The shortest paths (i.e., paths with the minimum number of links)in semi-directed 2-circulant graphs will be called restricted shortest paths of 2-circulantgraphs, or simply RSPs.The efficiency of constructing the RSPs is crucial to the time complexity of several optimaldynamic routing algorithms for circulant graphs [9]. Using RSPs these algorithms candynamically decide where to send a given package in order to stay on one of the shortestpaths to the destination node. The main advantage of RSP-based routing over staticrouting (where the routing path is constructed during the preprocessing phase) or overdynamic routing with the shortest paths (where the routing path is augmented on-the-flyat each routing step) is that RSP-based routing algorithms can often choose from a largerset of candidates for the next node to be visited. Specifically, while in static routing ordynamic routing with the shortest paths this set has at most two elements, in RSP-basedrouting it may contain 3 or even 4 elements. Using an RSP-based routing algorithm thesystematic construction of the routing paths in all the circulant graphs consisting of up to

2

0123

45 6 7

0123

45 6 7

a. undirected b. semi-directed

Figure 1: 2-circulants with 8 nodes and with hops of lenght 2 and 3. In the undirected caseeach node has in-degree 4 and every path can be simply reversed while in the semi-directedgraph, in which nodes have in-degrees 3, this is not always possible.

50 nodes (i.e., 4165 graphs and 154687 routing paths) has revealed that in 8.3% of casesthis set consists of 3 elements and in 2.9% of even 4 elements. Hence, in at least 11.2%of the cases the RSP-based routing algorithm can choose from more candidates for thenext node to be visited than other algorithms [10]. This property is especially importantin heavy-traffic networks where flexible routing algorithms are needed in order to avoidpotential routing problems that arise from congestion or node/link faults.In this paper we show that the problem of finding RSPs can be defined in at least threeequivalent ways: (1) as a graph-theoretical problem, (2) as an optimization problem (in-volving a linear Diophantine equation with two restriction criteria), and (3) as a closestvector problem (in a point lattice of all cyclic paths of the corresponding graph). As thefirst definition offers no useful hints for solving the problem, we have focused on the thirdone, and in this way designed an efficient algorithm for constructing the RSPs. Conse-quently, this algorithm contributes not only to graph theory but also to number theory aswell as to the theory and application of point lattices.The paper is organized as follows. In the next Section we define new terms and statethree equivalent definitions of the RSP problem. In Section 3 we introduce the integerlattice environment with its properties and tools. In Section 4 we present our new, efficientalgorithm for constructing RSPs and prove its correctness as well as its O(log n) timecomplexity.

3

2 Problem definition

Let N be the set of positive integers, Zn = {0, 1, . . . , n− 1}, and I = {−2,−1, 1, 2}.

Definition 1 Let n, h1, h2 ∈ N be such that 0 < h1 < h2 < ⌊n/2⌋ and gcd(n, h1, h2) = 1. Adouble-loop graph G(n; h1, h2) is a directed graph G(V,E), where the node set V = Zn andthe arc set E is the union of sets E1 = {(u, u+h1 (mod n)) | u ∈ Zn} and E2 = {(u, u+h2

(mod n)) | u ∈ Zn}. In the undirected case, which is known as a 2-circulant graph and isdenoted by G(n;±h1,±h2), arcs are changed into (undirected) edges.

Note that a circulant graph is connected if and only if gcd(n, h1, h2) = 1 . In 2-circulantgraphs, besides E1 and E2, the set of edges also consists of the sets E−1 = {(u, u − h1

(mod n)) | u ∈ Zn} and E−2 = {(u, u− h2 (mod n)) | u ∈ Zn}, i.e.,

E =⋃

j∈I

Ej .

Let, for each i ∈ I, ǫ1 denote a hop of type i (i.e., a hop from set Ei). Each path in a 2-circulant graph of length l corresponds to a sequence ǫi1 , ǫi2, . . . , ǫil , where i1, i2, . . . , il ∈ I.For example, a path 1 → 3 → 6 → 4 → 7 in G(8;±2,±3) corresponds to a sequence ǫ1,ǫ2, ǫ−1, ǫ2. A path that does not contain hops of opposite types (i.e., ǫi and ǫ−i for somei ∈ I) is called a simple path. Clearly, when considering shortest paths, only simple pathsneed to be taken into account.If p = ǫi1 , ǫi2, . . . , ǫil is a path from u to v, then any permutation of hops ǫij is also a pathfrom u and v. Furthermore, any such permutation is also a path from the node 0 to thenode w = v − u (mod n). This is because the path p = ǫi1 , ǫi2 , . . . , ǫil is closely related tothe linear Diophantine equation

u+ ti1 + ti2 + · · ·+ til ≡ v (mod n),

where ti = sign(i)∗h|i|. Thus, when only the number of links of a particular type on a pathis important (not their ordering), the path can be represented by a quadruplet of integers,one for each hop type. In particular, when considering simple paths, which is the case inthis paper, a path can be represented by a pair (x1, x2), where |xi| is the number of hopsof type ǫj and j = sign(xi) ∗ i.

The following definition introduces semi-directed circulant graphs, which are circulantgraphs having no links of a particular type.

Definition 2 Let n, h1, h2 be as in Definition 1. For a given i ∈ I, the semi-directed2-circulant graph Gi(n;±h1,±h2) is a graph with the node set V = Zn and the arc set

E =⋃

j∈I−{i}

Ej .

4

Definition 3 The shortest path from u to v in semi-directed 2-circulant graph Gi(n;±h1,±h2)is said to be a restricted shortest path of type i in G(n;±h1,±h2) and is denoted by pi(u, v).The length of pi(u, v) is denoted by di(u, v).

The main goal of this paper is to show how to solve the following problem.

Problem 1 Given n, h1, h2, u, v and i, find the restricted shortest path pi(u, v).

As the definition of Problem 1 offers no hints about solving it, we will reformulate theproblem in an algebraic and therefore more descriptive form. To do this we will use thefollowing lemma.

Lemma 1 Let n, h1, h2 be as in Definition 1, let i ∈ I and u, v ∈ Zn. If pi(u, v) is a simplepath from u to v represented by (x1, x2), then

a. u+ x1h1 + x2h2 ≡ v (mod n),

b. the length of pi(u, v) is di(u, v) = |x1|+ |x2|,

c. if pi(u, v) does not contain hops of type i ∈ I, then sign(i) ∗ x|i| ≤ 0.

Using Lemma 1, whose proof will be omitted due to its simplicity, Problem 1 can bereformulated in the following algebraic form.

Problem 2 Let n, h1, h2 be as in Definition 1 and let i ∈ I, u, v ∈ Zn and w = v − u(mod n). Find a solution (x1, x2) of the equation

x1h1 + x2h2 ≡ w (mod n), (1)

which minimizes the sum|x1|+ |x2| (2)

subject to the restriction thatsign(i) ∗ x|i| ≤ 0. (3)

Instead of solving the problem analytically, which turned out to be difficult, we will showhow to solve Problem 2 by transforming it into an equivalent geometric problem in the2-dimensional integer lattice Z × Z, where each point x = (x1, x2) is labelled with thelabeling function

l(x) = x1h1 + x2h2 (mod n).

It is obvious that (a) the solutions of equation (1) are points in Z × Z with the label w(and vice versa), (b) the solutions of the inequality (3) are in the half-plane Z

2

−i (see Fig.2) and (c) the sum (2) is the Manhattan norm ℓ1 of element x = (x1, x2) ∈ Z× Z. Hence,we can reformulate Problem 2 as follows.

5

Z21Z2�1Z22Z2�2

Figure 2: Half-planes Z2

i

Problem 3 Let n, h1, h2 ∈ N such that 0 < h1 < h2 < ⌊n/2⌋ and gcd(n, h1, h2) = 1. Leti ∈ I, u, v ∈ Zn and w = v − u (mod n). Among all points of the half-plane Z

2

−i that arelabelled w find the one with minimal ℓ1-norm.

In the following we will show how to solve Problem 3 and thus, since the three formulationsof the problem are equivalent, how to find RSPs in 2-circulant graphs and also how to finda solution of the Diophantine equation (1) satisfying the restrictions (2) and (3).

Problem 3 can be solved by a brute-force algorithm that systematically searches the half-plane, i.e., it searches ℓ1-spheres by incrementing their radius until the first element withthe label w is found. However, this algorithm has a time complexity polynomial in n andis therefore prohibitively slow. This is because a 2-circulant graph G(n; h1, h2) can bedescribed only by the numbers n, h1 and h2. Since the input takes only O(log n) space,the polynomial in n is in fact exponential in terms of the size of the input. In Section 4 wewill present an algorithm for solving Problem 3 which requires only O(log n) arithmeticoperations. However, before that we must introduce some additional technical notions andtools.

3 The integer lattice environment

The integer lattice Z× Z = {(x1, x2); x1, x2 ∈ Z} with its modular properties has turnedout to be an environment in which Problem 1 can be clearly presented and solved with areasonable amount of effort.

The labeling functionInteger lattices and circulant graphs are connected in a natural way: each point in thelattice represents a simple path in a graph and vice versa. If the lattice is equipped witha labeling function (l(x) = x1h1 + x2h2 (mod n) for each x = (x1, x2) ∈ Z× Z), then thisconnection is even stronger since each lattice point with label w represents a path fromnode 0 to w in the corresponding graph G(n;±h1,±h2).Example: Fig. 3 depicts a labeled integer lattice that represents the graph G(8;±2,±3). The

lattice point z=(5,4), for example, corresponds to a path with 5 short and 4 long hops. The label

of point z (i.e. 6) corresponds to the node that is reached from the node 0: 0 + 5 ∗ 2 + 4 ∗ 3 = 6

6

(mod 8).

The set Xw

We will denote with Xw the set of elements of the lattice Z× Z that are labelled with w,

Xw := {x ∈ Z× Z; l(x) = w}.

For each w ∈ Zn and i ∈ I the intersection of Xw and Z2

i will be denoted by X iw. The

set X0 of elements with the label 0 (note that this set represents all cyclic paths) is asubmodule of Z× Z.Example: Every lattice point with label 5 belongs to the set X5; among these elements all that

are in the right half-plane belong to X1

5, in the left half-plane to X−1

5, and so forth. In Fig. 3

the labels of the members of X−2

5are underlined.

Basis, parallelograms, and elementsLet {a, b} be a basis of the module X0 (i.e., a set of linearly independent vectors that spansX0). The set of points

{x ∈ Z× Z; x = αa+ βb; 0 ≤ α, β < 1}

is denoted by [a, b) and called the main base parallelogram. With base parallelograms wedenote the parallelograms [a, b), [a, b) − a, [a, b) − b and [a, b) − (a + b). Every otherparallelogram, i.e., every parallelogram of the form [a, b) + sa + tb (s, t ∈ Z), is called aparallelogram of the basis {a, b}.Example: One of possible bases of moduleX0 for the graphG(8;±2,±3) is {a, b} = {(4, 0), (1, 2)}.

This basis and the corresponding base parallelograms are depicted in Fig. 3 in bold; the main

base parallelogram is shaded.

We will use the following lemma, which was proved in [17].

Lemma 2 For each w ∈ Zn there exists x ∈ [a, b) such that l(x) = w.

Since there are n points in each parallelogram, for each w ∈ Zn there is exactly one x ∈ [a, b)with the label w. This element, called a main base element, will be denoted xw. The ele-ments in the four base parallelograms with the label w (i.e., xw, xw−a, xw−b, xw− (a+b))are called base elements.Example: For the basis {a, b} = {(4, 0), (1, 2)} and w = 7 the main base element is xw = (2, 1);

the other three base elements are xw−a = (−2, 1), xw− b = (1,−1), and xw− (a+ b) = (−3,−1)

(in Fig. 3 these elements are circled).

Packed basisA basis {a, b} of a module X0 for which

max{||a||, ||b||} ≤ min{||a+ b||, ||a− b||}

7

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

z = (5, 4)

xw

a

b

Figure 3: Tiling of the lattice Z × Z with parallelograms of basis {(4, 0), (1, 2)} for themodule X0 of a graph G(8; ±2,±3); four base parallelograms are emphasized, the mainbase parallelogram is shaded

is called a packed basis. For each 2-circulant graph a packed basis exists, and it can befound in O(log n) time [17].Example: The basis {a, b} = {(4, 0), (1, 2)} from previous examples is packed.

StripesFor each x, e ∈ Z×Z a discrete line x+ ke; k ∈ Z is called a stripe through x in directione and denoted by t(x, e). For each w ∈ Zn the stripes through the base elements in thedirection of the base vectors (i.e., t(xw, a), t(xw, b), t(xw − b, a) and t(xw − a, b)) are calledbase stripes. The set of base stripes is denoted by Tw, while its intersection with the i-thhalf-plane is denoted by T i

w.Example: In Fig. 4 the base stripes for the graph G(8;±2,±3) with packed basis {a, b} =

{(4, 0), (1, 2)} and w = 8 are depicted.

Minimal projectionThe ℓ1-smallest element on the stripe t(x, e) in the half-plane Z

2

i is called a minimal pro-jection of x in the direction of e to Z

2

i and denoted P i(x, e). For each x, e ∈ Z × Z andi ∈ I the minimal projection P i(x, e) can be found in constant time [10].Example: The minimal projection P 1(xw, b) is the element (1,-1) since its norm (2) is smaller

than the norms of all the other elements of the stripe t(xw, b) (see Fig. 4).

8

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

2

5

0

3

6

1

4

2

5

0

3

6

1

4

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

2

5

0

3

6

1

4

2

5

0

3

6

1

4

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

4

7

2

0

3

6

1

4

7

2

5

0

3

6

1

4

2

5

0

3

6

1

4

7

2

5

0

3

6

4

7

2

5

0

3

6

1

4

7

2

5

0

6

1

4

7

2

5

0

3

6

1

4

7

2

a

b

7xw − a

7xw

7xw − (a + b)

7xw − b

t(xw, a)

t(xw − b, a)

t(xw, b

)

t(xw−

a, b

)

[1]w

[3]w

[4]w

[2]w

Figure 4: The base stripes and the four sections of the set Xw (w = 7) for the graphG(8;±2,±3) with packed basis {a, b} = {(4, 0), (1, 2)}

Sections of Xw

Each element x ∈ Xw can be expressed as x = xw +ma + nb;m,n ∈ Z. According to thesigns of the integers m and n the set Xw can be split into four sections,

Xw = [1]w ∪ [2]w ∪ [3]w ∪ [4]w,

wherex ∈ [1]w ⇐⇒ mx ≥ 0 ∧ nx ≥ 0,x ∈ [2]w ⇐⇒ mx < 0 ∧ nx ≥ 0,x ∈ [3]w ⇐⇒ mx ≥ 0 ∧ nx < 0,x ∈ [4]w ⇐⇒ mx < 0 ∧ nx < 0.

For each P ∈ {1, 2, 3, 4} the set of elements from [P ]w not lying on the base stripes will bedenoted by (P )w.Example: In Fig. 4 the four sections of the set Xw (w = 7) for the graph G(8;±2,±3) with the

packed basis {a, b} = {(4, 0), (1, 2)} are shaded.

Before presenting the algorithm for constructing the RSPs, let us reformulate our prob-lem as a special kind of a closest vector problem and prove that resulting formulation isequivalent to Problem 1.

Problem 4 Given n, h1, h2, w = v − u (mod n) and i, take any x ∈ Xw and find theelement of Xx

0:= {z ∈ X0; z|i| ≥ sign(i)x|i|} which is closest to the x.

9

Lemma 3 Let x ∈ Xw and let z ∈ Xx0such that ||z − x|| ≤ ||z′ − x||, ∀z′ ∈ Xx

0. Then

pi(u, v) = x− z.

Proof (Lema 3)Since z|i| ≥ sign(i)x|i| it is obvious that x − z ∈ X i

w. We only have to prove that amongall the elements of X i

w, (x− z) is the smallest one. Supose that there exists x′ ∈ X iw such

that ||x′|| < ||x − z||. Then x − x′ ∈ Xx0and ||x − (x − x′)|| = ||x′|| < ||x − z|| which

contradicts the assumption that z is among all elements of Xx0the closest to the x. 2

4 Finding the RSPs

The RSPs pi(u, v), i.e., the shortest path from u to v with no hops of type ǫi, is the ℓ1-smallest element of the set X i

w, i.e., the smallest of the elements of the half-plane Z2

−i withthe label w. Thus, to find the pi(u, v), one has to select from among all the elements inZ2

−i with the label w the one with minimal ℓ1 norm. However, to reduce the number ofcandidates we use the following theorem.

Theorem 4 Let {a, b} be a packed basis of a module X0 for graph G(n; ±h1,±h2) and leti ∈ I, w ∈ Zn. Then the smallest element of X i

w is in T iw, i.e.,

minx∈Xi

w

||x|| = minx∈T i

w

||x||.

Proof (Theorem 4)To prove Theorem 4 it is sufficient to show that for each x ∈ X i

w there exists y ∈ T iw whose

norm is not bigger than the norm of x, i.e.,

∀x ∈ X iw, ∃y ∈ T i

w : ||y|| ≤ ||x||. (4)

For the elements x that are already on one of the base stripes, the above statement isobviously true (take y = x), so we focus only on the elements in X i

w that are not in T iw,

i.e., on the elements of the set

Diw := X i

w − T iw.

We need to show that there exists a transformation τ : Diw → X i

w that decreases thedistance from the base stripes T i

w and, at the same time, it does not increase the norm.Applying τ on x ∈ Di

w several times, i.e.,

y = τ(τ(...τ︸ ︷︷ ︸

n

(x))),

for some n, decreases the distance to zero (y ∈ T iw) while ||y|| ≤ ||x||. This observation is

formally stated in the following proposition where the distance of the element x ∈ Diw from

10

the base stripes is denoted by r(x). The existence of a transformation τ proves statement(4) and consequently Theorem 4.

Proposition. Let {a, b} be the packed basis of the module X0 for the graph G(n; ±h1,±h2),w ∈ Zn and xw main base element. For each halfplane i ∈ I, for each P ∈ {1, 2, 3, 4} andfor each element x = xw+mxa+nxb ∈ (P )iw there exists a transformation τ : (P )iw → [P ]iw,for which r(τ(x)) < r(x) and ||τ(x)|| ≤ ||x||.

To prove this proposition one has to deal with 16 special cases (|I| ∗ |P | = 16) and for eachof them there are 11 subcases (depending on the type of the packed basis). Some of these176 cases are decomposed further on depending on the position of the element x. Thecomplete proof that extends over more than 25 pages ( [10], pages 55–65 and 79–95) treatsall of these cases by proving (a) for i = 1, P = 1 it is true that ||x|| ≥ min ||x− a||, ||x− b||,therefore one of the transformations x 7→ x− a and x 7→ x− b has the desired properties,(b) for i = 1, P = 2 one of the transformations x 7→ x − a, x 7→ x + b, x 7→ x + b − a,x 7→ x− [b2/a2]a+b and x 7→ x− [b1/a1]a+b has the desired properties, (c) for i = 1, P = 4the domain is empty ([4]1w = ∅), therefore all conditions are improved by any τ , and (d) byapplying reflection and rotation on a packed basis and the domain [P ]iw for all the othercases one can obtain the known and allready proved case (a), (b) or (c). This completesthe proof of the proposition and of Theorem 4. 2

Let us now show how to apply Theorem 4 in constructing RSPs. Since T iw is composed

of the stripes ti(xw, a), ti(xw, b), t

i(xw − b, a) and ti(xw − a, b), by Theorem 4 the smallestelement of X i

w is one of the smallest elements on these stripes, i.e.

minx∈Xi

w

||x|| = minx∈P

||x||,

whereP = {P i(xw, a), P

i(xw, b), Pi(xw − b, a), P i(xw − a, b)}}.

Consequently, the RSPs can be constructed with the Algorithm A.

Algorithm Ainput: n, h1, h2, i, u, voutput: RSP pi(u, v)

begin

{a, b} := packed basis of module X0 for G(n; ±h1,±h2);

w := v − u (mod n); xw := main base element;

P := {P−i(xw, a), P−i(xw, b), P

−i(xw − a, b), P−i(xw − b, a)};

return minℓ1 P ;

end.

11

The correctness of Algorithm A follows from Theorem 4. The time complexity (expressedin the number of arithmetic operations) of Algorithm A is O(log n) since the packed basisand the main base element can be found in logarithmic time and minimal projections inconstant time (see Section 3).

5 Conclusions

In this paper we introduced a subfamily of circulant graphs, called semi-directed circulantgraphs, and defined their shortest paths as restricted shortest paths, RSPs. RSPs canbe used for the indirect construction of general (i.e., unrestricted) shortest paths and toperform optimal dynamic routing. When routing a package from a given source to a givendestination, RSPs are used at each intermediate node to determine the next node on oneof the shortest paths. When heavy traffic is present RSP-based routing performs betterthan static routing since it can offer larger set of possible candidates for the next node.In the paper we designed an optimal, O(logn) algorithm for constructing RSPs in 2-circulants. To do this we reformulated the problem in two algebraic forms: first by usinglinear Diophantine equations with two conditions, and then by using an integer lattice witha Manhattan norm. Thus, besides solving the graph theoretical problem the algorithm canalso be used to solve optimization problems on linear Diophantine equations and to solvea special kind of closest vector problem in a point lattice.Our RSP-based dynamic routing can be used in every topology in which the set of edgescan be decomposed in k > 1 subsets of related edges (i.e., each node is connected to therest of the graph with k types of edges) and in which the routing destination dependsonly on the number of edges of a certain type (not on their ordering). In these topologiesRSPs can be defined similarly as in 2-circulant graphs and the same routing algorithmcan be used. What are these topologies (besides k-circulant graphs, mesh topology withwraparound connections and hyper-cubes) and how fast can one find their RSPs are thequestions open for further research.

References

[1] F. Aguilo and M. A. Fiol. An efficient algorithm to find optimal double loop networks.Discrete Mathematics, 138:15–29, 1995.

[2] J.C. Bermond, F. Comellas, and D.F. Hsu. Distributed loop computer networks: Asurvey. Journal of Parallel and Distributed Computing, 24:2–10, 1995.

[3] J.Y. Cai, G. Havas, B. Mans, A. Nerurkar, J.P. Seifert, and I. Shparlinski. On routingin circulant graphs. In Proceedings of the International Conference Computing and

12

Combinatorics, COCOON’99, LNCS 1627, pages 360–369, Tokyo, Japan, July 26–281999. Springer-Verlag, Berlin Heidelberg.

[4] R.C.F. Chan, C. Chen, and Z.-X. Hong. A simple algorithm to find the step ofdouble-loop networks. Discrete applied mathematics, 121:61–72, 2002.

[5] C. Chou, D. J. Guan, and K. Wang. A dynamic fault-tolerant message routing algo-rithm for double-loop networks. Information Processing Letters, 70:259–264, 1999.

[6] G. Cooperman and L. Finkelstein. Permutation routing via cayley graphs with ex-ample for bus inteconnection networks. DIMACS Series in Discrete Mathematics andTheoretical Computer Science, 21, 1995.

[7] T. Dobravec, B. Robic, and B. Vilfan. Dynamic shortest path routing in 2-circulants.In Seventeenth International Symposium On Computer and Information Science, IS-CIS XVII, pages 332–336, Orlando, Florida, October 28-30 2002.

[8] T. Dobravec, B. Robic, and J. Zerovnik. Permutation routing in double-loop networks:design and empirical evaluation. Journal of Systems Architecture, 48:387–402, 2003.

[9] T. Dobravec, J. Zerovnik, and B. Robic. An optimal message routing algorithm forcirculant networks. Journal of Systems Architecture, 52:298–306, 2006.

[10] Tomaz Dobravec. Routing algorithms in networks with the topology of circulant graphs.PhD thesis, University of Ljubljana, Faculty of Computer and Information Science,2004.

[11] J. Fabrega and M. Zaragoza. Fault-tolerant routing in double fixed-step network.Discrete Applied Mathematics, 78:61–74, 1997.

[12] M.A. Fiol, J.L.A. Yebra, I. Alegre, and M. Valero. A discrete optimization problemin local networks and data alignment. IEEE Transactions On Computers, C-36(6),1987.

[13] Domingo Gomez, Jaime Gutierrez, and Alvar Ibeas. Optimal routing in double loopnetworks. Theor. Comput. Sci., 381(1-3):68–85, 2007.

[14] D.J. Guan. An optimal message routing algorithm for double-loop networks. Infor-mation Processing Letters, 65:255–260, 1998.

[15] F.K. Hwang. A complementary survey on double-loop networks. Theoretical ComputerScience, 263:211–229, 2001.

[16] F.K. Hwang. A survey on multi-loop networks. Theoretical Computer Science,299:107–121, 2003.

[17] J. Zerovnik and T. Pisanski. Computing the diameter in multiple-loop networks. J.Algorithms, 14:226–243, 1993.

13