PSO Algorithm for the Traveling Salesman and Other Optimization ...

3 downloads 1429 Views 181KB Size Report
Other Optimization Problems. ... Abstract Particle Swarm Optimization is a general purpose optimization ... Keywords First keyword · Second keyword · More.
Noname manuscript No. (will be inserted by the editor)

PSO Algorithm for the Traveling Salesman and Other Optimization Problems. An OpenMp Implementation Santiago Garcia Carbajal · Fiona Reid · David Corne

Received: date / Accepted: date

Abstract Particle Swarm Optimization is a general purpose optimization method due to Kennedy, Eberhart and Shi. It works by maintaining a swarm of particles moving around the search space influenced by the observed improvements of the other particles. The main advantage of the method is that it does not use the gradient of the function to be optimized, what makes it suitable for problems where the gradient is impossible to derive or expensive in terms of CPU requirement. The performance of the proposed algorithm is tested on a standard problem. Keywords First keyword · Second keyword · More S. Garcia Computer Science Department University of Oviedo Campus de Viesques Office 1.b.15 33206, Gijon Asturias Spain Tel.: +34-985-182487 Fax: +34-985-182156 E-mail: [email protected] F. Reid Edinburgh Parallel Computing Centre Edinburgh Sotland Tel.: +44(0) 131-451-3410 Fax: +44(0)-131-650-6555 E-mail: [email protected] D. Corne Heriot Watt University Edinburgh Sotland E-mail: [email protected]

2

Santiago Garcia Carbajal et al.

1 Introduction. PSO Kennedy & Eberhart (1995) proposed this bio-inspired PSO approach, which can be seen as a population-based optimization algorithm that performs a parallel search on a space of solutions. As an optimization algorithm, the purpose of the individuals in PSO is to find out the best position when they move through the problem space. These individuals in PSO, called particles, are initialized by a randomized velocity and position at the beginning of optimization, and then change their velocities and positions under the companions influence. In the optimization context, several solutions of a given problem constitute a population, called The Swarm. Each solution is seen as a social creature, also called particle. The algorithm imitates the behavior of real creatures making the particles displace over the solution space, eventually finding suboptimal solutions of the problem. These particles search the problems solution space balancing the explotation and the exploration efforts, in the same way as is made in other techniques as Genetic algorithms or Genetic Programming. Each particle has a value associated with it, evaluated with the fitness function of the considered optimization problem. A velocity is also assigned to each particle in order to direct the flight through the problems solution space. The artificial birds show a tendency to follow the best ones among them. At each step, a new velocity value is calculated for each bird, and used to update its position. The process iterates until the stopping condition is satisfied: the best known solution is found, or the maximum number of iterations is reached. The best position a given particle (bird) has ever achieved is called pbest. The best position achieved so far by any particle of the swarm is called gbest. By changing their velocities with individualistic moves or toward pbest and gbest, the particles change their positions. At each step, the nex movement of any particle is generated using a composition of three possibilities: – Move back to its best previous position – Move towards its best neighbors previous position – Move independently

2 PSO parallelization using OpenMp PSO can be sped up considerably by using parallel programming techniques. One of the simplest means of writing a parallel program is to make use of threads. Multihtreading allows a multi-core computer to execute parts of the program concurrently. This can considerably reduce the amount of time required to execute a program. There are many different means of programming threads. Low level methods, such as WIN32/64 threads and POSIX PThreads give your program direct access to the threading capabilities provided by your operating system. Higher level threading models, such as OpenMP abstract

PSO Algorithm for the Traveling Salesman and Other Optimization Problems.

3

Fig. 1 A bird flock in action

threading further to provide parallel constructs that you can use in your program. OpenMP is supported by many C/C++ compilers, including Microsoft Visual C++ and GCC/GPP.

2.1 Multithreading PSO PSO is easy to implement, and relatively easy to make parallel with OpenMP. Consider the main loop for PSO. The following pseudocode shows what is performed for each iteration of PSO. Do For each particle Calculate error based on training data If the error is better set pBest = current weights End set pBest = the particle with the best fitness For each particle Calculate particle velocity Update all particle weights End The first subloop inside of the do loop can be made parallel. In this loop each particle must be evaluated against the training data. This takes considerable time, especially if the training data is large. Generally, 99% of the PSO training time is spent inside this loop. according to our first meditions. Each particle is calculated independent of the other particles. The only overlap between particles is to determine the best particle. However, the best particle is determined after this loop is done. Because of this each particle can be evaluated in parallel, while the other particles are being evaluated.

4

Santiago Garcia Carbajal et al.

Fig. 2 Griewank function.

3 Experiments 3.1 Griewank Function This is a box-constrained continuous single-objecive problem. The objective function is the generalised n-dimensional Griewank functionseen in figure 2. 4 Acknowledgements The work has been performed under the HPC-EUROPA2 project (project number: 228398) with the support of the European Commission - Capacities Area - Research Infrastructures.

Suggest Documents