A tabu thresholding algorithm for arc crossing minimization in bipartite graphs

19
Annals of Operations Research 63(I 996)233- 251 233 A tabu thresholding algorithm for arc crossing minimization in bipartite graphs* Vicente Vails and Rafael Martf Departamento de Estadfstica e lnvestigaci6n Operativa, Facultad de Matem6ticas, Universidad de Valencia, Dr. Moliner 50, 46100 Burjassot (Valencia), Spain Pilar Lino Departamento de Economfa Financiera y Matem6tica, Facultad de Ciencias Econ6micas y Empresariales, Universidad de Valencia, Avda Blasco Iba~ez 30, 46010 Valencia, Spain Acyclic directed graphs are commonly used to model complex systems. The most important criterion to obtain a readable map of an acyclic graph is that of minimizing the number of arc crossings. In this paper, we present a heuristic for solving the problem of minimizing the number of arc crossings in a bipartite graph. It consists of a novel and easier implementation of fundamental tabu search ideas without explicit use of memory structures (a tabu thresholding approach). Computational results are reported on a set of 250 randomly generated test problems. Our algorithm has been compared with the two best heuristics published in the literature and with the optimal solutions for the test problems, size permitting. Keywords: Tabu thresholding, tabu search, arc crossing minimization, automatic graph drawing, heuristics. 1. Introduction Acyclic directed graphs are commonly used to model complex systems. The vertices represent the elements of each system and the arcs the relationships between those elements. This type of graph is a basic tool for proposing and solving large- scale problems, as research in different fields has shown: interpretive structural modeling (Warfield [19]), the design of information systems (Tamassia et al. [18]), automatic generation of logic diagrams (Smith and Linders [ 16]), graphs of subroutine calls in algorithm programming, organization diagrams, facility layout (Hasan and Osman [12]), project management (Martf [15]). *This research was partially supported by the C.I.C.Y.T. with code tap92-0639. © J.C. Baltzer AG, Science Publishers

Transcript of A tabu thresholding algorithm for arc crossing minimization in bipartite graphs

Annals of Operations Research 63(I 996)233- 251 233

A tabu thresholding algorithm for arc crossing minimization in bipartite graphs*

Vicente Vails and Rafael Martf

Departamento de Estadfstica e lnvestigaci6n Operativa, Facultad de Matem6ticas, Universidad de Valencia, Dr. Moliner 50, 46100 Burjassot (Valencia), Spain

Pilar Lino

Departamento de Economfa Financiera y Matem6tica, Facultad de Ciencias Econ6micas y Empresariales, Universidad de Valencia,

Avda Blasco Iba~ez 30, 46010 Valencia, Spain

Acyclic directed graphs are commonly used to model complex systems. The most important criterion to obtain a readable map of an acyclic graph is that of minimizing the number of arc crossings. In this paper, we present a heuristic for solving the problem of minimizing the number of arc crossings in a bipartite graph. It consists of a novel and easier implementation of fundamental tabu search ideas without explicit use of memory structures (a tabu thresholding approach). Computational results are reported on a set of 250 randomly generated test problems. Our algorithm has been compared with the two best heuristics published in the literature and with the optimal solutions for the test problems, size permitting.

Keywords: Tabu thresholding, tabu search, arc crossing minimization, automatic graph drawing, heuristics.

1. Introduction

Acycl ic directed graphs are commonly used to model complex systems. The

vert ices represent the elements of each system and the arcs the relationships between those elements. This type of graph is a basic tool for proposing and solving large- scale problems, as research in different fields has shown: interpretive structural model ing (Warfield [19]), the design of information systems (Tamassia et al. [18]),

automatic generat ion of logic diagrams (Smith and Linders [ 16]), graphs of subroutine calls in a lgori thm programming, organization diagrams, facili ty layout (Hasan and

Osman [12]), project management (Martf [15]).

*This research was partially supported by the C.I.C.Y.T. with code tap92-0639.

© J.C. Baltzer AG, Science Publishers

234 V. Valls et aL, A tabu thresholding algorithm

Whatever the application, those responsible for developing the system need plans or drawings of the structure on a day-to-day basis. Experience shows that a clear, readable map of the graph is a great help towards understanding the system. The modeling of the system is frequently a stage-by-stage process of refinements, requiring successive drawings of the plans right up to the final plan.

It is extremely difficult to make a clear readable map of an acyclic graph representing different real systems by hand, even when the graph size is relatively small. Therefore, an automatic procedure for drawing acyclic graphs by computer is indispensable for generating readable maps quickly.

The various authors who have studied the automatic representation of the structures of complex systems using acyclic graphs have proposed different criteria which try to capture the intuitive notion of a readable map (Warfield [ 19], Carpano [ 1 ], Sugiyama et al. [17], Eades and Wormald [5], Tamassia et al. [18], Martf [15]). Although these criteria depend intrinsically on the structural information to be transmitted in each case, the authors coincide in highlighting the importance of minimizing the number of arc crossings. (See, for example, Warfield [19], Carpano [1] or Tamassia et al. [18].)This problem is NP-complete (Johnson [14]) even if the graph is bipartite and positions of the vertices of one of the partitions remain fixed (Eades et al. [4]).

Several heuristic algorithms have been proposed to minimize arc crossings in a bipartite graph. Warfield [19] was the first to develop a crossing reduction theory. Using a matrix to represent a bipartite graph, he presents theoretical techniques to reduce the number of crossings. These techniques are then extended to any acyclic graphs. Warfield points out that further work is needed on his theoretical study to obtain an algorithm for a reduction in crossings. He illustrates his procedure on a 21-vertex graph.

Carpano [ 1 ] proposes the Relative Degree Algorithm. The idea of the algorithm is that the more horizontal the arcs, the fewer the crossings. To this end, the vertex positions are represented by coordinates on an axis. The algorithm assigns initial coordinates to the vertices of one part of the bipartite graph. The coordinates of each vertex of the other part are then calculated as the arithmetic mean of the coordinates of the adjacent vertices. With this method, the procedure alternately calculates the coordinates of the vertices of each part, while the coordinates of the vertices of the other part remain fixed. The algorithm is applied until two successive iterations occur in which the relative positions of the vertices remain the same. The author shows that the algorithms produced a considerable reduction in the number of crossings (30 to 50 percent less) in real-life samples.

Sugiyama et al. [ 17] propose two methods. The first (the Penalty Minimization Method) is based on the selection of a set of arcs of lower weight with a change in orientation which eliminates all the circuits of the penalization graph. No computational results are given. The second (the Barycentric Method) is similar to Carpano's algorithm [1] but improves upon it in that it allows a change in the order of two vertices with the same barycentre. Computational results are given for bipartite graphs with 7 and 11 vertices.

V. Vails et aL, A tabu thresholding algorithm 235

Eades and Kelly [3] present four heuristics (Greedy Insertion, Greedy Switching, Splitting and Averaging) for left optimality which can be symmetrically applied for right optimality (see section 2 for an explanation and fuller development of these ideas). To obtain optimality, they alternately apply the heuristics for left and right optimality until no reduction in crossings is made.

The Greedy Insertion algorithm orders the left part of the vertices on the graph by successively choosing the vertex u which minimizes the number of crossings between the arcs incident with u and those incident with the vertices which have not yet been selected. The right-side ordering remains fixed (the Greedy Switching and Splitting algorithms are likewise described in detail in section 2). The Averaging algorithm is the same as Carpano's [1].

In order to compare the quality of the solutions given by the four algorithms, Eades and Kelly work with a sample of 100 randomly generated graphs with 40 vertices (20, 20) and different densities. The results show that the Greedy Insertion algorithm is clearly the worst of the four. Of the other three, the Splitting algorithm is better for low density graphs, whilst the Greedy Switching algorithm behaves slightly better than the others in high density graphs. It should be noted that the algorithms under comparison were seeking left optimal solutions, not optimal ones.

Tabu search (TS) is a technique for solving hard combinatorial optimization problems based on general principles of intelligent problem solving. In essence, it is a metaheuristic which may be used to guide any local search procedure in the aggressive search for the global optimum using memory structures to avoid getting trapped in local optima. In recent years, TS has proved to be a very effective technique for solving hard combinatorial problems. For general presentations and successful applications of TS, the reader may refer to de Werra and Hertz [2], Glover [7, 8], Hertz and de Werra [13], and Glover and Laguna [10].

Glover [9] proposes a Tabu Thresholding (TT) approach for implementing the basic ideas of TS without explicit use of memory structures. The TT method is easily implemented and combines elements of probabilistic tabu search with candidate list procedures derived from network optimization studies.

In this paper, we propose an algorithm based on the tabu thresholding techniques for solving the problem of minimizing the number of arc crossings in a bipartite graph.

The organization of this paper is as follows. In the second section, we discuss relevant concepts and properties. We also give a detailed description of the heuristic algorithms Greedy Switching (GS) and Splitting (S) which, as far as we know, are those with the best results in the literature. In the third section, we give a formal problem definition as a mathematical programming problem. In the fourth section, we discuss the basic concepts of TS and q~, highlighting the connection between them. The fifth section is a description of our tabu thresholding implementation. The sixth section contains the results of our computational study. We have tested our TT algorithm on a range of problems with different sizes and densities, comparing the

236 V. Vails et al., A tabu thresholding algorithm

results with the GS and S algorithms and with the optimal solutions where the size of the problems allows. The final section contains some concluding remarks.

2. Preliminaries

A bipartite graph G = (V, E) is a simple directed graph where the set of vertices V is partitioned into two subsets L (the left part) and R (the right part), and where E C L x R. Throughout this paper, a bipartite graph is denoted by the triple (L, R, E).

A bipartite graph is drawn so that the vertices L and R are both on straight vertical lines and the arcs are straight lines. Under this convention, the problem of minimizing the number of arc crossings becomes the problem of ordering the vertices L and R in a suitable way.

An ordering h of the set L is a labeling of the nodes of L by the integers 1, 2, 3 ..... ILl so that each node is labeled by a unique integer and similarly for R.

A drawing (h, r) of a bipartite graph is an ordering t7 of the set L of vertices and an ordering r of the set R of vertices.

A crossing is a set {(u, v), (w, x)} C E of two arcs, where

(1) u, w e L a n d v, x E R ;

(2) h(u) < h(w) and r(v) > r(x) or h(u) > h(w) and r(v) < r(x).

A drawing is optimal if there is no other with fewer crossings. A drawing (h, r) is left optimal when there is no other ordering h ' of L so that

(h', r) has fewer crossings. A drawing (h, r) is right optimal if there is no other ordering r ' of R so that (h, r ' ) has fewer crossings.

As can be seen from the example shown in Eades and Kelly [3], the condition of being simultaneously right optimal and left optimal does not necessarily imply that the drawing is optimal.

Suppose that r is a fixed ordering of R and i , j are two vertices of L. K(i , j) is defined as the number of crossings that arcs incident to vertex i make with arcs incident to vertex j, when the vertex i precedes j in the ordering of L.

Note that given i, j E L, the value of K(i, j ) does not depend on the position of the remaining vertices of L, but is dependent on the ordering of the vertices of R.

The parameter K(i,j) is similarly defined relative to i, j vertices of R, for an ordering h of L.

Suppose i and j are vertices of L and the ordering r of the vertices R is fixed. The following algorithm provides the values of K(i,j) and K(j, i).

ALGORITHM K(i, j )

K(i, j ) = O.

K( j , i) = O.

v.. ~,Tlls et al., A tabu thresholding algorithm 237

WHILE( There are unexplored successors of i) {

Let i ' ~R be an unexplored successor of i. WHILE( There are unexplored successors of j) {

Let j ' ~ R be an unexplored successor of j. IF r(i') < r( j ' )

K(j, i) = K(j, i) + 1. ELSE IF r(i') > r( j ' )

K(i, j) = K(i, j) + 1. Label j ' as explored.

} Label i ' as explored. Delete the labels of the successors of j.

}

The values K(i , j ) and K( j , i) for i and j in R can be calculated merely by replacing the ordering r by h and the successors by the predecessors.

Given two orderings h and r of L and R, respectively, let K(G) be the total number of arc crossings of G with respect to these orderings.

K(G) can be obtained as the sum of the parameters K( i , j ) with h(i) < h ( j ) for all the vertices i , j of L (or similarly as the sum of all the K( i , j ) with r(i) < r( j ) for all the i , j of R):

K(G) = Z K( i , j ) . (1) h(i)<h(j)

In the paper by Lades and Kelly [3], the following lemma is established:

LEMMA

If i, j are vertices of L, r is an ordering of R and qij is the number of vertices simultaneously adjacent to i and j, then K( i , j ) + K( j , i) + qij is equal to the product of the degrees of i and j.

Note that both qij and the degrees of i and j are constant. Therefore, K ( i , j ) + K( j , i) is a constant for any ordering of R.

Given a pair of vertices i , j ~ L, this lemma allows an upper bound of K ( i , j ) + K( j , i) to be established independently of the ordering of R:

K(i, j ) + K( j , i) < max{d(u) * d( v)/u, v E L i .

238 V Vails et al., A tabu thresholding algorithm

The following is a description of the GS and S algorithms. Both algorithms alternately reorder the vertices of L and R until the number of crossings can no longer be reduced. The description is for a reordering of L. The vertices of R are reordered analogously.

GREEDY SWITCHING ALGORITHM

To reorder the L vertices, let the ordering of the vertices of R be fixed; explore all the pairs of consecutive vertices of L following the current order h: If v, u are two consecutive vertices of L (h(u) = h(v) + 1) and K(u, v) < K(v, u), then the positions of u and v are exchanged, thus decreasing the number of intersections on the graph at K(v, u) - K(u, v). The process continues until all the pairs (u, v) of consecutive vertices fulfil K(u, v) < K(v, u). R is ordered in the same way.

SPLIq"FI NG ALGORITHM

This procedure generates a list of subsets of vertices which it reorders. In each reordering, it fixes the definitive position of a vertex. It begins with the subset formed by all the vertices with the current ordering. It selects the first vertex u and reorders all the vertices of the subset so that all the vertices v such that K(v, u) < K(u, v) precede u in the new ordering and the rest follow it. The position of u in the new ordering is definite.

Unless empty, two new subsets are added to the list: that formed by the vertices which preceded u in the new ordering and that formed by those which follow. The recently ordered subset is eliminated from the list. This process is repeated with each subset on the list until the list is empty.

3. Problem formulation

Warfield [19] represents the arc crossings on a bipartite graph using a matrix which he calls an interconnection matrix. On the basis of this matrix, he presents equations for evaluating the number of arc intersections in the bipartite graph.

Taking into account the above considerations, we have formulated the problem of minimizing arc crossings using a mathematical programming problem with an objective nonlinear function, with integer binary variables and linear restrictions.

Given two orderings h, r of the sets L and R, respectively, the interconnection matrix N is defined with dimensions L * R associated with the orderings h and r as the matrix whose entries are:

n o = 1 if there is an arc of the ith vertex of h to the j th vertex of r.

n o = 0 otherwise.

V. Valls et at., A tabu thresholding algorithm 239

Example

1 I l l

N = 2 0 0

3 11

F igure 1.

Using the interconnection matrix associated with the orderings h, r of L, R, respectively, K(i,j) can be calculated for any pair of vertices i,j EL / h(i)< h(j) with the equation

n - 1

K(i,j) = IF. ~ nh(j)k * nh(i)s, k = l s = k + l

where n = I RI. As the graph in figure 1 shows, the number of crossings that arcs incident with

1 make with arcs incident with 2 is: K(1, 2) = 1 * 1 + 1 * 1 + 0 * 1 = 2. To evaluate the total number of crossings on the graph according to (I), it is

sufficient to add the previous equation for all the possible pairs of vertices of L.

n - I n

K ( G ) = ~., K(i,j)= y~ ~_. ~., nhcj)k*n,,ci)s. (2) h(i)<h(j) h(i)<h(j) k = l s = k + l

Let h, h" be two orderings of L and r, r ' two orderings of R. Let N i and N 2

be the interconnection matrices associated with the orderings h, r and h ', r', respectively. Since N 2 can be obtained from N l by reordering its rows and columns, there are permutation matrices P and Q such that N 2 = PN 1Q.

The problem of minimizing the number of intersections in G is the equivalent of finding the permutation matrices P and Q such that the matrix PNQ minimizes the equation given in (2), where N is the initial interconnection matrix. Thus, the problem of minimizing the number of intersections on a bipartite graph represented by the interconnection matrix N may be formulated as

Minimize

subject to

m-1 m n - l n

Z Z Z ~-. PJ NqkpiNqs i=1 j = i + l k = l s = k + l

m

~_.Pij =1 j=l , . . . ,m, i=1

m

Z Pij = 1 i = 1 , . . . , m , j = l

240 V Vails et al., A tabu thresholding algorithm

Z qij = 1 j = 1 . . . . . n, i=1

t!

Z qij = 1 j = l

Pij, qij = 0, I

i = 1, . ,n,

Vi, j ,

where pj = (pj,, Pjz ..... Pin) Vj and qk= (q,k, qzk ..... q,~k) t Vk.

4. Tabu search and tabu thresholding

The basis of tabu search was proposed by Gtover [6]. Tabu search (TS) is a technique for solving hard combinatorial optimization problems based on general principles of intelligent problem solving. In essence it is a metaheuristic which may be used to guide any local search procedure in the aggressive search for a global optimum using memory structures to avoid getting trapped in local optima.

For the purposes of this paper, the basic elements of TS may be described as follows.

Given a problem P of combinatorial optimization, we shall use X to denote the set of possible solutions of P and c : X --) N to denote its objective function. With no loss of generality, assume that P is a minimization problem.

In any local search method, each solution x E X has an associated set of solutions N(x)C_ X, known as the neighbourhood of x. Each solution x' E N(x) may be obtained directly from x by means of an operation known as move. Let M O V E S E T ( x ) be the set of moves which makes it possible to pass from x to x', Vx' E N(x). The neighbourhood N(x) is the set of all the solutions which may be obtained from x with a single move of MOVESET(x) . In this sense a move of MOVE_SET(x) is the equivalent of a solution of N(x).

TS seeks to carry out an aggressive exploration of the solution space, employ- ing a strategy of modifying N(x) as the search progresses, effectively replacing it by another neighbourhood N*(x). The solutions admitted to N*(x) are determined by relying on special memory structures to keep track of information generated by the search history. Particular solutions of N(x), which correspond to solutions encountered over a particular horizon (or which are related to such solutions in a manner to be indicated), are forbidden to belong to N*(x) by classifying them tabu. Alternatively, such solutions may be allowed in N*(x) only under the condition that they are penalized to be chosen. (Probabilistic versions of tabu search translate such penalized evaluations into probabilities of selection.)

The memory used in TS typically records only a limited number of complete solutions, which consist of elite solutions from the past (or highly attractive but unexplored neighbours of past solutions), thereby usefully enlarging N*(x) to provide

V. Valls et al., A tabu thresholding algorithm 241

options not in N(x). For the most part, however, TS memory is designed to exert a more subtle effect on the search, by recording attributes of solutions that change in moving from one solution to another. For example, attributes can consist of nodes or arcs of a graph that are added, dropped or repositioned by the moves executed. Sometimes, attributes are also strategically combined to create other attributes.

An important distinction in TS arises by differentiating between short-term memory and long-term memory, and similarly by differentiating between the strategies associated with these types of memory. Short-term memory keeps track of solution attributes that have changed during the recent past, and is often called recency-based memory. Selected attributes that occur in solutions recently visited are designated tabu-active, and solutions that contain tabu-active elements (or particular combinations of them) are designated tabu. (Recency is usually measured in number of iterations, and may be a function of problem size.) This prevents certain solutions from the recent past from belonging to N*(x) and hence from being revisited. Other solutions that share such tabu-active attributes are also similarly prevented from being revisited.

A special degree of freedom is introduced by means of an aspiration concept. The tabu status of a solution (or a move) can be overruled if certain aspiration level conditions are met, in effect providing thresholds of attractiveness that govern whether the solutions may be considered admissible in spite of being classified tabu.

The process is managed by creating one or several tabu lists, which record the tabu-active attributes. The duration that an attribute remains on a tabu list, and hence remains tabu-active, is called its tabu tenure. Tabu tenure can vary for different types or combinations of attributes, and can also vary over different intervals of time or stages of search. (Sometimes, tabu tenure is referred to as "tabu list size", but in more flexible implementations these elements are generally not the same.) Since TS is a heuristic, the rule for execution is generally expressed as a preestablished limit on the total number of iterations, or on the number of iterations since the last improvement was found.

The aggressive aspect of TS occurs by seeking the best available move that can be determined in a reasonable amount of time. The meaning of best is not limited to the objective function evaluation, but also is affected by penalties and inducements determined by the search history. For situations where N*(x) is large or its elements are expensive to evaluate, candidate list strategies are used to help restrict the number of solutions examined on a given iteration. We discuss this aspect later in more detail.

In some applications, the short-term TS memory components are sufficient to produce solutions superior to those obtained by alternative procedures. However, in general, TS becomes significantly stronger by including longer-term memory and its associated strategies. Frequency-based memory and extended forms of recency-based memory are fundamental to longer-term considerations, introducing penalties and inducements based on how often (and over what region or span of time) attributes have belonged to solutions visited by the search. Intensification strategies (for reinforcing move combinations and solution features historically found good) and diversification

242 V. Vails et aL, A tabu thresholding algorithm

strategies (driving the search into new regions) provide the underpinning for longer- term concerns, and play an important role in the solution of difficult problems.

A more complete and precise description of the theory and applications of TS may be found in Glover [7,8], de Werra and Hertz [2], Hertz and de Werra [1 3]. More recent developments are indicated in Glover and Laguna [10].

Glover [9] proposes the basis for the Tabu Thresholding methods (TT). These procedures implement the fundamental concepts of TS without explicitly using the memory structures and are easier to implement. Tabu thresholding combines elements of probabilistic tabu search with candidate list procedures derived from network optimization studies (Glover et al. [11]). This combination produces an implicit tabu threshold effect which emulates the functions of the memory structures in TS procedures.

The following is a description of key elements of the tabu thresholding methods reported in Glover [9]. We have adapted some of these elements to our specific implementation.

The method consists of two alternately applied phases, an improving phase and a mixed phase. In the improving phase, only improving moves may be performed and it ends with a local optimum. In the mixed phase, both non-improving and improving moves may be performed with the aim of escaping from the local optimum and diversifying the search to other regions in the search space.

In both phases, the set o f moves MOVE_SET(x) is partitioned into subsets MOVE_SUBSET(i, x), i ~ M. At each iteration, a MOVE_SUBSET(i, x) is selected as a list of candidates to be examined. By reference to certain thresholds, this examination makes it possible to define a subset of moves:

THRESHOLD_MOVE_SUBSET(i, x) C MOVE_SUBSET(i, x),

from which the move to be made can be selected. Different thresholds, depending on the state of the search and the type of problem, may be used to control the search.

The selection of the move to be performed in THRESHOLD_MOVE_SUBSET(i, x) is made probabilistically, with a different procedure for assigning probabilities in each phase. These probabilities add up to one over the set THRESHOLD_MOVE SUBSET(i, x).

In both phases, the moves with the highest evaluation have the greatest probability of being selected. In the improving phase, only improving moves may belong to THRESHOLD_MOVE_SUBSET(i,x) (thus being admissible) and are therefore the only moves able to receive positive probabilities, whilst in the mixed phase, admissible movements may be both improving and non-improving. In general, near-best moves have a high probability of being selected while remaining admissible moves also have a probability of being selected. This implies the addition of greater flexibility in the aggressive exploration of the search space to increase the chance of finding additional improved solutions and also gives a non-monotonic way of leading the search (both TS principles).

V. Vails et al., A tabu thresholding algorithm 243

In TS, the avoidance of cycling occurs by reliance on memory structures. In TT, the combined effect of biased randomization in the selection of the movement and of the strategy used to determine the sequence in which the subsets MOVE_SUBSET(i, x) are to be examined approximates the functions of tabu restrictions.

The proposed strategy is as follows:

M is considered to be an ordered circular list. M is divided into consecutive blocks of the size BLOCK_SIZE. The algorithm goes through the blocks in order. Each time it encounters a block, it randomly reorders its elements and examines, following the new order, the subsets MOVE_SUBSET(i, x) corresponding to the block. The order in M of the elements in the block is updated. With a suitable definition of BLOCK_SIZE, the exact division of [M[ can be avoided and therefore the composition of the blocks will change every time the whole of M is run through.

The successive examination of the subsets MOVE_SUBSET(i, x) avoids the possible selection of recently performed movements. This, together with the randomization introduced in the ordering of M, makes cycling reasonably unlikely.

The thresholding effect of the choice criterion is further influenced by a tabu timing parameter t, which determines the number of repeats of the mixed phase (analogous to maintaining a tenure for tabu status in a system with memory). The parameter t may be randomly selected from between suitably chosen upper limits U and lower limits L.

5. The algorithm

Given a bipartite graph, let L and R be the partitions of the set of vertices, and h and r some orderings of the said subsets. The ordered set M = L U R is defined in which the elements of L according to the order h are in first place followed by the vertices of R according to r.

Suppose a vertex i of the graph; let j be the element immediately following i in M. If i and j belong to the same subset L or R, we may consider permuting both vertices in the graph, m(i) denotes this move, which is associated to the vertex i.

Given that in M the vertices of L always precede those of R, all the vertices of M have an associated movement, except the last vertex of L according to h and the last of R according to r (since h and r define the ordering of M).

Let the move m(i) specify the permutation of the adjacent vertices i , j in the same partition. If i precedes j in the current ordering, the evaluation of the move is given by the following parameter:

EVALUATION(m(/)) = K(i, j ) - K( j , i).

Thus, if CROSSINGS is the variable which measures the total number of crossings in the current solution, by implementing movement m(i), the update of that variable is

244 V. Valls et al., A tabu thresholding algorithm

CROSSINGS = CROSSINGS - EVALUATION(m(i ) ) .

Therefore, given that the problem is that of minimizing the number of arc crossings, a move is better the higher its evaluation.

A block B is a subset of consecutive vertices (indexes) of M with fixed size BS (Block Size). The algorithm explores the set M as an ordered circular list. Thus, in one iteration it takes a block, examining the moves associated with its indexes. In the next iteration it takes the following block, repeating the process until a given stopping criterion is satisfied.

5.t. IMPROVING PHASE As a given block B is encountered, we consider the set MOVE_SUBSET(B, x)

of moves associated to the indexes of the block B. The subset S is calculated. It is formed by the moves of MOVE_SUBSET(B, x) which reduce the number of crossings on the graph (improving moves):

S = IMPROVING_MOVE_SUBSET(B, x)

= {m(i) E MOVE_SUBSET(B, x ) /EVALUATION(m( i ) ) > 0}.

I fS is empty, no move is performed and the following block is taken. Otherwise, the moves of S are ordered according to their current evaluation, taking only a subset S* (THRESHOLD_MOVE_SUBSET(B, x)) of b best (highest evaluation). Note that if IS I < b, then S = S*.

The current evaluation of these moves is then used a second time to generate probabilities for selecting an element from S*. The probabilities are assigned as follows:

Let P be the sum of the evaluation of all the moves of S* = {ml, m2 . . . . . m~}; the interval [0, P] is considered to be partitioned into the following subintervals:

[0, evaluation(m l) [ [evaluation(ml), evaluation(mr) + evaluation(m2)[

associated with the move m~,

associated with the move m2,

fk-I 1 evaluation(mj ), P j=l

associated with the move mk.

A random number is generated between 0 and P. The move selected is the one associated with the subinterval to which that number belongs.

Once a move has been probabilistically selected, the corresponding adjacent vertices are interchanged, updating the solution, the order of M, and the value of the objective function (number of crossings on the current graph). Then the following block is taken.

V. Vails et al., A tabu thresholding algorithm 245

Given that in this phase the algorithm only allows a move to be made when the number of crossings diminishes strictly, the stopping criterion is based on making a maximum number of iterations IB (Improving Bound) where no improvement is produced. Thus, it will be considered that after this number of iterations in which the set M has been explored and no move has been found to reduce the number of crossings, the current ordering is sufficiently close to the local optimum to stop this phase.

It is worth mentioning that the structure of the problem makes it easy to update the order of M after each move. This progressive reordering together with the effect of the blocks is sufficient in our case to avoid cycling. It is therefore not necessary to randomly reorder the elements of a block each time it is to be used and so reduces the computational effort.

IMPROVING PHASE ALGORITHM

Step 1. Let x be the solution given by the current orderings of the sets L and R. CROSSINGS = number of arc crossings of the current solution x. Construct M = L U R as an ordered circular list. n o c h a n g e = 0.

Step 2. WHILE(no_change < IB)

2.1. Let B be the block of M formed by the next BS elements. (In the first iteration, take the first BS.)

2.2. Calculate MOVE_SUBSET(B,x) . Calculate S = IMPROVINGMOVE_SUBSET(B, x).

2.3. IF(S ~ @) Calculate S* = THRESHOLD_MOVE_SUBSET(B, x). Make a probabilistic selection of a move of S*. Perform the selected move. Update x, CROSSINGS and the ordering of M. no_change = 0.

ELSE Perform no move. no_change = no_change + I.

Step 3. IMPROVING_CROSSINGS = CROSSINGS.

5 .2 . M I X E D PHASE

Given that this phase is always performed after the improving phase, M is considered with the order obtained in the last iteration of the previous phase. To establish the number of iterations of this phase, the tabu timing parameter t is defined

246 V. Vails et al., A tabu thresholding algorithm

as the number of times the algorithm explores the set M. Select t randomly between L and U.

As in the improving phase, once a given block is encountered, we consider MOVE_SUBSET(B, x). Calculate the subset of these moves whose evaluation in module is lower than a given threshold M T (Mixed Threshold).

S* = THRESHOLDMOVE_SUBSET(B , x)

= { m (i) E MOVE_SUBSET(B, x)/1EVALUATION(m (i)) [ < MT}.

If S* is empty, no move is made and the following block is taken. Otherwise, probabilities are generated to select a move of S. Given that there may be moves with a negative evaluation, a new evaluation for each move is calculated as follows:

EVALUATION_2(m(i)) = EVALUATION(m(/)) - MIN(S*) + 1,

where MIN(S*) = minimum{ EVALUATION(m(/)), m(i) E S* }. With these new evaluations, we apply the same procedure as that in the improving

phase for selecting a move. Once the move has been selected, the necessary updates are performed as in the improving phase. Then the following block is taken.

MIXED PHASE ALGORITHM

Step 1. Let x, M and CROSSINGS be those obtained in the last iteration of the previous improving phase.

MIXED_CROSSINGS = CROSSINGS. n_it = O. Select t randomly between L and U.

Step 2. W H I L E ( n i t < t)

2.1. Let B be the block of M formed by the next BS elements. (In the first iteration, take the first BS.)

IF(the final element of M is in B) n_it = n_it + 1.

2.2. Calculate MOVESUBSET(B , x). Calculate S* = THRESHOLD_MOVE_SUBSET(B, x).

2.3. IF(S* ~ O) Select probabilistically a move of S*. Perform the selected move. Update x, CROSSINGS and the ordering of M. IF(CROSSINGS < M I X E D C R O S S I N G S )

MIXED_CROSSINGS = CROSSINGS ELSE

Make no move.

V. Vails et al., A tabu thresholding algorithm 247

In the improving phase, the algorithm improves the solutions and so only the last solution at the end of the phase need be stored since it will be the best; however, in the mixed phase the solution may get better or worse in each iteration. Therefore, the current solution should be contrasted with the best stored solution each time a move is made, updating when necessary.

5.3. GLOBAL ALGORITHM

For a complete specification of the algorithm, all that remains now is to describe the global procedure which controls the alternation between the improving and mixed phases.

The global stopping criterion is established in a similar way to that in the improving phase: when the improving phase has finished, the number of crossings in the ordering obtained is contrasted with that obtained with the previous application of the phase; the algorithm finishes when, after a number of complete iterations equal to GB (Global Bound), the solution has not improved.

The following outline shows how the global algorithm works.

GLOBAL ALGORITHM

Step 1. Consider the sets L and R with given initial orderings. Let x be the solution associated to those orderings. CROSSINGS = TOTALCROSSINGS = number of crossings of x. total_change = 0.

Step 2. WHILE(total_change < GB)

2.1. Perform improving phase. IF (IMPROVING_CROSSINGS < TOTAL_CROSSINGS)

TOTAL_CROSSINGS = IMPROVING_CROSSINGS. total_change = 0.

ELSE total_change = total_change + I.

2.2. Perform mixed phase. IF (MIXED_CROSSINGS < TOTAL_CROSSINGS)

TOTAL_CROSSINGS = MIXED_CROSSINGS.

6. Computational experience

To measure the efficiency of the algorithm presented in this paper, tests have been carried out on a collection of randomly generated examples.

The examples were generated according to three parameters:

248 V. Vatls et al., A tabu thresholding algorithm

h = number of vertices on the left side,

r = number of vertices on the right side,

d = graph density: quotient between the number m of arcs on the graph and the number of arcs on the complete graph over the same number of vertices.

The algorithm for the random generation of bipartite graphs constructs a graph in two steps using the above parameters. In the first step, it guarantees that all the vertices have at least degree one. To do this, for each of the left side vertices, it randomly selects a vertex on the right side and generates the corresponding arc; then for each vertex on the right side with no incident arc, it randomly selects a vertex from the left side and generates the corresponding arc. In the second step, it randomly generates the remaining arcs necessary to give the graph a fixed density. In order to do this, on each iteration, it randomly selects a vertex from the left side and one from the right; if there is no arc between them, it generates one.

Martf [15] describes a branch and bound algorithm for solving the problem of minimizing the number of crossings in bipartite graphs. We have used this algorithm to obtain the optimal solution for the test problems, size permitting. We have also compared the results of the heuristic tabu algorithm with those obtained with the Greedy Switching and Splitting algorithms (Eades and Kelly [3]) which, as far as we know, show the best results of those published in the literature.

We shall evaluate the results according to the following parameters:

N

initial =

optimum =

T =

tabu =

SW

split =

number of vertices on the graph,

initial number of arc crossings,

number of crossings in the optimal solution,

time taken by the tabu algorithm to find the solution (in seconds),

number of crossings in the tabu algorithm solution,

number of crossings in the Greedy Switching solution,

number of crossings in the Splitting solution.

All the algorithms mentioned in this section were programmed in C and carried out on a compatible PC 486-66Mhz. For each of the groups, l0 examples were tested; therefore, the parameters which appear in tables 1 - 3 are the mean of the parameters in each group. In all the problems, the number of vertices has been taken to be the same on both sides.

Preliminary tests were carried out on a set of randomly generated examples of different sizes and densities in order to determine the values of the parameters of the algorithm. After experimentation, the following values produced best results in terms of solution quality and computation time: B S = 7, IB = 25, G B = 3, L = (N/2) + m, U = 2L, b = 4, and as the mixed phase threshold MT, we have taken:

V, Valls et al., A tabu thresholding algorithm 249

Table 1

Graphs with density 0.3.

N Initial Optimum Tabu T Sw Split

18 95 29.3 29.3 0.11 33,2 31.4

20 160 58 58 0.16 70 67.2

22 280.4 99.3 99.3 0.27 112.8 107

24 400 130 130 0,39 148 135

26 560 201.5 201.5 0,43 219.8 218

30 880 - 458 0.7 470 468.9

40 3150 - 1713 2.8 1890 1837.2

50 7830 - 4701 7.7 4790 4783.2

100 136134 - 97672 5m 5s 101261 98800

Table 2

Graphs with density 0.5,

N Initial Optimum Tabu T Sw Split

18 297 148 148 0,25 157.9 156

20 480 275 275 0,28 290 287

22 730,5 429.3 429.3 0,6 435.2 435

24 1100,1 622 622 0.68 630 627.5

30 2846 - 1787 2.05 1880 1852

40 8840 - 6190.5 10,01 6200 6199,7

50 22166 - 16734 21.2 16842 17036

100 375332 - 306608 10m 35s 325000 321897

Table 3

Graphs with density 0.7,

N Initial Optimum Tabu T Sw Split

18 603.2 400 400 0.33 429.2 426

20 983 705.3 705.3 0,71 781 786.6

22 1570 1045 1045 0.96 1066 1057

24 2101 1535.5 1535.5 1.75 16t3 1633

30 5308 - 4122 4.7 4167 4282

40 17965 - 14315 25.7 14373 14482

50 46095 - 36249 lm 4s 36780 36400

100 739605 - 646018 32m 18s 649492 648554

250 V. Vatls et al., A tabu thresholding algorithm

M T = ( 2 / N ) * max( o,w~t.max d ( v ) * d (w) , o.wsRmax d ( v ) * d(w)],

where d ( v ) is the degree of the vertex v. The value of M T has been suggested by the upper bound established in section 2.

The examples have been divided into three groups according to density: Those with low density equal to 0.3, average density equal to 0.5, and high density equal to 0.7. In every case, the initial solution is that provided by the random generator.

Although the parameters in the tables are the mean for each class, it should be noted that in all the examples where the optimum is available, the solution given by the heuristic algorithm is the optimal one. Likewise, in all the examples tested, the solution of the tabu algorithm improved on that of these other two heuristic algorithms under consideration.

7. Concluding remarks

In this paper, we have developed a tabu thresholding algorithm to minimize the number of arc corssings in bipartite graphs. The procedure is the result of a suitable combination of probabilistic tabu search elements, candidate list strategies and thresholds, which simplifies the implementation of the basic ideas of TS with no explicit use of memory structures.

The computational study has been carried out on a set of 250 randomly generated problems of varying sizes and densities. The TT algorithm has been compared with the GS and S algorithms which appear to be the best published in the literature, and with the optimal solutions for the test problems, size permitting. Computational results show that in the 130 test problems where the optimum is available, the solution given by the heuristic algorithm is optimal. Likewise, in each of the 250 examples tested, the solution of the TT algorithm is better than or equal to those given by the two other heuristic algorithms under consideration.

The tables of results show that the lower the density, the shorter the computational time. Furthermore, acyclic graphs which represent real-life systems generally have low density (considerably lower than 0.3). This, together with the quality of the solutions and the flexibility of the TT approach, would suggest that the generalization of this algorithm to any kind of acyclic graphs could form the basic core of an automatic drawing algorithm of acyclic graphs. The authors are investigating this issue.

Acknowledgement

The authors are grateful to the referees for their helpful comments and suggestions.

V. Valls et al., A tabu thresholding algorithm 251

References

[I] M.J. Carpano, Automatic display of hierarchized graphs for computer aided decision analysis, IEEE Trans. Syst., Man, Cybern. SMC-10(1980)705.

[2] D de Werra and A. Hertz, Tabu search techniques: A tutorial and an application to neural networks, OR Spectrum 11(1989)132.

[3] E Eades and D. Kelly, Heuristics for drawing 2-layered networks, Ars Combinatoria 21(1986)89. [4] E Eades, B. McKay and N.C. Wormald, An NP-complete crossing number problem for bipartite

graphs, Working Paper, Department of Computer Science, University of Queensland, Australia (1985).

[5] P. Eades and N.C. Wormald, The median heuristic for drawing 2-layered networks, Working Paper, Department of Computer Science, University of Queensland, Australia (1986).

[6] F. Glover, Future paths for integer programming and links to artificial intelligence, Comp. Oper. Res. 13(1986)533.

[7] E Glover, Tabu search: Part I, ORSA J. Comp. 1(1989)190. [8] F. Gtover, Tabu search: Part II, ORSA J. Comp. 2(1990)4. [9] F. Glover, Simple tabu thresholding in optimization, Working Paper, School of Business, University

of Colorado, Boulder (1992). [ 10] E Glover and M. Laguna, Tabu search, in: Modern Heuristic Techniques for Combinatorial Problems,

ed. C.R. Reeves (Blackwell Scientific, Oxford, UK, 1993). [11] E Glover, D. Karney, D. Klingman and A. Napier, A computational study on start procedures, basis

change criteria and solution algorithms for transportation problems, Manag. Sci. 20(1974)793. [12] M. Hasan and I.H. Osman, Local search algorithms for the weighted maximal planar layout

problem, Int. Trans. Oper. Res. 1 (1994). [13] A. Hertz and D. de Wen"a, The tabu search metaheuristic: How we used it, Ann. Math. Art. Int.

1(1991)Ill. [14] D.S. Johnson, The NP-completeness column: An ongoing guide, J. Algor. 3(1982)97. [15] R. Martf, T6cnicas exactas y heurfsticas en el disefio automfitico de redes de plantificaci6n de

proyectos, Ph.D. Thesis, Department of Statistics and Operations Research, University of Valencia, Spain (1993).

[16] J, Smith and J. Linders, Automatic generation of logic diagrams, in: IEEE Proc. 13th Design Automation Conf., No. 76 (1976) chap. 1098-3c, p. 377.

[17] K. Sugiyama, S. Tagawa and M. Toda, Methods for visual understanding of hierarchical system structures, IEEE Trans. Syst., Man, Cybern. SMC- 11 ( 1981 ) I09.

[18] R. Tamassia, G. Di Battista and C. Batini, Automatic graph drawing and readability of diagrams, IEEE Trans. Syst., Man, Cybern. SMC-18(I988)61.

[19] J.N. Warfield, Crossing theory and hierarchy mapping, IEEE Trans. Syst., Man, Cybern. SMC- 7(1977)505.