# Modeling Interacting Galaxies Using a Parallel Genetic Algorithm

## 1. Introduction

A major problem in modeling of encounters of galaxies is the extended parameter space which is composed by the orbital and the structural parameters of the interacting galaxies. Traditional grid-based fitting strategies suffer from very large CPU-requirements. E.g. for a restricted 7-dimensional parameter space (an encounter of a disc with a point mass) and a resolution of only 5 values per dimension, one needs 78125 models, or about 26 years of integration time on a GRAPE3af special purpose computer for a ”complete” grid. More systematic search strategies like gradient methods depend strongly on the initial conditions, which makes them prone to trapping in local optima. An efficient alternative approach are evolutionary methods and especially genetic algorithms (Holland 1975, Goldberg 1989, Charbonneau 1995). In combination with fast (but not self-consistent) restricted N-body-codes (Toomre & Toomre 1972) they allow for an efficient search in parameter space which can be used for both, an automatic search of interaction parameters (provided sufficiently accurate data are available) and/or a uniqueness test of a preferred parameter combination (Wahde 1998, Theis 1999).

The basic idea of GAs is to apply an evolutionary mechanism including ’sexual’ reproduction operating on a population which represents a group of different parameter sets. All members are characterized by their fitness which quantifies the correspondance between simulations and observations. In order to determine the ’parents’ two individuals are selected according to their fitness. These parents represent two points in parameter space. The corresponding parameter set is treated like a ’chromosome’, i.e. it is subject to a cross-over and a mutation operation resulting in a new individual which is a member of the next generation. Such a breeding is repeated until the next generation has been formed. Finally, the whole process of sexual reproduction is repeated iteratively until the population confines one or several regions of sufficiently high fitness in parameter space.

Here we present a parallel implementation of our genetic algorithm.

## 2. Parallelization of the genetic algorithm

We parallelized our code on the level of the GA by applying a ’master-slave’ technique using message passing (MPI). On the master processor all the reproduction operations are performed. It sends the individual parameter sets to the slave processors which do the N-body simulations and determine the corresponding fitness values (Fig. 1 left). The speed-up, i.e. the ratio of CPU-times $`t_1`$ and $`t_N`$ used by a calculation with one or $`N`$ processors, respectively, reaches values between 30 and 60 for 100 processors (Fig. 1 right). The deviation from the optimal gain is mainly caused by the spread of CPU-times required for the individual simulations. It becomes more important with decreasing population size. By parallelization the whole GA-fit using 10000 models reduces to less than 3 CPU minutes on a CRAY T3E. Thus, an ’interactive’ analysis becomes possible.

### Acknowledgments.

The authors are grateful to Paul Charbonneau and Barry Knapp for providing their (serial) genetic algorithm pikaia. C.T. thanks for the support by the organizers of the 15th IAP meeting.

## References

Charbonneau P., 1995, ApJS, 101, 309

Goldberg D.E., 1989, Genetic Algorithms in Search, Optimization, & Machine Learning, Addison-Wesley, Reading

Holland J., 1975, Adaptation in natural and artificial systems, Univ. of Michigan Press, Ann Arbor

Theis Ch., 1999, Rev. Mod. Astron., 12, 309

Toomre A., Toomre J., 1972, ApJ, 178, 623

Wahde M., 1998, A&AS, 132, 417