25
Path Multicoloring with Fewer Colors in Spiders and Caterpillars Aris Pagourtzis Katerina Potika Stathis Zachos Department of Computer Science School of Electrical and Computer Engineering National Technical University of Athens email:{pagour,epotik,zachos}@cs.ntua.gr Abstract We study a recently introduced path coloring problem with appli- cations to wavelength assignment in all-optical networks with multiple fibers. In contrast to classical path coloring, it is, in this setting, pos- sible to assign a color more than once to paths that pass through the same edge; the number of allowed repetitions per edge is given and the goal is to minimize the number of colors used. We present algorithms and hardness results for tree topologies of special interest. Our algorithms achieve approximation ratio of 2 in spiders and 3 in caterpillars, whereas the best algorithm for trees so far, achieves an approximation ratio of 4. We also study the directed version of the problem and show that it admits a 3-approximation algorithm in caterpillars, while it can be solved exactly in spiders. AMS Subject Classifications: 68U05,68R10, 05C05, 05C15, 90B18, 05C85, 90C59, 94C15. keywords: path coloring, multifiber all-optical networks, approxima- tion algorithms, spiders, caterpillars. 1 Introduction Optical fibers play an important role in modern communication systems, such as the Internet and other data transferring networks, since they offer a large bandwidth, small delays and low bit-error rates. A network is called all-optical, if signals remain in optical form (no conversion to electrical form) from one end to the other end. The technology that enables transmitting 1

Path multicoloring with fewer colors in spiders and caterpillars

  • Upload
    sjsu

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Path Multicoloring with Fewer Colorsin Spiders and Caterpillars

Aris Pagourtzis Katerina Potika Stathis Zachos

Department of Computer ScienceSchool of Electrical and Computer Engineering

National Technical University of Athensemail:{pagour,epotik,zachos}@cs.ntua.gr

Abstract

We study a recently introduced path coloring problem with appli-cations to wavelength assignment in all-optical networks with multiplefibers. In contrast to classical path coloring, it is, in this setting, pos-sible to assign a color more than once to paths that pass through thesame edge; the number of allowed repetitions per edge is given andthe goal is to minimize the number of colors used.

We present algorithms and hardness results for tree topologies ofspecial interest. Our algorithms achieve approximation ratio of 2 inspiders and 3 in caterpillars, whereas the best algorithm for trees sofar, achieves an approximation ratio of 4. We also study the directedversion of the problem and show that it admits a 3-approximationalgorithm in caterpillars, while it can be solved exactly in spiders.AMS Subject Classifications: 68U05,68R10, 05C05, 05C15, 90B18,05C85, 90C59, 94C15.keywords: path coloring, multifiber all-optical networks, approxima-tion algorithms, spiders, caterpillars.

1 Introduction

Optical fibers play an important role in modern communication systems,such as the Internet and other data transferring networks, since they offer alarge bandwidth, small delays and low bit-error rates. A network is calledall-optical, if signals remain in optical form (no conversion to electrical form)from one end to the other end. The technology that enables transmitting

1

more than one signal along a single optical fiber is called Wavelength DivisionMultiplexing (WDM); it allows many signals to be transferred through thesame fiber, each at a very high rate, by assigning a different wavelength toeach signal.

A connection request is represented by a pair of nodes. A request can besatisfied by a path connecting these nodes (routing) and a wavelength (color)assignment along that path (coloring). If intermediate optical-to-electrical(and vice versa) signal conversion is allowed then, of course, the restriction toa single wavelength on every link of the path is waived, but such conversionsdecrease the performance of the network. On the other hand, all-opticalconverters are too expensive. It is therefore desirable that a signal remainson the same wavelength from one end to the other.

Recently, several researchers have focused on the study of problems re-lated to routing and wavelength assignment in multifiber WDM all-opticalnetworks [13, 14, 18, 21, 8, 9, 16, 1, 2]. In this approach, several signals pass-ing through a link may use the same wavelength provided that they traversedifferent parallel fibers. Multifiber WDM all-optical networks provide at eachnode switching capabilities (using optical crossconnnects). Thus signals thatare on the same fiber of an incoming link may continue on different fibers ofan outgoing link, whereas signals that are on different fibers may continueon the same fiber (if, of course, they are on different wavelengths).

We study an optimization problem, called Path Multicoloring withMinimum Number of Colors (Min-Colors-PMC). This problem, de-fined in [8] and [4] (a simpler version was earlier defined in [13, 14]), describesthe situation in which the number of available fibers per edge is given and theobjective is to minimize the number of colors needed to satisfy all requests,under suitable color assignment.

Clearly, the objective of Min-Colors-PMC does not take into accountthe fact that, in practical settings, the number of wavelengths per fiber isfixed. However, studying the minimization problem is a common abstractionthat provides insight to the difficulty of more realistic problems. Besides,solving Min-Colors-PMC can be particularly useful in a network designphase where several demand scenarios are given and one would like to com-pute the minimum number of wavelengths that would suffice to serve allrequests under these scenarios.

It should also be noted that Min-Colors-PMC is a multicommodityflow problem with interesting applications in communication networks ofany type. For example, if µ(e) represents the available bandwidth on anedge e, then requests colored with the same color are those that can besimultaneously served under the given bandwidth limitations. In this setting,solving Min-Colors-PMC corresponds to minimizing the number of time

2

slots needed to satisfy all requests.Two versions of Min-Colors-PMC have been studied with respect to

request routing: (a) only the endpoints of requests are given and both routingand coloring have to be specified for each request (in such a case the word‘Routing’ is often added to the problem name) (b) a routing path for eachrequest is given in advance and only a coloring of these paths has to bespecified. In this work we focus on tree topologies, which implies that for eachrequest there is a unique simple path connecting its endpoints. Therefore,we restrict our study to the second version.

We use the following notation:

• The network can be described by a graph G = (V, E) and a functionon the edges µ : E → N, which defines the multiplicity of each edge(the number of allowed repetitions of any color in an edge). A multisetof communication paths P is also given.

• A path multicoloring is called valid for (G,µ,P) or simply valid, if:

1. a color is assigned to each path in P ,

2. for each edge e, any color is assigned to at most µ(e) paths thatpass through e.

Formally, Min-Colors-PMC is defined as follows [8]: Given is a graphG = (V,E), a function µ : E → N and a multiset of paths P; the objectiveis to find a valid path multicoloring for (G,µ,P) with a minimum number ofcolors.

We distinguish between two types of models: undirected and directed.The undirected model corresponds to the case where the communication forevery request is two-way and signals in both directions must use the sameset of links and the same wavelength (full-duplex communication). One-way communication can be modeled by using directed graphs, requests andpaths; the corresponding problem variation has the same name, preceded bythe word “Directed”. Note that in the directed case, a valid multicoloringis obtained when for each directed edge e, any color has been assigned to atmost µ(e) paths that pass through e in the direction e.

In this paper we investigate both undirected and directed versions of Min-Colors-PMC in special tree topologies, namely caterpillars and spiders.

Caterpillars form an important subclass of trees and have several inter-esting properties, for example, a tree is an interval graph if and only if thetree is a caterpillar with unit length legs.

The undirected version of Min-Colors-PMC is clearly NP -hard incaterpillars and spiders since stars are a subclass of spiders (hence also of

3

caterpillars) and the Path Coloring problem (PC), which is alreadyknown to be NP -hard in stars [19], is a special case of Min-Colors-PMC.

In this work we present a 3-approximation algorithm for Min-Colors-PMC in caterpillars (Section 2) and two approximation algorithms for Min-Colors-PMC in spiders, both achieve a 2 approximation factor (Section 3).In Section 4 we show that Directed MinColors-PMC is NP -hard incaterpillars. Finally, we explain (Section 5) how to modify the algorithmsfor the undirected case so as to obtain a 3-approximation algorithm for Di-rected Min-Colors-PMC in caterpillars and an exact algorithm for thesame problem in spiders.

Our algorithms make use of path grouping techniques specially designedin order to exploit structural properties of spiders and caterpillars. Simi-lar in spirit path grouping techniques have been used in [18, 4] to developalgorithms for chains, stars and arbitrary trees.

1.1 Related Work

For Min-Colors-PMC in trees, a 4-approximation algorithm, both for theundirected and the directed case, was given by Chekuri, Mydlarz and Shep-herd in [4]. Note that their algorithm does not achieve a ratio better than 4when applied to caterpillars or spiders; the main reason is that they employ atechnique for converting each request to a ‘leaf-to-leaf’ request, which spoilsthe special structure of caterpillars and spiders.

Algorithms for Min-Colors-PMC in chains, rings, stars and spidersare presented in [16]: The algorithm for chains gives optimal solutions. Thealgorithm for rings achieves an approximation ratio of 2; an algorithm is alsopresented for the version of Min-Colors-PMC in rings where the routingis not given in advance, also achieving an approximation ratio of 2. The al-gorithms for Min-Colors-PMC in stars and spiders achieve approximationratios 3/2 and 5/2 respectively; the directed version is solved exactly in starsand within a ratio of 2 in spiders.

A version of Min-Colors-PMC in which all edges of the graph have thesame multiplicity µ was studied in [13, 14] for stars and rings, and approxima-tion algorithms with small constant ratios were proposed. This version wasalso studied by Li and Simha [12] for trees; they observed that a valid mul-ticoloring using at most d3L/(2µ)e colors (L denotes the maximum numberof paths passing through an edge of the graph) can be computed efficientlyusing an algorithm for the single-fiber problem, known as Path Coloring(PC), due to Raghavan and Upfal [19].

The currently best algorithm for PC (undirected version) in trees achievesan asymptotic approximation ratio of 1.1. This relies on the algorithm of

4

Nishizeki and Kashiwagi [15] for Edge Coloring of multigraphs since approx-imation algorithms for PC in trees and Edge Coloring in multigraphs areinterchangeable [10, 6]. For the directed case of PC in trees, the currentlybest algorithm, due to Erlebach et al. [7], achieves an approximation ratio of5/3 (using at most 5L/3 colors).

Other related work in the multifiber model includes a problem, calledPath Multicoloring with Minimum Number of Collisions (Min-Collisions-PMC), where the number of wavelengths is given and the goalis to minimize the number/cost of active fibers (by determining appropriateedge multiplicities) [18, 21, 16, 8, 17, 2, 3] and a problem, called MaximumPath Multicoloring, where the goal is to maximize the number of satis-fied requests once the edge multiplicities and the number of wavelengths aregiven [8, 3].

In [2] it is shown that for general topologies Min-Collisions-PMCwhere the routing is not given in advance is hard to approximate. In particu-lar, there is no O(log1−ε |E|) approximation algorithm, where E is the set oflinks, for any ε > 0 unless NP ⊆ ZPTIME(npolylogn). Various approxima-tion hardness results are given in [3] for Min-Collisions-PMC, MaximumPath Coloring and for another problem called Min-MaxFiber (minimizethe maximum number of fibers deployed on any link).

In [1], a very similar problem to Min-Collisions-PMC has been exam-ined where the goal is to minimize the maximum ratio between the numberof active fibers on an edge and the corresponding lower bound. They showthat, in general topologies, no constant approximation ratio is possible unlessNP ⊆ ZPP and logarithmic factor approximation algorithms are presented.

In [9] they study both Min-Colors-PMC and Min-Collisions-PMCunder the uniform edge multiplicity model. They develop an approach forgeneral network topologies which is based on conflict hypergraphs.

1.2 Notation

Given a path p in a graph, we say that p touches a node v, if v is an endpointor an internal node of p. We use L(e,P) to denote the load of an edge ew.r.t. P , that is the number of paths in P that pass through e.

For a routing P , a lower bound for the number of colors needed to color allpaths so that a valid path multicoloring is obtained, is wlb = maxe∈EdL(e,P)

µ(e)e,

since any color can be repeated at most µ(e) times in paths that pass throughe. Note that in the directed version wlb is computed over all directed edges.

For a set of paths P and an edge e, we will use P(e) to denote thesubset of P consisting of all paths in P that pass through edge e. Note thatL(e,P) = |P(e)|.

5

We review definitions of topologies that we will use in this paper:

• A tree is a connected acyclic graph. Nodes of degree 1 are called leavesand nodes of degree > 1 are called internal nodes.

• A chain is a tree with internal nodes of degree 2 and exactly two leaves.

• A star is a tree with at most one internal node (called the center)(example: Figure 1.a).

• A spider is a tree with at most one internal node of degree > 2 (calledthe center) and possibly many internal nodes of degree 2 and leaves(example: Figure 1.b). It can be also viewed as a star the edges ofwhich have been replaced by chains; these chains are called legs of thespider and the leaf of a leg is called tip. For this reason, spiders arealso known as generalized stars or suns.

• A caterpillar is a tree with the property that all nodes of degree > 2 lieon a chain (called the backbone or spine) (example: Figures 1.c and 1.d).Note that the backbone of a caterpillar is not uniquely defined; here wewill consider as backbone a longest chain containing all nodes of degree> 2. Apart from the backbone a caterpillar may contain possibly manyinternal nodes of degree 2 and leaves.

Let G = (V,E) be a caterpillar; the set of nodes V is partitioned intotwo sets of nodes Vb = {v1, . . . , vn′} (set of backbone nodes) and Vl = V \Vb

(set of leg nodes), and the set of edges E is also partitioned into two setsEb = {{v1, v2}, . . . , {vn′−1, vn′}} (set of backbone edges) and El = E\Eb (setof leg edges).

Note that the backbone of G is the chain Gb = (Vb, Eb). Similarly tospiders, a leg is a chain from a leaf in Vl (tip of the leg) to the closest backbonenode (leg base).

We consider the caterpillar G as rooted at the “last” backbone node vn′ ;we will call this node r. We define par(v) to be the parent node of node vin the rooted tree. For each node v 6= r, ev denotes the edge {v, par(v)}. Allnodes that are adjacent to v except par(v) are called children of v.

For the purposes of our problem, we may assume that all edges are usedby at least one path in P ; otherwise, if unused edges exist we can removethem and solve the problem in each connected component separately.

Finally, an algorithm A for a minimization problem is a ρ-approximationalgorithm (for ρ > 1) if for every instance I of the problem, A runs in time

6

(a)

1v2 v6

v4

v5v3

v

(b)

1

v8

v2v3v4v5 v13

v7

v11

v9

v10

v12

v6

v

(c)

1 v2 v3 v4 v5v6 v7

v8 v9 v11

v12v10

v13

v15

v14v18

v16 v17

v

(d)

1 v2 v3 v4 v5v6 v7

v11 v12 v13v14v10

v9

v8

v

Figure 1: Examples of: (a) a star, (b) a spider (generalized star), (c) a caterpillarand (d) a caterpillar with unit length legs.

polynomial in |I| and delivers a solution with value SOL(I) ≤ ρ · OPT (I),where OPT (I) denotes the value of an optimal solution for I.

2 Color Minimization in Caterpillars

In the following subsections we present approximation algorithms for Min-Colors-PMC in caterpillars. We first describe a 3-approximation algorithmfor the special case of caterpillars with unit length legs (legs consisting of onlyone edge); such a caterpillar is shown in Figure 1.d. This algorithm is thebasis for the 3-approximation algorithm for arbitrary caterpillars (Figure 1.c);appropriate modifications are presented in Section 2.2.

We now define a useful partition of paths on a caterpillar. A set of pathsP on a caterpillar is partitioned into two subsets: the first subset, denoted byPb (backbone paths), consists of all paths that pass through a backbone edgeor contain a backbone node as an internal node; the second subset, denotedby Pl (leg paths), consists of the remaining paths.

Note that for each edge e in Eb all paths in P that pass through e belongto Pb, hence L(e,P) = L(e,Pb), while for each edge e′ in El all paths inP that pass through e′ may belong either to Pb or to Pl, hence L(e′,P) =

7

L(e′,Pb) + L(e′,Pl).

2.1 An algorithm for caterpillars with unit length legs

In this case all paths in Pl are of unit length. The algorithm consists of twophases.

In the first phase we partition all paths in Pb passing through an edgee into at most µ(e) groups, containing no more than 2wlb paths each. Eachpath p in Pb is placed in exactly one group at each traversed edge e.

In the second phase we greedily assign colors to all paths in P , so thatpaths that belong to the same group receive different colors.

The description of the algorithm follows.

Algorithm for Min-Colors-PMC in caterpillars with unit length legs

(* Phase 1 - Path grouping*)

1. for every leaf node v 6= r do

Partition paths in Pb(ev) into groups as follows:

repeat

select and group wlb paths together

until all paths are grouped. (*Example: Figure 2(a).*)

2. for each backbone node v := v2 to vn′−1 do

i. Let u1, u2, . . . , uc denote the children of v. The already formedgroups at eu1 , eu2 , . . . , euc imply a partial grouping of paths inPb(ev). Follow the same grouping to form groups at ev.

ii. Place ungrouped paths of Pb(ev) into new groups with wlb pathseach. (*Example: Figure 2(b).*)

iii. repeat

merge two groups that contain fewer than wlb paths eachinto a new group

until at most one group with fewer than wlb paths exist.

(*Example: Figure 2(c).*)

(* Phase 2 - Path multicoloring*)

8

3. Consider edge evn′−1= {vn′−1, r}. Assign different colors from the set

{1, . . . , 2wlb} to the paths in each group at evn′−1.

4. for each backbone node v := vn′−1 downto v2 do

i. a. Consider the children u1, u2, . . . , uc of v. Let T (v) be the subsetof all uncolored paths in Pb that touch node v (they touch oneor two of the children u1, u2, . . . , uc and do not touch par(v)).

b. for each path p in T (v) that touches two children ui and uj do

assign to p a color from {1, . . . , 3wlb} that is different from allcolors that were already assigned to paths that belong to thesame group with p at eui

and paths that belong to the samegroup with p at euj

.

c. Consider all remaining uncolored paths in T (v), i.e. those thathave v as endpoint and touch node ui, where ui is the backbonechild of v. Color these paths according to their grouping at eui

,in an arbitrary manner, using colors from {1, . . . , 2wlb} for eachgroup.

ii. for each path p in Pl that has v as an endpoint do

Let eu = {u, v} be the unique edge of p.if there is a group at eu with fewer than wlb paths then

add p to this group and color it with some color from {1, . . . , wlb}that has not been used for any path that belongs to this group

else

create a new group, add p to this group and color p with color 1.

In order to show correctness of the above algorithm we will first provesome lemmata.

Lemma 1 For each edge e: dL(e,P)/wlbe ≤ µ(e).

Proof: From the definition of wlb, for each edge e it holds:

wlb ≥ L(e,P)

µ(e)⇒ µ(e) ≥ L(e,P)

wlb

⇒ µ(e) ≥ dL(e,P)

wlb

e

since µ(e) is an integer. tu

Lemma 2 Consider a set of paths P∗ ⊆ P. If the set of paths P∗(e) ispartitioned into groups so that all but one group contain at least wlb paths,then the number of these groups is at most µ(e).

9

3

3

2

(a)

1

2 3i

u4

u3

u2

u1 vi+1(=v ) i−1

3

2

(b)

1

2v

(c)

i

u4

u3

u2

u1 vi+1(=v ) i−1

3

21

2 3v

Figure 2: An example, with wlb = 3, of how paths in a caterpillar are grouped: (a)groups at leg edges formed in Step 1, (b) groups at edge evi−1 (continuous ellipses),formed in the (i−2)-th iteration of Step 2, and groups at edge evi (dotted ellipses),formed in the (i − 1)-th iteration of Step 2i and Step 2ii and (c) groups at edgeevi formed in the (i − 1)-th iteration of Step 2iii. Numbers on edges representmultiplicities.

Proof: Let k be the number of groups at e. Since all groups (except possiblyone) contain at least wlb paths:

(k − 1)wlb < L(e,P∗) ⇒ (k − 1) <L(e,P∗)

wlb

k ≤ dL(e,P∗)wlb

e ≤ dL(e,P)

wlb

e

Combining with Lemma 1: k ≤ µ(e). tu

Lemma 3 The algorithm for Min-Colors-PMC in caterpillars with unitlength legs assigns different colors to all paths that are in the same group atsome edge. The total number of colors used is at most 3wlb.

10

Proof: We will prove by induction that the claim is true for all groups ateach edge of the caterpillar. Clearly, the claim holds for edge evn′−1

(in fact2wlb colors suffice for this edge). We now prove that if the claim holds forgroups at ev, where v is a backbone node which is not a leaf, then it alsoholds for groups at eu1 , . . . , euc , where u1, . . . , uc are the children of v.

Consider any backbone node v which is not a leaf. All children of v butone are leaves. Observe that the multicoloring obtained after coloring groupsat ev respects the claim for edges eu1 , . . . , euc , because the construction ofgroups implies that paths that are in the same group at eui

and pass throughev are also in the same group at ev and have thus received different colors.

We will now show that the claim still holds after coloring the remainingpaths. Consider a path p in T (v), touching ui and uj. If one of ui, uj is abackbone node we may assume w.l.o.g. that this is node ui. Therefore, thereare at most 2wlb− 1 other paths in the same group with p at eui

and at mostwlb − 1 other paths in the same group with p at euj

. Hence, it is alwayspossible for the algorithm to find a color in {1, . . . , 3wlb} that is differentfrom all colors that were already assigned to paths that belong to the samegroup with p at eui

and to paths that belong to the same group with p ateuj

(in the worst case each of the 3wlb − 2 already colored paths may havea different color). Note that if both ui and uj are leaves, even 2wlb colorssuffice.

Consider now a path p in T (v) that has v as endpoint and touches thebackbone child of v, say ui. Path p belongs to some group at eui

, whichcontains at most 2wlb−1 other paths. Therefore, there is always an availablecolor for p in {1, . . . , 2wlb}.

Finally, consider a path p in Pl. Such a path belongs to a group withat most wlb − 1 other paths; hence it is always possible to find a color in{1, . . . , wlb} that is not used for any path belonging to this group. tu

Theorem 1 The Algorithm for Min-Colors-PMC in caterpillars with unitlength legs is a 3-approximation algorithm.

Proof: Paths are colored in a greedy manner, therefore each path is assigneda unique color. Moreover, by the construction of groups (Step 1, 2 and 4.ii)it can be seen that all but one groups at each edge contain at least wlb paths.Therefore, Lemma 2 applies. Together with Lemma 3 it is clear that eachcolor is repeated at most µ(e) times at each edge e, hence no edge multiplicityis violated.

Thus, the algorithm computes a valid path multicoloring using no morethan 3wlb colors. Since no valid multicoloring can use less than wlb colors theapproximation ratio follows.

11

We now show that the algorithm needs polynomial time. In a prepro-cessing step we need to determine which paths pass through each edge of thecaterpillar. This can be done in O(mn) time, where m = |P| and n = |V |.During Step 1 each path in Pb is examined at most 2 times because it passesthrough 0, 1 or 2 edges incident to a leaf; hence, Step 1 needs O(m+n) time.

In Step 2, for each backbone node v we form groups at edge ev followingthe grouping at the children of node v. We then sort paths according totheir current group number in O(m) time, using bucket sort. Group mergingcan also be done in O(m) time, since there are at most m paths and O(m)groups. Step 3 also needs O(m) time and Step 4 needs O(mwlb) time.

Thus, the total time complexity is O(m(n + wlb)). In addition wlb =O(m) and n = O(m), because otherwise there are nodes that are not pathendpoints; it can be shown that such nodes can be eliminated. Therefore,another upper bound for the time complexity is O(m2). tu

2.2 An algorithm for caterpillars (general case)

We now present an algorithm for the general case of a caterpillar. In thiscase instead of unit length legs we have to deal with legs of arbitrary lengthand paths in Pl may contain more than one edge. It turns out that we onlyneed to modify Steps 1 and 4.ii of the algorithm for caterpillars with unitlength legs.

Our algorithm uses as a subroutine an algorithm for the Path Mul-ticoloring with Minimum Number of Collisions problem (Min-Collisions-PMC) in chains [18]. In this problem a set of paths P on achain is given and a number of colors w; the goal is to find an assignmentof multiplicities to edges so that the sum of multiplicities over all edges isminimum and a valid path multicoloring with w colors is possible. In [18] itis shown that it is possible to assign to each edge e an optimal multiplicity ofdL(e,P)/we; to this end they present an algorithm that finds a multicoloringsuch that on each edge e any color is repeated at most dL(e,P)/we times.

Algorithm for Min-Colors-PMC in caterpillars

(* Phase 1 - Path grouping*)

1. for every leaf node v 6= r do

i. Consider the leg which has v as tip (for this step we consider thebackbone edge ev1 as a leg too) and let S be the set of paths inPb that pass through an edge of this leg. Starting from the tip v,

12

repeatedly select and group wlb paths in S that touch v to formgroups at ev.

ii. Continue to the parent of v and copy the groups at ev to epar(v)

(note that all grouped paths touch par(v) too); fill the group thatcontains less than wlb paths (if such a group exists) with paths inS that touch par(v) but not v.

iii. Partition the remaining ungrouped paths in S that touch par(v) (ifany) into groups containing wlb paths each (again one group maycontain < wlb paths).

iv. Continue in the same manner to par(par(v)) and so on.

(*Example: Figure 3.a.*)

2. Form groups at backbone edges exactly as in Step 2 of the algorithmof Section 2.1. (*Example: Figure 3.b*)

(* Phase 2 - Path multicoloring*)

3. Color paths at edge evn′−1= {vn′−1, r} exactly as in Step 3 of the

algorithm of Section 2.1.

4. for each backbone node v := vn′−1 downto v2 do

i. Color uncolored paths in Pb that touch node v (these paths touchone or two children of v and do not touch par(v)) exactly as inStep 4.i of the algorithm of Section 2.1.

ii. for each leg with leg base v do

a. Let u be the leg node adjacent to v and g(eu) be the group ofpaths at edge eu that contains the longest, w.r.t. this leg, paths.

b. Pick wlb colors from {1, . . . , 2wlb} that are not used in g(eu).Use these colors to color paths in Pl that pass through this legby applying the algorithm for problem Path Multicoloringwith Minimum Number of Collisions in chains [18].

We will now show a lemma analogous to Lemma 3.

Lemma 4 The Algorithm for Min-Colors-PMC in caterpillars assignsdifferent colors to all paths in Pb that are in the same group at some edge.The total number of colors used is at most 3wlb.

13

1

3

21

2 3

(a)

2

1

iv i+1

v i−1

3

21

2 3

(b)

2

v

Figure 3: An example, with wlb = 3, of how paths in a caterpillar are grouped: (a)groups at leg edges formed in Step 1 (b) groups at edge evi−1 (dotted ellipses) andat edge evi (continuous ellipses) formed in Step 2. Numbers on edges representmultiplicities.

Proof: Following exactly the same arguments as those used in the proof ofLemma 3, we can show that the claim is true for all groups at backbone edgesand for all groups of paths in Pb at leg edges incident to backbone nodes.Due to the construction of groups described in Step 1 each group of paths inPb at any edge of a leg is a subset of a group at the leg edge which is incidentto the leg base. Therefore the claim holds for these groups too. tu

Theorem 2 The Algorithm for Min-Colors-PMC in caterpillars is a 3-approximation algorithm.

Proof: As in the proof of Theorem 1, it is easy to see that all but one groupsat each backbone edge contain at least wlb paths. Therefore, Lemma 2 appliesand together with Lemma 3 implies that the multicoloring is valid for thebackbone edges.

14

By the construction of groups of paths in Pb that pass through leg edges(Step 1) it can be seen that at every leg edge all but one groups containexactly wlb paths. Therefore, at each leg edge e, the number of groups ofpaths in Pb is at most dL(e,Pb)

wlbe. Combining with Lemma 4 it turns out that

each color used only for paths in Pb is repeated at most dL(e,Pb)wlb

e times on

edge e; by Lemma 1 and the fact that Pb ⊆ P this is at most µ(e).We will now show that each color used for a path in Pl is also repeated

at most µ(e) times on any edge e. Consider a leg with leg base v and let ube the leg node adjacent to v. Group g(eu) contains the longest, w.r.t. thisleg, paths in Pb(eu). Therefore, by the construction of groups, there is onegroup of paths that is subset of g(eu) at each leg edge that is traversed bypaths in Pb. Since colors that are used for paths in Pl that traverse this legare not used for g(eu) the following holds: at each leg edge e that is traversedby paths in Pb there is one group of paths that have no common color withpaths in Pl(e).

Thus, each of these colors is used at most dL(e,Pb)wlb

e − 1 times for paths in

Pb(e). On the other hand the algorithm for Path Multicoloring withMinimum Number of Collisions in chains guarantees that each color isused at most dL(e,Pl)

wlbe times for paths in Pl. Adding together, and combining

with Lemma 1, we have that the total number of repetitions of a such a coloron leg edge e is at most

(dL(e,Pb)

wlb

e − 1) + dL(e,Pl)

wlb

e ≤

dL(e,Pb) + L(e,Pl)

wlb

e = dL(e,P)

wlb

e ≤ µ(e) (1)

Therefore the obtained multicoloring is valid. In addition, the colors usedfor paths in Pl are always selected from a subset of {1, . . . , 3wlb}, thus 3wlb

colors suffice. Since no valid multicoloring can use less than wlb colors theapproximation ratio is 3.

Similar to Theorem 1 the time complexity for all steps, except the al-gorithm for Min-Collisions-PMC, is O(m(n + wlb)). The algorithm forMin-Collisions-PMC needs O((m′+nwlb) log(m′+nwlb)) time [18], wherem′ = |Pl|. Since m′ ≤ m and n = O(m), it can be seen by simple operationsthat an upper bound for the total time complexity is O(m(n+wlb log m)). tu

15

3 Color Minimization in Spiders

We now focus on the case where our network is a spider (generalized star).A spider can be seen as a special case of a caterpillar with only one nodev of degree > 2 (center of the spider). We will show how the algorithm ofSection 2.2 for caterpillars can be fine-tuned in order to achieve a betterapproximation ratio, namely 2, for spiders.

We partition a set of paths P into two subsets: the first, denoted by Pv,consists of all paths that contain node v as an internal node and the secondsubset, denoted by Pl, consists of the remaining paths.

The algorithm first finds a valid multicoloring for the set of paths Pv

using at most 2wlb colors and then reuses a number of wlb of these colors inorder to color paths in Pl. A brief description follows.

Algorithm 1 for Min-Colors-PMC in spiders

1. for each leg do

Starting from the tip, say u, and moving toward the center of thespider construct groups of paths in Pv containing exactly wlb pathseach, and possibly one group with fewer than wlb paths exactly asdescribed in Step 1 of Section 2.2.

2. for each path p in Pv do

Let ui, uj be the two leg nodes, that are incident to the center of thespider and are touched by p. Path p belongs to one group at eui

and toone group at euj

. Color p with a color in {1, . . . , 2wlb} that is differentfrom all colors already assigned to paths in these groups.

3. for each leg do

Color all paths in Pl that lie on this leg using the algorithm forPath Multicoloring with Minimum Number of Collisionsin chains [18], by employing wlb colors from {1, . . . , 2wlb} that are notused in group g(eu), where u is the node of this leg which is adjacentto the center of the spider and g(eu) is the group at eu that containsthe longest w.r.t. this leg paths.

Theorem 3 Algorithm 1 for Min-Colors-PMC in spiders (generalizedstars) is a 2-approximation algorithm.

16

Proof: Using similar arguments as in the proof of Theorem 2 it can be seenthat the obtained multicoloring is valid. Moreover, 2wlb colors suffice becauseeach group of paths in Pv contains at most wlb paths; therefore, at the timea path p in Pv is colored (Step 2) there are at most wlb − 1 colored paths ineach of the two groups considered. Since no valid multicoloring can use lessthan wlb colors the approximation ratio follows.

It can be also shown that the time complexity is the same as that of thealgorithm of Section 2.2, i.e. O(m(n + wlb log m)). tu

We present a second algorithm for Min-Colors-PMC in spiders, bymodifying Algorithm 1. This new algorithm achieves a better approximationratio in instances where all paths pass through the center, at the cost of anadditional call to an edge coloring algorithm. Note that this algorithm canalso be derived by appropriate fine-tuning of the 5/2-approximation algo-rithm presented in [16].

Algorithm 2 for Min-Colors-PMC in spiders

1. Form groups at leg edges as in Step 1 of Algorithm 1 for Min-Colors-PMC in spiders.

2. Let S be the set of all groups of paths at edges incident to the center;each path in Pv belongs to exactly two such groups.

i. Construct a multigraph H = (S, A), where A contains an edge foreach path p in Pv, connecting the groups in which p belongs to.

ii. Obtain an edge-coloring of H with b3wlb/2c colors by using algo-rithm in [20] for edge coloring a multigraph.

iii. Assign to each path in Pv the color of the corresponding edge in H.

3. for each leg do

Color all paths in Pl that lie on this leg using the algorithm forPath Multicoloring with Minimum Number of Collisionsin chains [18], by employing bwlb

2c colors from {1, . . . , b3wlb

2c} that are

not used in group g(eu) and dwlb

2e new colors. (Recall that u is the

node of this leg which is adjacent to the center of the spider and thatg(eu) is the group at eu that contains the longest w.r.t. this leg paths.)

Theorem 4 Algorithm 2 for Min-Colors-PMC in spiders is a 2-approximationalgorithm. For instances in which all paths pass through the center it achievesa (3/2)-approximation ratio.

17

Proof: Using similar arguments as in the proof of Theorem 2 it can be seenthat the obtained multicoloring is valid. Moreover, b3wlb/2c colors sufficeto color instances in which all paths belong to Pv, and 2wlb colors suffice tocolor any instance. Since no valid multicoloring can use less than wlb colorsthe approximation ratios follow.

The time complexity is that of Algorithm 1, i.e. O(m(n + wlb log m)), in-creased by the cost of Vizing’s algorithm for edge coloring, which is O(|S||A|) =

O( |Pv |wlb|Pv|) = O(m2

wlb), giving a total time complexity of O(m(n + wlb log m +

mwlb

)) . tu

4 Hardness of Directed Min-Colors-PMC in

Caterpillars

In this section we prove that Directed Min-Colors-PMC remains NP -hard in caterpillars.

Theorem 5 Directed Min-Colors-PMC in caterpillars is NP -hard.

Proof: We will reduce from the problem of edge coloring a 3-regular graph,which is known to be NP -complete [11]. We will describe how to to con-struct an instance of Directed Min-Colors-PMC in caterpillars (G′ =(V ′, E ′),P , µ) from a 3-regular graph G = (V,E), so that paths in P can bemulticolored with exactly three colors if and only if G can be edge coloredwith three colors.

Lets us first give the main idea of the construction. Each node vi of Gcorresponds to a backbone edge e′i = (v′i−1, v

′i) of the caterpillar G′. Each

edge (vi, vj) of G corresponds to two ‘sibling paths’ pij, pji in P . Path pij

passes through edge (v′i−1, v′i) and path pji passes through edge (v′j−1, v

′j). We

make use of blocker paths (as in [6]) in order to guarantee that sibling pathspij and pji receive the same color in any multicoloring of P with three colors.Edges that are incident to the same node of G correspond to paths that passthrough the same edge of G′. Details of the construction of sets V ′, E ′, Pand of function µ : E → N follow. Let n = |V |.

• V ′ = {v′i | 0 ≤ j ≤ n} ∪ {uij | {vi, vj} ∈ E, i < j}∪ {uji | {vi, vj} ∈ E, i < j}

• E ′ = E ′1 ∪ E ′

2 ∪ E ′3

E ′1 = {(v′i, v′i+1) | 0 ≤ i < n}: left-to-right backbone edges

E ′2 = {(v′i+1, v

′i) | 0 ≤ i < n}: right-to-left backbone edges

18

G

’Gp 21

u12

p

21p

12p v’

2v’1 3

v’v’0

v

1 2

4

v 1

v 3

v 2

13u

14u 24

u31

u

32u

41u 42u

34u

v’4

23u

12u 43

u12

Figure 4: Reduction of edge coloring a 3-regular graph to Directed Min-Colors-PMC in caterpillars. Each edge {i, j}, i < j, of the original graph ismapped to paths pij , pji (shown by continuous lines) and blocker paths p1

ji and p2ij

(shown by dotted lines).

E ′3 = {(v′i, uij) | uij ∈ V ′, i < j}∪

{(uji, v′j−1) | uij ∈ V ′, i < j}: leg edges

• µ(e) = 1, ∀e ∈ E ′1 ∪ E ′

3

µ(e) = |E|,∀e ∈ E ′2

• P = P1 ∪ P2 ∪ P3, recall that P is a multisetP1 = {pij = 〈v′i−1, uij〉 | {vi, vj} ∈ E, i < j} ∪

{pji = 〈uji, v′j〉 | {vi, vj} ∈ E, i < j}

P2 = {p1ij = 〈uji, uij〉 | {vi, vj} ∈ E, i < j}

P3 = {p2ij = 〈uji, uij〉 | {vi, vj} ∈ E, i < j}

Clearly, the construction of instance (G′ = (V ′, E ′),P , µ) can be done inpolynomial time.

An example of a 3-regular graph and the resulting instance of the Di-rected Min-Colors-PMC in caterpillars is shown in Figure 4.

Let us now show the correctness of the reduction. Suppose first thatgraph G can be edge colored with exactly three colors. Then for each edge

19

e = {vi, vj} ∈ E (assuming i < j) we assign to paths pij and pji the color ofe. Each one of the two blocker paths p1

ij and p2ij receives one of the remaining

two colors arbitrarily. We will show that for each edge, the multiplicity isnot violated. This is true since

• there are exactly three paths passing through each edge e ∈ E ′1 ∪ E ′

3,which receive different colors, hence the multiplicity of each color on eis 1, and

• there are at most 2|E| paths passing through each edge e ∈ E ′2; these

paths can be partitioned into pairs of blocker paths which receive dif-ferent colors, hence the multiplicity of each color on e is at most |E|.

Therefore, this is a valid path multicoloring of P with 3 colors.Conversely, suppose that there is a valid path multicoloring of P with 3

colors. Since the edge multiplicity of edges in E ′3 is 1, the use of blocker paths

guarantees that in such a multicoloring paths pij and pji will receive the samecolor. Therefore, we can assign to each edge {vi, vj} ∈ E the common colorof paths pij and pji.

The three edges of G that are incident to the same vertex vi ∈ V arecolored with three different colors, because the corresponding paths passthrough edge e′i = (v′i−1, v

′i), which has color multiplicity 1. tu

Since instances of Min-Colors-PMC constructed by the above reduc-tion can be colored with either 3 or 4 colors, it turns out that:

Corollary 5 Directed Min-Colors-PMC in caterpillars cannot be ap-proximated within 4

3− ε for any ε > 0, unless P = NP .

5 Directed Min-Colors-PMC

In the directed version of Min-Colors-PMC we assume that between anytwo nodes vi, vj there may be two different opposite-directed edges (vi, vj)and (vj, vi), possibly of different multiplicities.

For Directed Min-Colors-PMC in caterpillars we use the algorithmfor the undirected version (see Section 2) with the following modifications:

a. The phase of path grouping is executed for each directed edge separately.Therefore, all paths that belong to the same group of a directed edge havethe same direction on this edge.

b. For paths in Pl (paths lying on a leg) the chain algorithm is executedindependently in each direction of every leg.

20

It can be easily seen that the same properties as in the undirected casehold, namely that in each directed edge e there exist at most µ(e) groups andthat all paths in a group receive different colors. Thus, a valid multicoloringwith 3wlb colors is obtained. Therefore the following is true.

Corollary 6 There is a 3-approximation algorithm for Directed Min-Colors-PMC in caterpillars.

In contrast, we next show that Directed Min-Colors-PMC can besolved exactly in spiders. We will do that by showing that it is always possibleto color all paths with wlb colors, respecting edge multiplicities.

Let us first observe that we can color all paths that touch the centerwith only wlb colors by reducing to Multigraph Edge Coloring, sim-ilar to Algorithm 2 for the undirected version (Section 3). The reason isthat the constructed multigraph is now bipartite of degree wlb, thereforeedge-colorable with wlb colors. However, this does not suffice to obtain amulticoloring of all paths with wlb colors, since up to wlb new colors may beneeded to color paths in Pl if we want to avoid multiplicity violation. Weovercome this problem by employing techniques from the algorithm for PathMulticoloring with Minimum Number of Collisions in chains [18].This makes it possible to reduce the whole instance to Bipartite Multi-graph Edge Coloring, resulting to a solution with wlb colors in total. Abrief description is given below.

Algorithm for Directed Min-Colors-PMC in spiders

1. i. Add dummy paths of unit length to P so that in each directed edgethe load becomes a multiple of wlb. Let P ′ denote the resulting setof paths.

ii. At each node v which is neither a leaf nor the center join as manyas possible paths starting and ending at v in the same direction.

iii. Form beginning groups of wlb paths at each node where paths beginand ending groups of wlb paths at each node where paths end. Eachgroup must consist of paths that have the same direction (share atleast one directed edge).

2. i. Construct a bipartite multigraph H = (Sb∪Se, A), where Sb (resp.Se) contains a vertex for each beginning (resp. ending) group andwhere A contains an edge for each path p in P ′, connecting thebeginning and the ending group of p.

21

ii. Obtain an edge-coloring of H with wlb colors by using the algorithmfrom [5] for edge coloring a bipartite multigraph.

3. Assign to each path in P ′ the color of the corresponding edge in H andto each path in P the color of the corresponding path in P ′.

Theorem 6 The Algorithm for Directed Min-Colors-PMC in spidersis an exact algorithm.

Proof: It suffices to show that the obtained path multicoloring does notviolate edge multiplicities.

After addition of dummy paths in Step 1i, in each directed edge L(e,P ′)is a multiple of wlb. We will first show that colors are evenly distributedto paths passing through e, that is, each color is used exactly L(e,P ′)/wlb

times for paths in P ′(e). We do this by using an inductive argument, usedin [18] to show correctness of the algorithm for Path Multicoloring withMinimum Number of Collisions in chains. Clearly, it suffices to provethe claim only for an arbitrary leg. We give a proof only for the directiontoward the center (the proof for the reverse direction is similar).

Let the nodes of the leg (not including the center) be denoted as v0, . . . , vk−1,where indices represent the distance from the tip (leaf) of the leg; that is,v0 is the tip, v1 is adjacent to the tip, and so on. Let edge e+

vi= (vi, vi+1),

that is, e+vi

is directed toward the center. The claim holds for edge e+v0

, sinceP ′(e+

v0) is partitioned into exactly L(e+

v0,P ′)/wlb groups of paths beginning

at v, each of which contains wlb paths which correspond to edges with acommon endpoint in multigraph H, and are therefore colored with distinctcolors. At each internal node vi of the leg, either some full (i.e. with wlb

paths) groups start or some full groups end; paths in each of these groupsalso correspond to edges with a common endpoint in multigraph H, and aretherefore colored with exactly wlb colors. Therefore, it is not hard to see thatif the claim holds for edge e+

vi−1then it also holds for edge e+

vi, for 1 ≤ i ≤ k.

Hence, the number of repetitions of any color on any directed edge eis L(e,P′)

wlb= dL(e,P)

wlbe ≤ µ(e) (by Lemma 1). Therefore, this is a valid path

multicoloring with wlb colors, which is optimal. tu

6 Conclusions

We have improved the general approximation ratio (of 4, see [4]) for Min-Colors-PMC in trees for special tree topologies: caterpillars (new ratio: 3)

22

and spiders (new ratio: 2). Since no lower bounds have been proved so far forthese topologies it is worth investigating whether these ratios can be furtherimproved. We have also shown that the directed version of the problem isNP -hard in caterpillars, admitting an approximation ratio of 3 (but not of(4/3)− ε unless P = NP ), while it can be solved exactly in spiders.

Our algorithms make use of path grouping techniques specially designedin order to exploit structural properties of spiders and caterpillars. An inter-esting question is whether such techniques can be used in other topologies,for example trees of rings and meshes.

Acknowledgements

We would like to thank the anonymous referees for their comments and sug-gestions. Special thanks go to one of the referees for suggesting the exactalgorithm for Directed Min-Colors-PMC in spiders.

References

[1] M. Andrews and L. Zhang. Wavelength assignment in optical networkswith fixed fiber capacity. In Proc. Automata, Languages and Program-ming, 31th International Colloquium, ICALP 2004, LNCS 3142, pages134–145, 2004.

[2] M. Andrews and L. Zhang. Bounds on fiber minimization in opticalnetworks with fixed fiber. In INFOCOM, 2005.

[3] M. Andrews and L. Zhang. Complexity of wavelength assignment inoptical network optimization. In INFOCOM, 2006.

[4] C. Chekuri, M. Mydlarz, and F. B. Shepherd. Multicommodity demandflow in a tree. In Proc. Automata, Languages and Programming, 30thInternational Colloquium, ICALP 2003, pages 410–425, 2003.

[5] R. Cole, K. Ost, and S. Schirra. Edge-coloring bipartite multigraphs inO(ElogD) time. Combinatorica, 21(1):5–12, 2001.

[6] T. Erlebach and K. Jansen. The complexity of path coloring and callscheduling. Theoretical Computer Science, 255(1–2):33–50, 2001.

[7] T. Erlebach, K. Jansen, C. Kaklamanis, M. Mihail, and P. Persiano. Op-timal wavelength routing on directed fiber trees. Theoretical ComputerScience, 221:119–137, 1999. Special issue of ICALP’97.

23

[8] T. Erlebach, A. Pagourtzis, K. Potika, and S. Stefanakos. Resource allo-cation problems in multifiber WDM tree networks. In Proc. of the 29thWorkshop on Graph Theoretic Concepts in Computer Science, LNCS2880, pages 218–229, 2003.

[9] A. Ferreira, S. Perennes, A. W. Richa, H. Rivano, and N. S. Moses.Models, complexity and algorithms for the design of multifiber wdmnetworks. Telecommunication Systems, 24(2–4):123–138, 2003.

[10] M. Golumbic and R. Jamison. Edge intersection graphs of paths in atree. J. Combin. Theory B, 38(1):8–22, 1985.

[11] I. Holyer. The NP-completeness of edge coloring. SIAM J. Comput.,10(4):718–720, November 1981.

[12] G. Li and R. Simha. On the wavelength assignment problem in multi-fiber optical tree networks. In Terabit Optical Networking: Architecture,Control, and Management Issues, number 4213 in Proceedings of SPIE,pages 84–91, November 2000.

[13] G. Li and R. Simha. On the wavelength assignment problem in multifiberWDM star and ring networks. IEEE/ACM Transactions on Networking,9(1):60–68, 2001.

[14] L. Margara and J. Simon. Wavelength assignment problem on all-opticalnetworks with k fibres per link. In Proc. Automata, Languages andProgramming, 27th International Colloquium, ICALP 2000, pages 768–779, 2000.

[15] T. Nishizeki and K. Kashiwagi. On the 1.1 edge-coloring of multigraphs.SIAM J. Disc. Math., 3(3):391–410, 1990.

[16] C. Nomikos, A. Pagourtzis, K. Potika, and S. Zachos. Fiber cost re-duction and wavelength minimization in multifiber WDM networks. InProc. of Networking 2004, 9-14 May 2004.

[17] C. Nomikos, A. Pagourtzis, K. Potika, and S. Zachos. Routing andwavelength assignment in multifiber WDM networks with non-uniformfiber cost. Computer Networks, 50(1):1–14, 2006.

[18] C. Nomikos, A. Pagourtzis, and S. Zachos. Routing and path multicol-oring. Information Processing Letters, 80(5):249–256, 2001.

24

[19] P. Raghavan and E. Upfal. Efficient routing in all-optical networks.In Proc. of the twenty-sixth annual ACM STOC, pages 134–143. ACMPress, 1994.

[20] V. Vizing. On an estimate of the chromatic class of a p-graph (in rus-sian). Diskret. Analiz., 3:23–30, 1964.

[21] P. Winkler and L. Zhang. Wavelength assignment and generalized in-terval graph coloring. In Proc. of the 14th Annual ACM-SIAM SODA,pages 830–831, Baltimore, MD, January 2003.

Aris PagourtzisKaterina PotikaStathis ZachosNational Technical University of Athens,Department of Computer Science,School of Electrical and Computer Engineering,15780, Greece,email:{pagour,epotik,zachos}@cs.ntua.gr

25