[ieee comput. soc. press 11th international parallel processing symposium - genva, switzerland (1-5...

10
Joining Forces in Solving Large-scale Quadratic Assignment Problems in Parallel Adrian Briingger, Ambros Marzetta Institute for Theoretical Computer Science Swiss Federal Institute of Technology CH-8092 Zurich Switzerland { bruengger,marzetta} @inf.ethz.ch Abstract Program libraries are one way to make the cooperation between specialists from variousJLie1ds successful: the sep- aration of application-spec@ knowledgefrom application- independent tasks ensures portability, maintenance, exten- sibility, andjexibility. This paper demonstrates the success in combining problem-spec@ knowledge for the quadratic assignment problem (QAP) with the raw computing power oflered by contemporary parallel hardware by using the li- brary of parallel search algorithms ZRAM. The solutions of 10 previously unsolved large standard test-instances of the QAP are presented. 1. Introduction Since the early days of the computer age, computers have been used as number crunchers to solve problems-whether they are practical problems or research problems. People interested in solving a specific problem supplied the data and solution method and did the necessary programming to implement the solution method themselves. Today’s world of problem solving looks different. The fields of OR and mathematicalprogramminghave witnessed a tremendous development both in terms of types of prob- lems solved and the sophistication of the methods used. Likewise, computer science has evolved into a subject field of great diversity ranging from information systems, pro- gramming languages, algorithms and theory to supercom- puters. Hence, it is now often the case that those trying to solve a problem use methods developed by others, and that the detailed implementation of these methods is based on prior implementationsmade by others, for instance in terms of program libraries. The goal of problem solving using computers with many Jens Clausen, Michael Perregaard DIKU, Department of Computer Science University of Copenhagen Copenhagen Denmark {clausen,perre}@diku.dk processors working in parallel is to push the limits of the computable: solve problems faster than before, solve bigger problems, or ultimately solve previously unsolved problems. Obviously the limits for a given problem type can be pushed the most if a combination of the fastest available hardware and the best solution methods is used. However, the prob- lem specific expertise and the hardware and implementation expertise are seldom found together. One way of relieving this problem is software libraries with clear interfaces to the user-this enables the user and the library builder to focus on their particular field of expertise. If in addition the library is designed for and used on a powerful platform such as a supercomputer, one would expect a substantial increase in solution capability for the problem in question. The current paper reports on the results of such a collab- oration. The problem addressed is the Quadratic Assign- ment Problem (QAP), one of the hardest among the NP- hard combinatorialoptimization problems. We successfully combined a) the specific QAP knowledge gained over the years represented in the form of the parallel code leading to the first solution of the classical Nugent 20 benchmark, and b) the raw computingpower offered by state-of-the-art paral- lel hardware (the NEC Cenju-3 and the Intel Paragon) using ZRAM, a portable parallel program library for exhaustive search problems. In the following, we briefly describe both the problem- specific methods used and the interface to the Branch-and- Bound engine of ZRAM. To estimate the resources (in terms of time and search tree size) necessary to solve a given in- stance, a tree-size estimator has been a useful tool-this is also described. The properties of the parallel algorithm are briefly mentioned. Although no fine tuning of the parallel code provided has been performed, good speedups as well as minimal parallel search overhead have been observed. Fi- nally, the solutions of 10 previously unsolved QAP bench- mark instances from QAPLIB are reported. Parallelism re- 418 1063-7133/97 $10.00 0 1997 IEEE

Upload: m

Post on 09-Feb-2017

213 views

Category:

Documents


0 download

TRANSCRIPT

Joining Forces in Solving Large-scale Quadratic Assignment Problems in Parallel

Adrian Briingger, Ambros Marzetta Institute for Theoretical Computer Science

Swiss Federal Institute of Technology CH-8092 Zurich

Switzerland { bruengger,marzetta} @inf.ethz.ch

Abstract

Program libraries are one way to make the cooperation between specialists from variousJLie1ds successful: the sep- aration of application-spec@ knowledge from application- independent tasks ensures portability, maintenance, exten- sibility, andjexibility. This paper demonstrates the success in combining problem-spec@ knowledge for the quadratic assignment problem (QAP) with the raw computing power oflered by contemporary parallel hardware by using the li- brary of parallel search algorithms ZRAM. The solutions of 10 previously unsolved large standard test-instances of the QAP are presented.

1. Introduction

Since the early days of the computer age, computers have been used as number crunchers to solve problems-whether they are practical problems or research problems. People interested in solving a specific problem supplied the data and solution method and did the necessary programming to implement the solution method themselves.

Today’s world of problem solving looks different. The fields of OR and mathematical programming have witnessed a tremendous development both in terms of types of prob- lems solved and the sophistication of the methods used. Likewise, computer science has evolved into a subject field of great diversity ranging from information systems, pro- gramming languages, algorithms and theory to supercom- puters. Hence, it is now often the case that those trying to solve a problem use methods developed by others, and that the detailed implementation of these methods is based on prior implementations made by others, for instance in terms of program libraries.

The goal of problem solving using computers with many

Jens Clausen, Michael Perregaard DIKU, Department of Computer Science

University of Copenhagen Copenhagen

Denmark {clausen,perre} @diku.dk

processors working in parallel is to push the limits of the computable: solve problems faster than before, solve bigger problems, or ultimately solve previously unsolved problems. Obviously the limits for a given problem type can be pushed the most if a combination of the fastest available hardware and the best solution methods is used. However, the prob- lem specific expertise and the hardware and implementation expertise are seldom found together. One way of relieving this problem is software libraries with clear interfaces to the user-this enables the user and the library builder to focus on their particular field of expertise. If in addition the library is designed for and used on a powerful platform such as a supercomputer, one would expect a substantial increase in solution capability for the problem in question.

The current paper reports on the results of such a collab- oration. The problem addressed is the Quadratic Assign- ment Problem (QAP), one of the hardest among the NP- hard combinatorial optimization problems. We successfully combined a) the specific QAP knowledge gained over the years represented in the form of the parallel code leading to the first solution of the classical Nugent 20 benchmark, and b) the raw computing power offered by state-of-the-art paral- lel hardware (the NEC Cenju-3 and the Intel Paragon) using ZRAM, a portable parallel program library for exhaustive search problems.

In the following, we briefly describe both the problem- specific methods used and the interface to the Branch-and- Bound engine of ZRAM. To estimate the resources (in terms of time and search tree size) necessary to solve a given in- stance, a tree-size estimator has been a useful tool-this is also described. The properties of the parallel algorithm are briefly mentioned. Although no fine tuning of the parallel code provided has been performed, good speedups as well as minimal parallel search overhead have been observed. Fi- nally, the solutions of 10 previously unsolved QAP bench- mark instances from QAPLIB are reported. Parallelism re-

418 1063-7133/97 $10.00 0 1997 IEEE

duced the solution time for the largest of these from (esti- mated) 2 years to 12 days.

2. Branch and Bound as an interface between two worlds

When attacking NP-hard combinatorial optimization problems, there are two main approaches. The first is to neglect optimality and find heuristically "good" solutions, the second is to insist on optimality. The major advantages of the former are that running times become foreseeable in terms of traditional complexity analysis and that heuristics can be applied to very large instances. The disadvantage is that in most cases nothing but statistical evidence can be pro- vided to measure the quality of a solution. When insisting on the optimality of a solution, the (worst-case) running time cannot be predicted (assuming that P # N P ) , except that it is bounded by an exponential function in the input size. Nev- ertheless, NP-complexity theory addresses only the worst case, neither the average case nor a particular instance. In the following, we will restrict ourselves to the optimal solution of combinatorial optimization problems, QAP in particular, and exploit the possibilities of making reliable assumptions about the sizes of resources, such as time or memory, needed to find the optimal solution of a given instance of a hard com- binatorial optimization problem.

A general algorithmic paradigm to find a minimum of an objective function defined on a state space of exponen- tial size is Branch and Bound. When Mitten [12] gave a formal description of Branch and Bound, he clearly identi- fied the interface between the problem-specific parts and the problem-independent parts of the search algorithm. Branch and Bound can be viewed as the interface between the two worlds of application-specific knowledge and problem- independent tree search. This approach identifies four problem-dependent functions for Branch and Bound:

The branching rule The branching rule recursively divides the state space of solutions into a number of disjoint subspaces. This division into subspaces defines a search tree T where each node represents a (sub-) problem instance to be solved. The root of T represents the original problem. In the leaves of the search tree, the optimal solution for the respective subproblem is known a priori since the subproblem has become trivial.

The bounding procedure In principle, T could be explicitly computed. Propa- gating back the values of the objective function in the leaves along the edges of T would finally produce the optimal solution of the original problem. But in most cases, T contains an exponential number of nodes mak-

ing it far too big to be explicitly enumerated. By com- puting a lower bound on the objective function in a node of T, the expansion of the respective subtree can be omitted whenever the lower bound exceeds a cur- rently known best !solution and a cut-off occurs.

3. The solution test The solution test siinply determines whether an optimal solution has been found for a subproblem. Whenever this is the case, the recursive division of the state space stops.

In order to get goold initial solutions, and therefore in- creasing the probability that cut-offs occur, an upper bounding procedure can be provided. It produces a heuristic solution to the problem in a node of T. This heuristic solution is compared to the currently best known solution and could replace it.

4. The upper bounding procedure (optional)

There are 'several possibilities for traversing the search tree: depth-first (DF), breadth-first (BF) or best-first (BstF, where the nodes are expanded according to lower bounds; the one with the smallest lower bound is expanded first). DF has a linear space-complexity in the depth of the search tree since it stores the subproblems on a stack. BF must store a FIFO queue and BstF must store a priority queue of active nodes, both having exponential worst-case size in the size of the input. The drawback of the preferable space requirement of DF is that DF potentially expands too large a number of nodes. It can easily be seen that BstF expands a minimum number of nodes of T until it finds the optimum node (assuming that the lower bounding function increases along each path from the root to a leaf in the search tree). However, if we know the: optimal solution value in advance, DF also expands only the minimum number of nodes of T. So if we have a high-quality heuristic producing near-optimal or even optimal solutions, the application of DF is strongly suggested. Recent research [8] indicates that DF may be competitive also when no near-optimal solution is known, the reason being that BstF is inefficient when it comes to fast identification of good feasible solutions.

3. The Quadratic Assignment Problem

The Quadratic Assignment Problem is often formulated as the problem of assigning n given facilities to n given locations such that the total cost of the assignment is min- imized. The total cost has a) a fixed contribution from the assignments of the facilities (e.g., the cost of establishing each facility in the chosen location) and b) a variable con- tribution from the interaction between each pair of facilities depending on the locatioa of the involved facilities. Hence in its most general form, QAP is given by a two-dimensional

419

matrix C with Cik equal to the fixed cost of assigning facil- ity i to location k , and a four-dimensional matrix G with g i k j l 2 0, where g i k j l corresponds to the variable cost of assigning facility i to location k and facility j to location I :

the scalar product of these two vectors is a lower bound on the cost incurred from the flow between i and the unassigned facilities. More formally, defining f,! and d i to be the i- th row of F respectively k-th row of D with the diagonal elements fii respectively d k k left out, the matrix L = ( l i k ) is defined by

7 1 . 7 1 . 1 2 7 1 7 1 . 7 1 .

Minimize Q i k j l Z i k Z j l + C i k x i k

such that Zik = 1, k E (1, ..., n}

i E {I, ..., n}

i , k E (1 ?..., n}.

i=l k=1 j=11=1 i=l k = l I?& := (fl,dk)- + f.'d $2 k k + cik. (1)

c ; = , Z i k = 1,

Z i k E { O , l } ,

GLB is then obtained by solving an LAP with cost matrix L as formalized in the following proposition.

Most research on QAP has focused on the Koopmans- Beckman version of the problem, in which the variable costs can be broken into a flow component and a distance compo- nent. For each pair of facilities (i, j ) a flow of communica- tion f (i, j ) is known, and for each pair of locations ( I C , I) the corresponding distance d ( k , 1) is known. The transportation cost between facilities i and j , given that i is assigned to lo- cation kand j isassignedtolocationl,isthenf(i,j).d(k, 1).

Each feasible solution corresponds to a permutation of the facilities, and letting S denote the group of permutations of n elements, the problem can be stated as

Initially no facilities have been placed on a location; sub- problems of the original problem arise when some but not all facilities have been assigned to locations. The number of feasible solutions grows exponentially: For a problem with n facilities to be located, the number of feasible solutions is n!, which for n = 20 is approximately 2 . lo1'.

Next we briefly review each of the four components of a Branch and Bound algorithm mentioned in the preceding section for the QAP application. Our description follows [a 3.1. The Gilmore-Lawler bound

The Gilmore-Lawler Bound GLB is based on the idea of joining exact cost information and simple bound informa- tion for the cost of assigning facility i on location k into one matrix, say L, which is then used as cost matrix in the solu- tion of a linear assignment problem (LAP). The exact cost information consists of the costs which will be incurred in- dependently of succeeding assignments, whereas the bound information relates to the costs which vary depending on the succeeding assignments.

Regarding the variable costs, these relate to the cost of communication between facility i to be located next and all other unassigned facilities. Sorting the flow coefficients from i to unassigned facilities ascendingly and the distance coefficients from location k to free locations descendingly,

Proposition 1 Let F and D be symmetric n x n matrices and let C E WXn. Let L be the matrix with entries as dejined in (1) . Then

QAP(F, D, C) 2 GLB(F, D, C ) := LAP(L) . (2)

For non-root nodes of the search tree we proceed as fol- lows. When no assignments have been made, the cost in- curred by locating facility i on location k is f i i d k k + cik. Suppose now that facility j has already been assigned to location 1. The contribution f i j d k l must then be added to the exact cost information. This has to be done for all as- signed facilities. The process can be seen as a modification of the initial linear costs c i k leading to a QAP of reduced dimension, but with the same properties as the full problem. Note that the contribution originating in the flow between fixed facilities is 0 initially, and increases gradually with an increasing number of assigned facilities.

The complexity of calculating GLB is dominated by the solution of the linear assignment problem and is hence O(n3). However note that if a QAP in the so called general form is considered in which the cost of communication be- tween two facilities a and j assigned to two locations k and 1 cannot be broken down into factors fij and d k l , then the bound calculation has complexity O(n5). The reason is that for each combination of unassigned facility and free location, an LAP has to be solved in order to find the corresponding coefficient of L. For problems in the Koopmans-Beckmann form these LAPS have coefficients corresponding to products of flow coefficients and distances and the optimal solution can hence be found by computing minimal scalar products as described above.

3.2. The branching rule of Mautor and Roucairol

The processing of each node consists essentially of bounding and branching. Branching is performed as de- scribed in [ l l] supplemented with the forcing of assignments as described in [7] . Branching is performed on facilities and is based on the reduced cost information generated when solving the LAP with cost matrix L in the GLB calculation. Comparing the reduced cost of entry (i, k ) against the value

420

of the current best solution it can be determined if GLB for the subspace generated by assigning facility i to location k exceeds this value thus implying that the optimal solution will not belong to the subspace. Hence a number of as- signments can be ruled out. If a facility (or location) exists for which only one assignment permitting a solution better than the current best is left, a forced assignment takes place. After a forced assignment, a new GLB calculation is per- formed and the branching process is repeated. The process stops when each facility and each location has at least two possible assignments. The location i with fewest remaining possible assignments is then chosen for branching, and a new subproblem is created for each k among these by assigning i to k.

In addition the symmetry testing of [2, 111 is imple- mented. Note that although branching on locations exactly as described above for facilities is possible, the symmetry testing requires that branching is performed on facilities.

3.3. Finding a first feasible solution

The first feasible solution to be used as upper bound can in the case of the QAP be found using one out of a number of very efficient heuristics. These in general produce an opti- mal solution. Thus, the solution by Branch and Bound can be seen as an optimality proof. However, for other combinato- rial optimization problems, such as the Job Shop Scheduling Problem, the situation is different, cf. [13].

In most simulated annealing codes for QAP the neigh- bourhood of a given feasible solution to a QAP consists of those solutions which can be obtained by switching the lo- cation of exactly two facilities. The annealing procedure consists of a number of phases. In each phase the temper- ature is held constant, and a number of iterations are per- formed. Each iteration consists of choosing at random a neighbour of the current feasible solution and accepting it as new feasible solution unconditionally whenever the ob- jective function value decreases, and with a probability de- pending on the temperature if the objective function value increases. Between phases the temperature is decreased.

The different simulated annealing codes have different schemes for decreasing the temperature. In the code reported on in [7] the temperature is decreased by a constant factor. Also, the number of iterations to be performed in the next phase is adjusted by a constant factor. The annealing process terminates when a phase has not produced a better feasible solution.

The parameters used in the code are thus the initial tem- perature, the initial number of iterations at each temperature, and the ratios by which the temperature and the number of iterations are to be changed when temperature changes. Af- ter a number of experiments the parameters were chosen as follows: Initial temperature: 10n, Number of iterations at

each temperature: (n - 6)2/2, Decrease factor for tempera- ture: 0.8, Increase factor for number of iterations: 1.1. With these parameters the optimal solution was identified for all problems solvable to optimality within 5 seconds of parallel computing time, cf. [7].

4. The library ZRAM of parallel search algo- rithms

ZRAM [4] is a library of parallel search algorithms. Its layered architecture (Fi<gure 1) makes it easily portable and extensible. It has four layers separated by clearly defined interfaces.

The hardware layer hides all machine dependencies. ZRAM requires the underlying system to be capable of passing messages. A shared memory is not necessary, nor does ZRAM use any information about the topology of the underlying network. The MPI version of the hardware layer is portable to a broad range of machines including the NEC Cenju-3 and workstation networks.

0 The virtual machine abstracts from the hardware and contains higher-level functionality convenient for pro- gramming parallel search algorithms. Among its fea- tures are dynamic load balancing, distributed termina- tion detection and c:heckpointing. Computations can be interrupted and continued later with a different number of processors, whilch makes ZRAM suitable for long- term computations.

0 The layer of search algorithms and data structures con- tains parallel search engines for branch and bound, re- verse search [ 11 and backtrack as well as a general im- plementation of Knuth’s tree size estimation [lo]. The interface and impkmentation of the Branch and Bound engine and the tree: size estimator will be described in this paper.

0 In the top layer, a variety of applications demonstrate the usability of the ZRAM interfaces. The quadratic assignment problem, the traveling salesman, the 15- puzzle and a vertex cover algorithm all use the Branch and Bound engine. Vertices of polyhedra, connected in- duced subgraphs, polyominoes and Euclidean spanning trees are enumerated by the reverse search engine. The application layer generally contains no explicit paral- lelism.

ZRAM is written in ANSI C, as this is the only language available on all the computers we use. ZRAM differs from other available search libraries (such as BOB, [9]) in the generality .of the functions offered, in its layered structure and in the convenient application interface.

42 1

Figure 1. ZRAM’s four-layer architecture

qrp-Branch ,ti

Search engines (problem-independent)

Figure 2. Call graph for the Branch and Bound interface

4.1. The Branch and Bound interface

The most important issue in the design of libraries is the definition of clear interfaces between their components. The interfaces must be general enough for their intended use and nevertheless allow an efficient implementation on both sides. They must be easy to learn and use. The user-friendliness of an interface can determine whether a library will be used or not.

In this section we describe the interface between the QAP application and the Branch and Bound engine. Of course, the QAP is just one example-it could be replaced by any other Branch and Bound application. The application defines two data types and provides three problem-specific procedures to the search engine and ZRAM provides two problem- independent procedures to the application (Figure 2).

All data used in the course of the search is mapped to two data types. This enables ZRAM to move data from one processor to another (load balancing) and between the mem- ory and the file system (checkpointing). One of these types (qap-Global) describes the global data (the problem in- stance) and the other one (gap-Node) a node of the search tree. When the application starts to run, the global data is

initialized by the application program and broadcast to all processors by ZRAM. From that point on, the global data can no longer be modified.

A tree-search algorithm operates on nodes of the type qap-Node. The root of the search tree is the first object of this type, and is initialized by the main program. The branching procedure gets a node and generates its children. ZRAM transparently moves these nodes from one processor to another and to the file system.

The QAP application provides the following three proce- dures to the search engine:

1. void qap-Branch( qap-Global *global, qap-Node *np, qap-Node *upper, z-bb-DoProcP whatToDo, void *ref) ;

qap-Branch generates the children of the node np. global points to the global data and upper to the current upper bound (read-only). whatToDo (child, ref) is called for all children of np (if there are any) and either inserts them into a priority queue or calls qapBranch recursively.

2. int qap-CompareProc(qap-Node *x, qap-Node *Y) ;

qap-CompareProc compares the lower bounds lb of x and y. It returns f l if x > y, 0 if x = y and -1 if x < y.

3. boolean qap-IsSolution(qap-Node *np);

gap-I sSolut ion returns true if np is a feasible solution to the original problem.

The application calls the following two procedures in the algorithm layer:

1. z- -BranchBoundEstimate( qapgroc s e t nun, ( z-Node*) global, (z-Node*) root, ( z-Node* 1 upper, nrOfEstimates, &Modes, hsNodes, &nTime, &sTime) ;

zBranchBoundEs t imate broadcasts the global data and estimates the size of the tree with the given root consist- ing of all nodes with a lower bound less than or equal to the upper bound. It computes nrOfEstimates paths through the tree (see below, section 4.4), returns the estimated number of nodes in the tree, the estimated time for searching the whole tree and estimates the standard deviation of these results.

422

The parameter qap-procsetnum refers to the three pro- cedures defined earlier. They are given as parameters rather than statically linked in order to maximize the flexibility of the library.

2 . sol = z-BranchBoundDepthFirst( qap_procsetnum, (z-Node*)global, ( z-Node* ) root, ( z-Node * ) upper) ;

z-BranchBoundDepthFirs t broadcasts the global data and does a parallel depth-first search starting at the root. If upper is non-null, it is used as an initial upper bound for the solution. This can dramatically reduce the size of the search tree. ZRAM contains other Branch and Bound algo- rithms such as parallel best first, which were not used for the work presented in this paper.

4.2. Dynamic load balancing

In practice, the size and shape of a search tree is un- known at the beginning of a computation. Thus it cannot be partitioned into subtrees of equal size at the beginning of a computation. Therefore, a parallel search algorithm needs a mechanism to redistribute the work among the processors during the computation, when the sizes of subtrees become available and processors run out of work. This mechanism is called dynamic load balancing. Implementations of dy- namic load balancing face a trade-off between processor uti- lization and communication overhead. If too little balancing is done, processors wait a significant fraction of the time for work. If too much balancing is done, the machine spends its time communicating instead of computing.

A dynamic load balancing mechanism is provided by the virtual machine of ZRAM. It is used for depth-first Branch and Bound, reverse search and for the tree size estimator. In an abstract global view, the virtual machine manages just one (distributed) data structure: a global set of work units (for Branch and Bound, a work unit is a subtree represented by its root node). Every processor repeatedly removes a work unit from the global set, does whatever work it has to do, and inserts zero or more new (smaller) work units into the set. When the virtual machine detects that the set is empty, the algorithm terminates.

Viewed locally, every processor manages its own local list of work units. It can remove items from the list and insert others. When the list becomes empty, it sends an “I need work” message to some other randomly selected pro- cessor. If this second processor’s list contains at least two elements, it sends some of these back to the requesting pro- cessor. Otherwise the second processor forwards the “I need work” message to a third processor. To keep the algorithm simple, the third and all succeeding processors are selected

in a round-robin fashion rather than randomly. The statis- tics gathered during QAP runs of several hours show that “I need work” messages are almost never forwarded except in the last few minutes before the program terminates (see fig. 5). Hence, a simple: and fast load balancing algorithm as described seems sufficient for coarse-grain parallelism.

4.3. Checkpointing and dynamic modification of the number of ~irocessors

The solution of a QAP instance can take several days on a powerful parallel computer. Often it is impossible to get that much processor time in one chunk. Other users want to run their applications in between, system programmers want to test a new operating system feature, or the machine crashes as an effect of a1 hardware or software failure. On one day 100 processors could be available and on the next day only 20. Parallel combinatorial optimization software has to cope with such issues. It must be possible to interrupt a computation without losing a lot of work and to restart it later with a different number of processors from the same point it left off.

Where is the best place to implement this checkpoint- ing? The virtual machine of ZRAM transfers data between processors in order to balance the load. It can as well trans- parently save the same data to disk. The global data, which are never modified, are isaved once at the beginning of the computation. At regular intervals (every hour) during the tree search the computation is interrupted, the dynamic load balancing algorithm is brought into a known state, and the global set of work units is saved to disk. The virtual ma- chine then calls a function in the search engine which saves the current upper bound. On machines supporting a signal facility, checkpointing can also be triggered by sending a signal to the process group before killing the job.

To restart the Computation, the virtual machine first reads the global data and broadcasts it to all processors. It then reads the set of work units and redistributes it onto the new set of processors. Finally it calls a search engine function to read the current upper bound.

4.4. The estimator

It would be desirable to know the running time of the Branch and Bound code for a given problem instance be- fore starting the computation. Knowing all running times in advance, we could avoid starting computations which later turn out not to finish in a m acceptable time. This would be preferable to killing a computation which already has used many resources.

Since we cannot predict the running times of a Branch and Bound algorithm by traditional complexity analysis (aside from very weak worst-case considerations), another

423

approach is needed for estimating the resources such as run- ning time involved in the actual solution of an instance. The “difficulty” of a given instance has to be estimated in order to decide whether it is solvable by the available algorithm in reasonable time or not.

Knuth [ 101 has introduced a tree-size estimator that al- lows a classification in this sense: by evaluating a relatively small number of paths of the search tree and computing the degree of every node on these paths, the size of the full tree can be estimated (with respect to the chosen branching rule). The ZRAM implementation of this estimator has been (triv- ially) parallelized: every processor independently follows some number of paths in the search tree and collects the data needed. At the end of the computation, one proces- sor gathers the results and computes the mean and standard deviation.

The different paths in a search tree generally have dif- ferent lengths and their evaluations have different running times. This leads to another application of ZRAM’s dynamic load balancing.

5. Computational results

5.1. Hardware: NEC Cenju-3, Paragon

In our computation we used two massively parallel com- puters: the NEC Cenju-3 and the Intel Paragon XP/S22. Both systems share the following basic properties:

0 distributed memory

0 SPMD (single program, multiple data)

0 message passing

The Intel Paragon XP/S22 system we use consists of 148 compute nodes, each containing 3 Intel i86OXP processors with a peak performance of 75 MFLOPS each (usually one is used for communication and two are real application proces- sors). All nodes appear to be connected to all other nodes, and communication performance is uniform (the bisection bandwidth for the system used is 5.6 GByte/s). Physically, the nodes are arranged in a two-dimensional mesh. A fixed- function component at each compute node performs the ac- tual routing of the messages.

The NEC Cenju-3 is a research prototype machine that contains 128 compute nodes (MIPS VR44OOSC) with 64 MByte of local memory each. Peak performance reaches 50MFLOPS per compute node. The compute nodes are connected via a multistage network based on 4x4 switches, achieving about 40 MByte/s communication bandwidth be- tween two compute nodes.

5.2. Standard test instances from the QAPLIB

The algorithms were tested on a set of symmetric stan- dard test instances retrieved from the QAPLIB [5]. We fur- ther constructed two new nugent-type instances nug2l and nug22 from the larger standard instance nug30. Both are now included in the QAPLIB .

5.3. Quality of the ZRAM estimator for the QAP

In order to demonstrate the quality of the ZRAM esti- mator, we estimated the sizes of the search-trees for several non-trivial instances (all the instances we could solve that led to trees with more than 10 million nodes) and compared the estimates with the actual number of nodes generated when solving the instances. The sample size was 10000 paths in the search trees. The number of nodes evaluated in the estimate was therefore less than 1 percent of the number of nodes evaluated in the solution. Figure 3 shows the accuracy of the estimates. The top curve shows the relative deviation of the estimated upper bound on the number of nodes (hor- izontal line, normalized to 1). The bottom curve shows the relative deviation of the estimated lower bound of nodes in the respective search trees. Note that the scale for the de- viation is logarithmic. For most instances (nug21, rou20, nugl7, tail7a, hadl8, tai20a, hadl6 and nugl8) the esti- mates are very accurate; the actual number of nodes differ less than ten percent from the estimates. For some examples (nug22, escl6c and escl6d) the estimated upper bound is pessimistic, but the estimated lower bound is still very close to the actual number of nodes in the search tree. Only for three instances (had20, nug20 and escl6b) do the estimated number of nodes differ significantly from the actual number of nodes; the estimates are too conservative.

5.4. Load balancing

Load balancing prevents processors from starvation by feeding them with useful work while keeping the communi- cation overhead as small as possible. The first characteristic variable to measure the parallelism overhead is the work done. When exploring a search tree in parallel, the evalua- tion order for the nodes in the tree differs inherently from the one occurring in a sequential implementation. New upper bounds are detected at different times. As a consequence, a parallel Branch and Bound algorithm usually expands a different number of nodes in a search tree than the corre- sponding sequential implementation. This is not the case for the QAP. Since the initial heuristic generates a solution that is optimal (at least in all instances we tested), no su- perfluous work (nodes with a lower bound that exceeds the solution cost) is done, except for the nodes in the search tree that have a lower bound equal to the optimal solution. In or- der to prevent heavy communication in the starting phase of

424

Estimator: 10'000 paths for some hard instances

10,

C .- e .- 2 1 U

instances

Figure 3. Quality of the ZRAM estimator for some hard QAP instances

Parallel overhead: Nr. of nodes for five QAPLIB instances

b. c

1Mx)w 0 10 20 30 40

nr. of processors

a c h r 2 2 b

Figure 4. The parallel Branch and Bound eval- uates an almost constant number of nodes when varying the number of processors.

the branch and bound search, where only the root problem is available and almost all processors are idle, ZRAM simul- taneously expands the tree on all processors until the tree reaches a size where every processor can start working on its own part of the search tree. Therefore, the total number of expanded nodes increases (so slowly that it is negligible) with an increasing number of processors. Figure 4 shows that the number of nodes expanded for a selection of non- trivial instances from the QAPLIB remain constant for an increasing number of processors.

The second characteristic overhead introduced with par- allel Branch and Bound is the trade-off between commu- nication and load balance. At the cost of communication, the load can be balanced between the processors. We mea- sured the communication overhead by counting the number

Pariillel overhead: Communication introduced

and work performed

I I I I I I I I I ~ 100000

10000

loa0

100

10

1

0.1

time [Min]

Figure 5. Work ratio and number of messages sent during the solution of nugl7 on 16 pro- cessors.

of messages that were sent during a given time period. (Since the message size is constant in the ZRAM depth-first imple- mentation, the number of messages is an adequate measure). Figure 5 shows the typical behavior of the ZRAM load bal- ancer for a QAP instance: (nugl7 solved with 16 processors on the Intel Paragon). Thie x-axis indicates the time periods: the rightmost group of bars shows what happened in the last two minutes the algorithLm was running. The leftmost bar in each group of bars shows the number of evaluated nodes per second in that time period. (Note that the y-axis has a logarithmic scale). The next bar in the group gives the num- ber of work request messages that were sent during the time period. The third bar gives the number of forwarded request messages. There is no communication at all at the beginning of the algorithm since all1 processors are busy, so no work requests are sent. After half of the total time has elapsed, some processors become idle and their work requests are immediately answered b y other processors. In the very last phase of the tree search, most of the work requests have to be forwarded to a third processor since the processor which is asked for work is idle itself. The communication overhead does not slow down the progress of the algorithm at all: the rate at which nodes are evaluated remains almost constant during the whole running time of the algorithm.

5.5. Speedup

Although there are theoretical limitations on speedup [3], an almost linear speedup should be achievable for adequate problem sizes. Figure 6 shows speedups for a collection of five non-trivial instances on the Intel Paragon. With 32 processors, a speedup between 25 and 28.5 was achieved. The actual running times for the instances varied from 413 seconds (nugl6b with 3612768 nodes in the search tree) up to 4436 seconds (nugl6a with 2 920487 nodes in the search tree) on one processor.

425

I Speedups for five QAPLIB instances

hadl6 hadl8 had20

tail7a tai20a

rou20

nug2 1

nug22

esc32e

-

esc32f

32

24

a 16 I

8 8

n

name

hadl6

0 8 16 24 32

nr. of procs.

time [Minl

3720 32 18 770 885 4

cost procs nodes

t-chR2a

Figure 6. Speedups for five QAP instances on the Intel Paragon

5.6. Solution of 10 previously unsolved QAP in- stances

The ZRAM estimator provides accurate predictions of the difficulty of QAP instances. Amongst the QAPLIB in- stances 10 problems were identified to be solvable within a reasonable time. Table 1 and table 2 show the results. Had20 and tai2Oa were solved on the Paragon, the other instances on the NEC Cenju-3. The largest solved instance is nug22 with about 5 . 10" nodes in the search tree. The solution took about 12 days with a varying number of processors in- volved. On a state-of-the-art single processor workstation, the computation would have taken about two years.

Table 1. 10 previously unsolved instances from the QAPLIB

assignment 8 3 1 5 0 6 7 5 1 0 1 4 1 3 1 1 9 4 2 1 1 2 7 1 4 1 5 1 3 6 1 7 5 1 0 0 9 1 1 4 1 2 2 1 1 6 8 3 7 1 4 0 1 3 1 8 5 6 1 6 1 5 1 1 9 1 0 4 1 9 1 2 3 8 17 12 11 1 5 6 3 7 1 3 4 1 0 2 1 5 1 2 1 6 8 0 9 1 4 9 8 1 1 1 9 1 8 2 1 3 5 1 6 1 0 4 6 1 4 1 5 1 7 1 3 7 120 0 18 1 13 9 15 10 19 8 4 6 3 7 17 14 2 11 16 12 5 3 2 0 2 8 1 2 1 4 1 3 1 7 1 0 1 5 9 5 1 4 1 9 1 8 7 6 0 1 1 16 1 2 0 8 9 6 2 0 187 19 1 6 4 1 2 5 11 15 10 21 17 3 13 14 0 1 4 5 7 15 12 18 8 31 6 2 1 23 1 9 3 11 2 162820102426172930222713 1425 9 0 1 4 5 7 1 5 9 6 8 2 7 2 9 3 3 1 3 0 2 1 1 1 2 1 6 25 17 122428202223181913 142610

Table 2. 10 previously unsolved instances from the QAPLIB: Solution assignments

6. Conclusion and future work: verification of large computations

We have shown that cooperation between specialists in various fields of computer science (combinatorial optimiza- tion, development of parallel libraries for search problems) led to the solution of previously unsolved problems in the case of the quadratic assignment problem. The key issue to a successful combination of problem-specific knowledge and problem-independent tree search algorithms is the de- sign of simple but well-defined interfaces. The usefulness of parallel search libraries has been shown and the clear layer structure of ZRAM makes the implementation of an appli- cation (such as the QAP) easy. Although ZRAM was not tuned for the special structure of the quadratic assignment problem, the introduced search overhead was minimal. Ex- cellent speedups have been achieved while running times on one processor remained competitive. Since ZRAM is implemented on a variety of parallel machines including state-of-the-art hardware such as the NEC Cenju-3 and the Intel Paragon, the raw computing power offered by these machines was available to solve several previously unsolved standard benchmark instances optimally.

Future work includes the verification of large computa- tions. In the largest solved QAP instance, the search tree contained lolo nodes and the computation ran for several days. Errors of all kinds (hardware, system software, appli-

426

cation software, handling, etc.) might have occured and cor- rupted the result. Can we trust the result? How can we prove that the result is correct, or at least, how can we increase our confidence in the result? A possible solution might be the following scheme: instead of presenting only the main re- sult, a number (e.g., 100) partial results of a computation are presented. The partial results share the following properties:

0 the result of the complete computation is correct if all partial results are correct

0 the partial results can be verified using only a fraction of the resources (such as time) needed to compute the complete result.

If somebody does not trust the result, he simply selects a number of partial results on a random basis and verifies them independently. In that manner he can increase his confidence in the main result without actually rerunning the complete computation.

In the case of a tree search (such as Branch and Bound) for a combinatorial optimization problem, several possibilities to implement this strategy are possible. One is the following: instead of only searching one optimal solution, we identify all solutions up to a certain threshold cost and publish all those solutions. To verify a partial result a randomly chosen subspace of the complete state space is searched. All the solutions in that subspace must have been detected by the original algorithm.

Acknowledgments. This work has been supported by the SNSF (Swiss National Science Foundation) and ETH Zurich. We would like to thank NEC Corporation and CSCS/SCSC (Swiss Center for Scientific Computing) for letting us use their NEC Cenju-3.

References

[1] D. Avis and K. Fukuda, Reverse search for enumera- tion, Discrete Applied Mathematics, 65 (1996) 21-46.

121 M. S. Bazaraa and 0. Kirca, A Branch-and-Bound- Based Heuristic for Solving the Quadratic Assign- ment Problem, Naval Research Logistics Quarterly, 30 (1983), 287-304.

[3] A. Briingger, A parallel best-first Branch and Bound al- gorithm for the traveling salesperson problem, in Pro- ceedings of the 9th International Parallel Processing Symposium, Workshop on Solving Irregular Problems on Distributed Memory Machines, S. Ranka ed., 1995, 98-106.

[4] A. Briingger, A. Marzetta, K. Fukuda, J. Nievergelt, The Parallel Exhaustive Search Workbench ZRAM and

its Applications, submitted to Annals of Operations Research.

[5] R. E. Burkard, S. Karisch and F. Rendl, QAPLIB-A Quadratic Assignment Problem Library, Report 287, Technische Universitat Graz, 1991. Also available via WWW from http://fmatbhpl.tu-graz.ac.at/%7Eka risch/qaplib/inst.html

[6] J. Clausen, S. Karisch, M. Perregaard and E Rendl, On the Applicability of Lower Bounds for Solving Rec- tilinear Quadratic Assignment Problems in Parallel, DIKU Report 96/24, 19 pages, submitted to Computa- tional Optimization and Applications.

[7] J. Clausen and M. Penegaard, Solving Large Quadratic Assignment Problems in Parallel, DIKU report 1994/22, 14 p., accepted for publication in Compu- tational Optimization and Applications.

[8] J. Clausen and M. Perregaard, On the Best Search Strat- egy in Parallel Branch-and-Bound - Best-First-Search vs. Lazy Depth-First-Search, DIKU report 96/14, 11 pages, submitted to Annals of OR.

191 B. Le Cun and (2. Roucairol, BOB: a Unified Platform for Implementing Branch-and-Bound like Algorithms, Tech. Rep., 95/16, Labora- toire PRiSM, Universite de Versailles - Saint Quentin en Yvelines, 78035 Versailles Cedex, France, 1995. Also available via WWW from http://www.masi.uvsq.fr/english/par allel / cr /bob-us. html

[lo] D. E. Knuth, Estimating the Efficiency of Backtrack Programs, Math. Comp., 29, 121-136, 1975.

[l 11 T. Mautor, C . Roucairol, A new exact algorithm for the solution of quadratic assignment problems, Discrete Applied Mathematics 55 (1994) 281-293.

[ 121 L. G. Mitten, Brainch-And-Bound Methods: Gen- eral Formulation And Properties, Operations Research, Vol. 18, 24-34, 1970.

[ 131 M. Perregaard and J Clausen, Solving Large Job Shop Scheduling Problems in Parallel, DIKU report 94/35, accepted for publication in Annals of OR.

427