LNCS 3911 - The Distributed Stigmergic Algorithm for ... - Springer Link

2 downloads 0 Views 396KB Size Report
motor by optimizing the independent geometrical parameters of the ro- tor and the ... There is no universal optimization algorithm to solve such an optimization.
The Distributed Stigmergic Algorithm for Multi-parameter Optimization ˇ and Peter Koroˇsec Jurij Silc Joˇzef Stefan Institute, Computer Systems Department, Jamova 19, 1000 Ljubljana, Slovenia {jurij.silc, peter.korosec}@ijs.si http://csd.ijs.si

Abstract. The paper presents a new distributed Multilevel Ant Stigmergy Algorithm (MASA) for minimizing the power losses in an electric motor by optimizing the independent geometrical parameters of the rotor and the stator. The efficiency of the algorithm, in sequential form, to solve that particular optimization problem has already been shown in literature. However, even if this method offers good quality of solution, it still needs considerable computational time. With distributed implementation of the MASA the computation time is drastically decreased (from one day to few hours) without any noticeable loss in solution quality.

1

Introduction

Multi-parameter optimization is the process of finding the point in the parameter space P = {p1 , p2 , . . . , pD } where a cost function f (P ) is minimized according to the feasible set of parameters pi , i = 1, 2, . . . , D, that satisfy the constraints. Very often this cost function contains information about the problem target and the constraints that the solution has to meet (constrained optimization). These constraints define the region of the design space where the solution has to be comprised – called the feasibility region. Optimizing a multi-parameter function is usually a continuous problem. There is no universal optimization algorithm to solve such an optimization problems. Many of the problems arising in real-life applications are NP-hard. Hence, one usually solves large instances with the use of approximate methods that return near-optimal solutions in a relatively short time. Algorithms of this type are called heuristics. The upgrade of a heuristic is a metaheuristic [1]: a set of algorithmic concepts that can be used to define a heuristic method applicable to a wider set of different problems. A particularly successful metaheuristic based on stigmergy is observed in colonies of real ants [2]. Stigmergy is a method of communication in decentralized systems in which the individual parts of the system communicate with one another by modifying their local environment. It was first observed in nature as a class of mechanisms that mediate animalanimal interactions (e.g., ant trails, termite nest-building, ant corpse-gathering). The term stigmergy (from the Greek στ ιγμα = sting, and εργoς = work) was originally defined by the French biologist Pierre-Paul Grass´e in his pioneering R. Wyrzykowski et al. (Eds.): PPAM 2005, LNCS 3911, pp. 92–99, 2006. c Springer-Verlag Berlin Heidelberg 2006 

The Distributed Stigmergic Algorithm for Multi-parameter Optimization

93

studies on the reconstruction of termite nests [4]. He defined it as: “Stimulation of workers by the performance they have achieved.” Ants communicate with one another by laying down pheromones along their trails, so an ant colony is a stigmergic system. An ant-colony metaheuristic is normally used for solving discrete, combinatorial optimization problems, but in this paper we will show a successful implementation on a numerical, multi-parameter optimization problem that is often solved by algorithms for continuous optimization. Because of the nature of the ant-based algorithms we first had to discretize the continuous, multi-parameter problem and translate it into graph representation. The rest of the paper is organized as follows. The Ant Stigmergy Algorithm is defined in Section 2. In Section 3, the multilevel approach is explained. We round up with the Distributed Multilevel Ant Stigmergy Algorithm is described in Section 4, followed by application of the algorithm to the electric motor design in Section 5. Finally, we conclude the paper in Section 6.

2

The Ant Stigmergy Algorithm

In this section, we introduce the basic concept and major issues pertaining to ant stigmergy algorithm. First, we translate the multi-parameter problem into a directed graph and then use some sort of optimization technique to find the cheapest path in the constructed graph; this path consists of the values of the optimized parameters. In our case, we use an optimization algorithm, the routes of which can be found in the ant-colony optimization (ACO) method [3]. The so-called Ant Stigmergy Algorithm (ASA) consists of two main phases: (a) initialization and (b) optimization (see Fig. 1). graph = Initialization(parameters) GraphInitialization(initial pheromone amount) while not ending condition do for all ants in colony do path = FindPath(probability rule) Evaluate(path) end for UpdatePheromone(all found paths vertices) DaemonAction(best path) EvaporatePheromone(all vertices) end while Fig. 1. The pseudocode of the Ant Stigmergy Algorithm

(a) Initialization consists of translation the parameters of the problem into a search graph. This way we translate the multi-parameter problem into a problem of finding the cheapest path. For each parameter pd , d = 1, . . . , D, parameter value vd,i , i = 1, . . . , nd , nd = |pd |, represents one vertex in a search graph, and each vertex is connected to all the vertices that belong to the next parameter

ˇ and P. Koroˇsec J. Silc

94

pd+1 . Once we have translated the multi-parameter problem into one of finding the cheapest path, we can deploy the initial pheromone values on all the vertices. (b) Optimization consists of finding the cheapest path. We have a number of ants that all simultaneously start from the start vertex. The probability with which they choose the next vertex depends on the amount of pheromone on the vertices. The ants use a probability rule to determine which vertex will be chosen next. The ants repeat this action until they get to the ending vertex. Now we evaluate the gathered parameter values of each ant (that can be found on its path). Then each ant returns to the start vertex and on the way it deposits pheromones on the vertices according to the evaluation result: the better the result the more pheromone is deposited on the vertices, and vice versa. After all the ants return to the start vertex we do a so-called daemon action; this consists of depositing some additional pheromones on what is currently the best path, and also a smaller amount on a neighboring path. Afterwards, the pheromones are evaporated on all vertices, i.e., the amount of pheromones is decreased by some predetermined percentage on each vertex. The whole procedure is repeated until some ending condition is met.

3

Multilevel Approach

We considered the multilevel approach and its potential to aid the solution of optimization problems. The multilevel approach is a simple one, which at its most basic involves recursive coarsening to create a hierarchy of approximations to the original problem. An initial solution is found (sometimes for the original problem, sometimes at the coarsest level) and then iteratively refined at each level. As a general solution strategy the multilevel procedure has been in use for many years and has been applied to many problem areas [9]. The multilevel approach consists of two main phases: (a) coarsening and (b) refinement. (a) Coarsening is done by merging two or more neighboring vertices into one vertex; this is done in L iterations (we call them levels = 1, 2, . . . , L). Let us coars consider coarsening from level to level + 1 at a distance d: Vd −→ Vd+1 .    Here Vd = {vd,1 , . . . , vd,n  } is a set of vertices at level and distance d d

of the search graph G, where 1 ≤ d ≤ D. If n1d is the number of vertices at a starting level of coarsening and distance d, then for every level the equan tion n+1 =  sd  is true, where sd is number of vertices at level , which d d

merge into one vertex at level + 1. So what we do is we divide Vd into n+1   d n+1 subsets, where Vd = k=1 Vd,k , ∀i, j ∈ {1, . . . , n+1 d d } ∧ i = j : Vd,i ∩      Vd,j = ∅. Each subset is defined as follows: Vd,1 = {vd,1 , . . . , vd,s  }, Vd,2 = d

     {vd,s = {vd,(n , . . . , vd,n  +1 , . . . , vd,2s  }, . . . , V +1   }. d,n+1  −1)s +1 d

d

d

d

d

d

The Distributed Stigmergic Algorithm for Multi-parameter Optimization

95

+1 +1 Set Vd+1 = {vd,1 , . . . , vd,n +1 } is a set of vertices at distance d at level +1,  d

+1  ∈ Vd,k is selected on some predetermined principle. For example, where vd,k random pick, the most left/right/centered vertex in the subset, etc. The outline of the Coarsening() pseudo code is as follows: +1  for k = 1 to n+1 do vd,k = SelectOneVertex(Vd,k ) d

(b) Refinement: Because of the simplicity of the coarsening, the refinement itself is trivial. Let us consider refinement from level l to level l − 1 at distance d: ref in Vd −→ Vd−1 . The outline of the Refinement() pseudo code is as follows: for k = 1 to nd do −1 −1 −1  for each vd,i ∈ Vd,k do vd,i = vd,k end for

Now, we merge the ASA and multilevel approach into one. This method is called the Multilevel Ant Stigmergy Algorithm (MASA) (see Fig. 2). graph = Initialization(parameters) for  = 1 to L do Coarsening(graph[]) end for GraphInitialization(initial pheromone amount) for  = L downto 1 do while not current level ending condition do for all ants in colony do path = FindPath(probability rule) Evaluate(path) end for UpdatePheromone(all found paths vertices) DaemonAction(best path) EvaporatePheromone(all vertices) end while Refinement(graph[]) end for Fig. 2. The pseudocode of the Multilevel Ant Stigmergy Algorithm

4

Distributed Algorithm

Like many other metaheuristic approaches, the MASA admits direct parallelization schemes and parallelism can be exploited at one or more scales [8]. In our implementation, we decide on the largest scale where entire searches can be performed concurrently. Such implementation, called parallel interacting ant colonies [7], is based on the well-known server/client approach. Non-distributed MASA approach presented in previous section base on single ant colony. But in distributed approach, we split this colony into N sub-colonies, where N represents number of processors. Each sub-colony searches for a solution according to the following algorithm:

ˇ and P. Koroˇsec J. Silc

96 Server:

StartAllClients() while not ending condition do if ReceivedEvaluatedPaths(client) then BroadcastPaths(all other clients) end if end while StopAllClients()

Client:

graph = Initialization(parameters) for  = 1 to L do Coarsening(graph[]) end for GraphInitialization(initial pheromone amount) for  = L downto 1 do while not current level ending condition do for all ants in sub-colony do path = FindPath(probability rule) Evaluate(path) end for SendEvaluatedPathsToServer(all ants) ReceivePathsFromServer(from all other clients) UpdatePheromone(all found and received paths vertices) DaemonAction(best path) EvaporatePheromone(all vertices) end while Refinement(graph[]) end for

Fig. 3. The pseudocode of the Distributed Multilevel Ant Stigmergy Algorithm

This algorithm is similar to the MASA in previous section, except that at given iterations, an exchange of information between the sub-colonies occurs. With the use of SendEvaluatedPathsToServer() function the paths with update pheromone amount is send to server which then with the use of BroadcastPaths() function broadcasts this information to all other clients (sub-colonies). The update pheromone amount is determined by Evaluate() function. On the other hand, the information (paths with updated pheromone amount) is gathered from other sub-colonies with the use of ReceivePathsFromServer() function. The last difference is in the UpdatePheromone() function. Here the pheromone is not deposited only on found paths but also on a received ones.

5

The Case Study

In a conventional design procedure for an electric motor the initial estimation for the geometry of the rotor and the stator is made by an experienced engineer. The suitability of this geometry is then usually analyzed by means of a numerical simulation of the electromagnetic field. The manual procedure is repeated until the satisfied evaluation results are obtained. The advantage of this

The Distributed Stigmergic Algorithm for Multi-parameter Optimization

97

approach is that with their experience the engineers can significantly influence the progress of the design process and react intelligently to any noticeable electromagnetic response with proper geometry redesign. However, this conventional design approach can be upgraded with stochastic optimization techniques which, in connection with reliable numerical simulators, allow for highly automated design process where the need for an experienced engineer to navigate the process is significantly reduced. Actually this is multi-parameter optimization. The usefulness and efficiency of the ant-based metaheuristic, in sequential form, to solve the problem of minimizing the losses in an electric motor has already been shown in our previous work [5]. The average solution obtained with the algorithm is 25% better than a solution recently found using a genetic approach [6]. The efficiency of an electric motor is defined as the ratio of the output power to the input power and depends on various power losses. They include copper losses, iron losses, and additional losses, such as brush losses, and losses due to ventilation and friction, but the last three losses are not significantly affected by the geometry of the rotor and the stator. The optimization task is to find the geometry parameter values that would generate the rotor and the stator geometry with minimum power losses. There are several invariable and variable parameters that define the rotor and the stator geometry [6]. Invariable parameters are fixed; they cannot be altered, either for technical reasons (e.g., the air gap) or because of the physical constraints on the motor (e.g., the radius of the rotor’s shaft). Variable parameters do not have predefined optimum values. Some variable parameters are mutually independent and without any constraints. Others are dependent, either on some invariable parameters or on mutually independent ones. In our case, 10 mutually independent variable parameters defining the rotor and the stator geometry are subject to optimization. The optimization task is to find the geometry parameter values that would generate the rotor and the stator geometry with minimum power losses. To evaluate settings of the rotor and the stator geometry parameters with respect to the resulting power losses, we used the ANSYS finite-element method simulation package. The evaluation of a single solution is time consuming task. For example, evaluation through ANSYS simulation on an AMD OpteronTM 1.8 GHz computer takes approximately one minute. To find an acceptable solution a few thousand evaluations are needed. These two facts alone motivated us in implementation of distributed MASA. The computer platform used to perform the experiments was 8-node cluster connected via Giga-bit switch, each node consisted of two AMD OpteronTM 1.8 GHz processors and 2 GB of RAM. In the experiments, the stopping criterion for the MASA was given by the number of solutions to be evaluated. It was set to 2240 evaluations per run and this value was chosen considering the computational complexity of the optimization procedure. Other algorithm parameters were set as follows. The MASA operated with seven levels, at each level all ants in sub-colony climbs down the graph 20 times (“level ending condition”). Total number of ants in all

98

ˇ and P. Koroˇsec J. Silc

Table 1. An optimized electric motor by the distributed MASA (power losses [W])

Best Worst Mean ± Std

1 120.63 128.71 124.45 ± 2.33

Number of processors N 2 4 122.26 122.86 129.74 138.46 125.28 ± 2.83 129.36 ± 4.85

8 129.30 136.47 133.34 ± 3.18

sub-colonies is 16, while the number of ants in each sub-colony depends on the number of processors: eight ants for N = 2, four for N = 4, and two for N = 8. For each distribution (N = 1, 2, 4 or 8), we ran our algorithm 10 times where we compared solution quality and computational time. In Table 1 we can see that the MASA optimizes electric motor design with power losses in range from 120.63 W to 138.46 W. Even the worst found solution is still much better that the one found by an expert designer (177.9 W) and it is used in production. More detailed examination of Table 1 reveals a slight degradation of solution quality with increasing number of processors. The main reason for this is in huge percent (approx. 99.98%) of infeasible solutions in the search space and in fact that the evaluation of feasible solution is 60 times more time consuming than the evaluation of infeasible solution. Let us consider example with one and eight processors. In the first case (N = 1) 16 ants climb down simultaneously while in the second one (N = 8) two ants climb down simultaneously in each processors. If in the first case only one ant finds a feasible solution, the rest of 15 ants waits for this ant to finish solution evaluation and do not search for new feasible solutions. But already in the next climb down all 16 ants use this newly acquired information(gathered from the ant from previous climb down). So, 15 searches for feasible solution were done without this information at the most. Now, let us take into account the second case. If again only one ant finds a feasible solution then just the ant on the same processor waits, but all the rest of the ants (14) search for new feasible solutions undisturbed. Here it is possible that none of 14 ants do not use this information. For example, if in the first climb down of the current level one ant finds a feasible solution it takes approx. 60 seconds to evaluate it. In the mean time on all the other processors the climb downs continue and if none of the ants find a feasible solution all of the predetermined number of evaluations per level is used without the use of knowledge gathered by the evaluation of the solution of the first ant. This scenario can not happen in the first case (where N = 1) where 15 searches were lost at the most. Table 2. Computation time in [min]

Best Worst Mean ± Std

1 1295 1552 1481 ± 81

Number of processors N 2 4 623 254 811 396 702 ± 61 332 ± 40

8 113 198 182 ± 11

The Distributed Stigmergic Algorithm for Multi-parameter Optimization

99

In Table 2 we see that speed-up is greater than N , which only confirms our statement from previous paragraph that number of infeasible solutions increases with the number of processors.

6

Conclusion

In this paper we presented a new distributed multilevel ant stigmergy algorithm for minimizing the power losses in an electric motor by optimizing the independent geometrical parameters of the rotor and the stator. We have showed that with distributed computing we can drastically decrease the computation time (from one day to few hours) without any noticeable loss in solution quality.

References 1. Blum, C., Roli, A.: Metaheuristics in combinatorial optimization: Overview and conceptual comparison. ACM Comput. Surv. 35 (2003) 268–308 2. Dorigo, M., Bonabeau, E., Theraulaz, G.: Ant algorithm and stigmergy. Future Gener. Comp. Sy. 16 (2000) 851–871 3. Dorigo, M., Di Caro, G., Gambardella, L.M.: Ant algorithms for discrete optimization. Artif. Life 5 (1999) 137–172 4. Grass´e, P.-P.: La reconstruction du nid et les coordinations inter-individuelles chez Bellicositermes natalensis et Cubitermes sp. La th´eorie de la stigmergie. Ins. Soc. 6 (1959) 41–81 ˇ 5. Koroˇsec, P., Silc, J.: The multilevel ant stigmergy algorithm: An industrial case study. Proc. 8th Joint Conference on Information Sciences, Salt Lake City, UT, July 2005, pp. 475–478 6. Papa, G., Korouˇsi´c-Seljak, B.: An artificial intelligence approach to the efficiency improvement of a universal motor. Eng. Appl. Artif. Intel. 18 (2005) 47–55 7. Randall, M., Lewis, A.: A parallel implementation of ant colony optimization. J. Parallel Distr. Com. 62 (2002) 1421–1432 8. St¨ utzle, T.: Parallelization strategies for ant colony optimization. Lect. Notes Comp. Sc. 1498 (1998) 722–741 9. Walshaw, C.: Multilevel refinement for combinatorial optimisation problems. Ann. Oper. Res. 131 (1-4) (2004) 325–372