Exact solution of the SONET Ring Loading Problem

In this paper we address the problem of planning the capacity of the local rings in synchronous optical networks (SONET). We present e(cid:14)cient lower and upper bound procedures and a branch and bound algorithm which is able to (cid:12)nd the exact solution of large instances, employing short computing times. c (cid:13) 1999


Introduction
One of the most successful ways to exploit the great potential of ÿber optics technology is o ered by the recent introduction of the synchronous digital hierarchy (SDH) in Europe and synchronous optical network (SONET) in the US.This has suggested a number of new optimization problems, most of them in the ÿeld of combinatorial optimization.We address here the problem of planning the capacity of a single bi-directional ring of n ÿber links connecting n add-and-drop multiplexers (ADM) corresponding to n customer (or set of customers) locations.
This problem was ÿrst studied in [1] where it is called the SONET Ring Loading Problem.To the author's knowledge, no exact approach has yet been proposed for this problem, which is known to be NP-hard [1] but is not yet satisfactorily classiÿed with respect to its approximability status: in particular, it is still unknown if a polynomial-time approximation scheme may exist.The problem is known to be polynomially solvable only in the case of unit [2].In [4] a very e cient heuristic has been proposed for the SONET Ring Loading Problem: it is a simple Greedy rounding algorithm which achieves a load that is guaranteed to exceed the optimum by at most 3  2 times the maximum demand.Moreover, this algorithm ÿnds the maximal solution whenever all demands are equal to one.
In Section 2 we formulate the problem and present a simple heuristic having an approximation guarantee factor of 2. In Section 3 we give a strongly polynomial algorithm for the continuous relaxation of the integer formulation.This is exploited in Section 4 within an exact branch-and-bound approach, whose performance is extensively tested as shown by the computational results in Section 5.

Formulation and heuristic solution
We are given a ring graph G = (V; E) that is a simple circuit with node set V = {1; : : : ; n} and edge set E = {1; : : : ; n}.We also consider a set of m demands D = {1; : : : ; m}.Each demand i is deÿned by an origin node o i , a destination node d i and a weight w i which represent the amount of tra c which must be routed from o i to d i along the ring.The entire trafÿc of a demand must be routed either clockwise or counterclockwise and it can not be split to be transmitted in both directions simultaneously.Each edge ' ∈ E may be initially loaded with a ÿxed tra c t ' ¿0, which is independent of the demands in D (this tra c is due to pre-routed demands).The problem we consider is to determine the routing of each demand in D, in order to minimize the total load of an edge.
Without loss of generality, we can assume that all the input data are integers.
In order to present a mathematical model we need to introduce some notation.For each demand i let + i denote the path from node o i to node d i , clockwise, and − i the path from o i to d i , counterclockwise.For each demand i ∈ D let x i be a boolean variable which takes value one if the tra c w i is routed clockwise, value zero otherwise.We also use the continuous variable z to identify the maximum load of an edge.The model is as follows: s:t: Objective function (1) minimizes the maximum load of an edge.Constraints (2) ensure that the value of variable z is not less than the load of each edge ' ∈ E. In particular, the ÿrst sum in (2) gives the total load of edge ' due to the demands routed clockwise; the second sum gives the load due to the demands routed counterclockwise.Constraints (3) impose that the variables be binary.
The continuous relaxation C(P) of problem P is obtained by allowing the variables x i to assume any real value in [0; 1], i.e. substituting (3) with 06x k 61; ∀k ∈ D: ( A demand can then be split by routing part of the tra c w i clockwise and the remaining tra c counterclockwise. A feasible solution for problem P can be obtained from the solution of the continuous relaxation by rounding each variable with fractional value to the closest integer.This corresponds to routing each fractional demand k (i.e a demand associated with a value x k with 0 ¡ x k ¡ 1) clockwise (counterclockwise) if x k ¿0:5 (x k ¡ 0:5).We call HR the heuristic algorithm which determines an approximate solution by applying this simple rounding technique.
Theorem 2.1.The value of the solution obtained by algorithm HR is at most twice the value of the optimal solution.
Proof.Algorithm HR routes the entire tra c of a demand k along the path + k if x k ¿0:5 and along − k , otherwise.It follows that the tra c on an edge in the approximate solution is at most twice the tra c routed on that edge in the continuous relaxation.Thus the maximum load of an edge in the heuristic solution is at most 2L, where L is the value of the continuous relaxation.Since L is a lower bound on the optimum solution value, the result follows.
Algorithm HR can be improved by introducing a post-processing of the ÿrst K demands with largest weight, having fractional values.In particular, we start by rounding the values of the variables of all demands, except that of the K selected fractional ones.Then we enumerate the 2 K solutions obtained with all the possible routing combinations of the K fractional demands and we choose the best integer solution.If K is a constant independent of the input data, the procedure can be implemented to run in polynomial time.We call this improved algorithm KHR.
In the next section we show how to solve problem C(P) e ciently.The e ectiveness of procedure KHR is evaluated in Section 5.

A strongly polynomial algorithm for the continuous relaxation
Before giving the details of our e cient algorithm to solve problem C(P), we need to introduce some further notation.For each pair of distinct edges r ∈ E; s ∈ E let C r; s denote the set of crossing demands, i.e. the set of demands which must be routed exactly on one of the two edges r; s.In the following we will speak indi erently of the pair of distinct edges (r; s) or of the cut (r; s).Let denote the set of all possible straight cuts of G.
Given a demand index i ∈ D and a partial solution x k ; k = 1; : : : ; i, let denote the total tra c on edge ', due to the ÿrst i demands.In a solution to C(P), the load of an edge ' is therefore F n ' + t ' .Let z * C be the optimal solution to C(P).We start the description of our algorithm by introducing a simple lower bound on z * C .Given a cut (r; s), it can be seen that the tra c of each crossing demand must be routed through edge r or edge s, so is a valid lower bound.Since the optimal load of an edge ' ∈ E is at least t ' , an improved bound is with L2 = max '∈E t ' .The bound L is the optimal solution value for problem C(P).To prove this, we give a strongly polynomial time algorithm, called CSONET, which determines a feasible solution to C(P).Our algorithm considers one demand at a time and routes it optimally by determining the maximum tra c which can be routed clockwise (or counterclockwise) without exceeding the bound L.More precisely, we have m iterations, one for each demand.At iteration i, the routing of the ÿrst i − 1 demands is already ÿxed so that the edges of the ring have preassigned loads and we consider demand i and the path + i .For all edges and straight cuts in + i we compute two values C1 and C2, similar to L1 and L2, which give the total amount of tra c which must certainly be routed on some edge of + i , disregarding demand i.We do the same for path − i and we determine the gaps + and − between the lower bound L and the above quantities.If + ¿ − then we route the tra c equal to the minimum of w i and + along + i , and the possibly remaining tra c of demand i along − i .A similar routing is made if − ¿ + , but with paths + i and − i exchanged.The details of procedure CSONET are given in the pseudocode below.
The following theorem holds.Theorem 3.1.Algorithm CSONET determines in strongly polynomial time an optimal solution for problem C(P) and its value; z * C ; is equal to L.
The proof of the theorem is given in the appendix.Alternative proofs were independently developed, during the writing of this paper (see [4,5]).

An exact algorithm
The results of the previous sections have been used to develop a depth-ÿrst branch and bound algorithm for the exact solution of problem P. Our basic algorithm is as follows.
We use a binary decision tree.At each node of the tree we solve problem C(P) modiÿed by ÿxing the routing of a set of demands.Among the demands routed with a fractional tra c in the solution to C(P), we determine the one having maximum tra c.Two child nodes are generated by assigning this demand either clockwise or counterclockwise.
At the root node we set t ' = 0 for each ' ∈ E, then we apply algorithm CSONET of the previous section to solve problem C(P) and to obtain the lower bound L. The continuous solution is used by algorithm KHR of Section 2 to obtain a heuristic solution of value UB.If L = UB we have ÿnished, otherwise we start the exploration of the branch-decision-tree.When a demand i is routed along a path (i.e. a forward step is performed) we increase by w i the values t ' for each ' ∈ .When a backtracking occurs the value w i is subtracted from t ' , for all ' ∈ .Observe that the loads t ' completely describe the tra c due to a partial solution, therefore no modiÿcation in the algorithms of Sections 2 and 3 is required in order to compute lower and upper bounds for the intermediate nodes of the tree.
Preliminary computational experiments performed with instances randomly generated as in [1] show that the time required by our algorithm to ÿnd an optimal solution is one order of magnitude less than the time required by CPLEX to ÿnd an integer solution which is within 0.5% of the optimum (for more details on the experiments with CPLEX see [1]).
Stimulated by these results, we tried to improve the performance of our basic algorithm with several techniques.
Presorting of the demands: We observed experimentally that the value of the heuristic solution obtained with KHR is very close to the optimal value.Therefore we decided to change the branching rule.We select not the fractional variable with maximum tra c, but the ÿrst fractional variable in a presorted list.This list is deÿned in such a way that the ÿrst descent in the branch-decision-tree, from the root node to a leaf, builds the heuristic solution.Our guess is that a limited number of backtracking (i.e.routing changes) are required to obtain the optimal solution.We also tried a presorting by nonincreasing weights.
Improvement of the lower bound: Given the solution to C(P), we consider the K largest demands with fractional value (where K is the same parameter introduced in Section 2 to obtain the improved heuristic algorithm).Similar to procedure KHR, we enumerate the 2 K partial solutions obtained with all the possible routing combinations of these K demands and we apply the lower bound procedure to the remaining m−K demands of each partial solution.The minimum of these bounds is a valid lower bound which improves bound L. We apply this technique to all the nodes of the tree.
Second lower bound: Given a straight cut (r; s) and the crossing demands C r; s , we know that each of these demands must be routed through edge r or s.Thus, minimizing the maximum load on r and s, with an integer assignment of the demands in C r; s , gives a valid lower bound on the optimum solution value.This problem can be transformed into a subset-sum problem in which a set of q items is given, each of which has an associated weight, and a subset S of the q items which maximizes the sum of the weights of the item in S without exceeding a given capacity c is sought.Given a straight cut (r; s), we deÿne an instance of subset-sum with capacity c = 1 2 i∈Cr; s w i and with an item i, having weight w i , associated with each demand i ∈ C r; s .The optimal solution to the subset-sum problem minimizes the di erence between c and the sum of the weights of the items selected, so it also minimizes the difference between the items selected and discarded.In terms of the SONET problem, this solution minimizes the di erence of the tra c loads on r and s and thus the maximum of the two.For each of the n(n − 1)=2 straight cuts we solve the corresponding subset-sum problem with a C translation of the FORTRAN routine given in the book by Martello and Toth [3].We apply this bound to all the nodes of the tree.
All the above improvements of the basic branch and bound have been tested with several computational experiments.The impact of each technique on the computational times is as follows: • Each kind of presorting leads to smaller computational times for some instances and larger for other instances, so, on average, no improvement can be obtained with this technique.• The improvement of the lower bound halves the computational times.• The second lower bound has a larger value than that of the continuous relaxation only for a few instances.In these cases, it drastically reduces the size of the branch-decision-tree, but on average the computational time required to compute the bound is not compensated by the reduction of the tree.
From the above preliminary computational experiments we have seen that signiÿcantly improvements are obtained only with a strengthening of the lower bound coming from continuous relaxation.In order to obtain the maximum information from this bound we developed the following ÿxing procedure tries to ÿx the values of the fractional variables to either zero or one.The procedure performs a series of iterations.At each iteration we consider, in turn, each demand, say j, with fractional value in the optimal solution to C(P).We route the entire tra c of demand j clockwise updating the values t ' accordingly and we again compute the lower bound L. If the lower bound is larger than or equal to the current best solution value then the demand must be routed counterclockwise to have a chance of obtaining a better solution value.If the value of the fractional variable has not been ÿxed by this attempt, we route the demand j counterclockwise and we repeat the same steps to try to ÿx it.When all the fractional demands have been considered we compute the new solution of the continuous relaxation of the problem obtained from P by ÿxing the routing of some demands, and a new iteration is started.The algorithm stops when, at one iteration, no demand has been ÿxed.The pseudocode follows.
Procedure The time complexity of procedure FIXING is O(I (mn 2 + Fmn)) where I is the number of iterations performed and F the number of fractional variables.In the worst case it is O(m 3 n 2 ), but in practice, since the number of fractional demands is small, it is quite fast.
The use of this procedure at each node of the branch-decision-tree reduced the computational times by one order of magnitude.We also noted that with this procedure the improved lower bound no longer has e ect.So our ÿnal code is the basic branch and bound with procedure FIXING applied at each node.

Computational results
We coded in C language the heuristic procedure KHR of Section 2, the lower bound procedure CSONET of Section 3 and the branch and bound of the previous Section.We also implemented the two greedy heuristics described in [1].The ÿrst heuristic, that we call 1PG, is a One Phase Greedy which considers one demand at a time and tentatively routes it clockwise and counterclockwise.The demand is routed on the path which determines the minimum increase in the current solution value.The second heuristic, say 2PG, is a Two-Phase Greedy which tentatively routes the current demand clockwise and counterclockwise, then completes the partial solution with 1PG and routes the demand along the path associated with the minimum solution value.This algorithm is slightly di erent from that in [1], since we use 1PG to determine the routing of each demand, whereas Cosares and Saniee apply 1PG only if there is a tie in the partial load determined by the routing of the current demand clockwise or counterclockwise.
We generated random instances as in [1]: the weights of the demands are randomly selected according to the uniform distribution in [5,100] and origins and destinations are di erent integers also uniformly randomly selected.The results for this class of problems, with values of n=(20; 40; 60; 80; 100) and values of m ranging from 50 to 1000, are reported in Table 1.
Let z H be the solution value of the generic heuristic H for a speciÿc instance, and let z * be its optimal solution value (computed using our branch and bound algorithm).For each instance, we compute the percentage error with respect to the optimal solution, i.e. err = 100(z H − z * )=z * .The columns labeled avg and max , in the table, report, respectively, the average and the maximum percentage error.The columns labeled time give the average computing time in seconds on a Pentium PC with a clock at 100 MHz.For each entry in the tables 20 instances were generated and solved.The labels F avg and F max indicate, respectively, the average and maximum number of fractional variables obtained in the solution of the continuous relaxation.
For these experiments we ÿxed the parameter K of heuristic KHR at 5.
Procedure KHR dominates the other heuristics and it is fast.Its average errors are very small, exceeding 1% only for small instances (n = 20; m6100, and n = 40; m = 100).The maximum error never exceeds a few percent.Heuristics 1PG and 2PG have errors one order of magnitude larger than that of KHR.1PG has negligible computing time, but produces the worst solutions.The average error of 2PG is one-third to one-half less that of 1PG, but its computing time is two orders of magnitude larger.KHR has computing times larger than that of 1PG, but still very small: less than 5 s for the largest instances.
It is worth noting that currently the real instances have n620 and m6200 and the largest weight of a demand is bounded by 100, so the ÿrst three rows of our table give a sample of real-life problems.
The same instances of Table 1 have been solved with the branch-and-bound algorithm of the previous section.The results are given in Table 2.For each pair n; m we give the average and maximum computing time (over 20 instances), the average and maximum number of explored nodes, the average and maximum depth of the branch-decision-tree and the ratio between the value of the lower bound at the root node (L1) and the optimal solution value (z * ).
All the instances with size corresponding to that of the largest real-life problems (n620 and m6200) are solved by the exact approach with small computing times.Larger instances are also solved in reasonable computing times, but the maximum times increases up to 1 h.The average number of explored nodes is, in general, small.This is mainly due to our ÿxing procedure (see Section 4).For large instances, however, the lower bound at the root node, in many cases, is equal to the optimum solution value, but the algorithm determines a feasible solution with this value only after visiting a large number of nodes.
To better understand the behaviour of the heuristic KHR and of the branch-and-bound procedure we generated instances from three further classes: (i) w j ∈ [5; 1000]; (ii) w j ∈ [50; 100] and (iii) w j ∈ [500; 1000].
The performances of the three heuristics are very similar to those obtained with weights w j ∈ [5; 100], but the new instances are more di cult for the branch and bound.The results are reported in Tables 3-5: the numbers in brackets give the number of instances which were not solved within 1 h of CPU time (in these cases the averages are computed on the number of solved instances).It is not di cult to be convinced that values L1; L; C1 and C2 can be computed in polynomial time, with respect to n and m.Moreover, since the main loop for executes m iterations, the overall algorithm terminates within a time bounded by a polynomial in n and m.Hence the algorithm is strongly polynomial.
We now show that the value of the solution determined by CSONET is equal to L.
At the end of each iteration i of the main loop for in CSONET, the following two conditions hold: From the deÿnition of C1 and C2, and the fact that conditions (6) and ( 7) are satisÿed at the end of iteration i−1, it follows that C16L; C26L, so + ¿0 and the algorithm routes w i x i (=min(w i ; + )) tra c units of demand i, on each edge ' ∈ + i .We ÿrst prove that the thesis holds for the edges and the straight cuts in + i .From the above considerations we have w i x i 6 + 6L − C2 and C2¿t ' + F i−1 ' for each ' ∈ + i , so that L¿t ' + F i−1 ' + w i x i , condition (7) immediately holds.Similarly, for condition (6) we have Since demand i is not included in C r; s for all r ∈ + i and s ∈ + i we have and condition (6) holds for any straight cut in + i .
We now prove that the two conditions (6), (7) hold for the edges and the straight cuts in − i .If x i = 1 then no tra c from demand i is routed on path − i , so the only remaining case is 0 ¡ + ¡ w i (i.e. the algorithm routes + tra c units along path + i and w i − + along − i ).By deÿnition of + we know that after iteration i at least one of the following two cases arises: case (i) an edge ' In the remainder of the proof we refer to four particular edges r; s; u; v (see Fig. 1), with r ∈ + i , s ∈ + i , u ∈ − i , v ∈ − i and such that edge r precedes edge s, if we move clockwise from o i to d i , and u precedes v, if we move counter-clockwise from o i to d i .
Since condition (6) holds, at the end of iteration i − 1, for any cut (r; j) with r ∈ + i and j ∈ − i , we have Multiplying inequality (9) by 2 and subtracting Eq. ( 8) we obtain k¿i k∈C j; r Observing that F i j = F i−1 j + w i − + , for each edge j ∈ − i , we immediately conclude that t j + F i j 6L, and condition (7) holds.
Condition (6) must be considered for straight cuts in − i only if − i contains at least two distinct edges, say u and v. Therefore we can refer to the two cuts (u; r) and (v; r).Adding two inequalities of type (9) for j = v and j = u, respectively, and subtracting (8) we obtain It is now su cient to observe that C u; v ⊆ C u; r ∪ C v; r in order to derive which shows that condition (6) holds for any straight cut (u; v) in − i .Case(ii): Let (r; s) with r ∈ + i and s ∈ + i denote the saturated cut, i.e.
and consider an edge j ∈ − i and the two cuts (j; r) and (j; s).Note that inequality (9) can be rewritten with s instead of r, so that by adding the two inequalities of type (9) associated with cuts (j; r) and (j; s), and observing that: C r; s ⊆ C j; r ∪ C j; s we obtain Subtracting Eq. (10) and recalling that: (a) demand i ∈ C r; s ; (b) F i j =F i−1 j +w i − + , we obtain t j +F i j 6L and condition (7) holds.
We conclude the proof by showing that condition (6) also holds for any cut (u; v) with u ∈ − i and v ∈ − i .Consider the two cuts (v; r) and (u; s) and observe that C u; v ∪ C r; s ⊆ C v; r ∪ C u; s .Adding the two inequalities of type (9) associated to the cuts (u; s) and (v; r), and subtracting Eq. (10) we obtain A straightforward implementation of algorithm CSONET performs m iterations (one for each demand) and at each iteration the quantities C1 and C2 are computed twice.Each evaluation of C2 requires O(n) time, whereas we can certainly determine C1 in O(mn 2 ).Hence the naive implementation of CSONET runs in O(m 2 n 2 ), but this time complexity can be reduced to O(n 3 ) as follows.
Observe that the correctness of CSONET does not depend on the order in which the demands are examined (for loop), therefore we can use a demand ordering enables more than one demand at a time to be routed.We need to consider two possibilities.First, let us suppose that L = L2 and let ' be the edge which determines the value of L2.Since we know that the ÿnal solution value is L, then no demand can be routed through this edge and a complete solution can be immediately obtained by routing each demand along the path which does not contain '.If otherwise L = L1, let (r; s) be the straight cut which determines value L1.Given any demand k such that r ∈ + k and s ∈ + k (resp.r ∈ − k and s ∈ − k ), CSONET deÿnes + =0 (resp.− = 0) and it routes the entire demand k along − k (resp.+ k ).Therefore no demand k ∈ D\C r; s can be routed through edge r or s.If D\C r; s =∅, a complete feasible solution can be immediately obtained by setting x i = 0:5 for each demand i ∈ C r; s .Otherwise, we order the demands so that those belonging to D \ C r; s are considered ÿrst, hence routed at the same time.If we have not ÿxed the routing of all demands we iteratively continue to apply the above reasoning and order the remaining demands accordingly.The maximum number of iterations performed by the above implementation is n.Indeed one can prove that, at a certain iteration, at least one of the two edges of the cut which determines the value L1(=L) does not belong to a cut considered in a previous iteration.Since it is possible to compute the values of all the straight cuts in O(n 2 ) (see e.g.[5]), CSONET can be implemented to run in O(n 3 ) time.
Formally, C r; s = {k ∈ D : r ∈ + k and s ∈ − k or r ∈ − k and s ∈ + k }: Any pair of distinct edges (r; s) partitions the node set into two subsets, and is thus called a straight cut of G.

Fig. 1 .
Fig. 1.The four particular edges r; s; u and v.