A Genetic Algorithm with a Tabu Search (GTA) for ... - CiteSeerX

2 downloads 412 Views 277KB Size Report
Email: [email protected] .... temperature is lower, there is less possibility to find a better .... channel is possible to send task messages, result.
SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009

A Genetic Algorithm with a Tabu Search (GTA) for Traveling Salesman Problem R.Thamilselvan1, Dr.P.Balasubramanie2 1

Kongu Engineering College/Computer Science and Engineering, Erode, India Email: [email protected] 2 Kongu Engineering College/Computer Science and Engineering, Erode, India Email: [email protected]

Abstract—One motivation of Grid computing [5] is to aggregate the power of widely distributed resources, and provide non-trivial services to users. To achieve this goal, an efficient Grid scheduling system is an essential part of the Grid. Rather than covering the whole Grid scheduling area, this survey provides a review of the subject mainly from the perspective of scheduling algorithms. This Paper deals with the Traveling Salesman problem with various constraints. The main objective is to minimize the traveling cost and time. Both Genetic and the Tabu search algorithm is tested independently and also tested combine for the Traveling Salesman problem. With the implementation of our approach the cost and time are reduced for the TSP.

Tabu search (TS) [8] is an iterative procedure designed for the solution of optimization problems. TS has been used to solve a wide range of hard optimization problems such as job shop scheduling, graph coloring (related), the Travelling Salesman Problem (TSP) and the capacitated arc routing problem. TS is a meta-strategy for guiding known heuristics to overcome local optimality and has now become an established optimization approach that is rapidly spreading to many new fields. The method can be viewed as an iterative technique which explores a set of problem solutions, denoted by X, by repeatedly making moves from one solution s to another solution s’ located in the neighborhood N(s) of s. These moves are performed with the aim of efficiently reaching an optimal solution by minimizing some objective function f(s).

Index Terms —Genetic Algorithm, Tabu Search, Simulated Annealing, Clustering Algorithm.

I. INTRODUCTION

II. RELATED WORK

Simulated annealing (SA) [5] is a stochastic heuristic algorithm in which the solutions are searched in hill climbing processes constantly commenced by random moves. Because of its ease of use, SA is an extremely popular method for solving large-sized and practical problems like job-shop scheduling, timetabling and travelling salesman. However, for various reasons, like many other search algorithms, SA may become trapped by any local minima, which does not allow moving up or down, or take a long time to find a reasonable solution, which makes the method unpreferable sometimes. Simulated annealing (SA) has been considered a good tool for complex nonlinear optimization problems. The technique has been widely applied to a variety of problems. One of the major drawbacks of the technique is its very slow convergence. SA belongs to the type of local search algorithms [2]. The algorithm chooses an initial solution at random. A neighbor of this solution is then generated by a suitable mechanism and the change in the cost function of the neighbor is calculated. If the reduction in the cost function is obtained, the current solution is replaced by the generated neighbor. On the other hand, if the cost function f of the neighbor is more, the generated neighbor replaced the current solution with the acceptance probability function given by: EXP(-{f[j]-f[i]}/T) where f[j] and f[i] are the cost functions of the generated state and the present state respectively. T is the control parameter which corresponds to the temperature in the physical annealing process.

A. Genetic Algorithm (GA) GA is an evolutionary technique for large space search. The general procedure of GA search is as follows: 1) Population generation: A population is a set of chromosomes and each represents a possible solution, which is a mapping sequence between tasks and machines. The initial population can be generated by other heuristic algorithms, such as Min-min (called seeding the population with a Min-min chromosome). 2) Chromosome evaluation: Each chromosome is associated with a fitness value, which is the makespan of the task-machine mapping this chromosome represents. The goal of GA search is to find the chromosome with optimal fitness value. 3) Crossover and Mutation operation: Crossover operation selects a random pair of chromosomes and chooses a random point in the first chromosome. For the sections of both chromosomes from that point to the end of each chromosome, crossover exchanges machine assignments between corresponding tasks. Mutation randomly selects a chromosome, then randomly selects a task within the chromosome, and randomly reassigns it to a new machine. 4) Finally, the chromosomes from this modified population are evaluated again. This completes one iteration of the GA. The GA stops when a predefined number of evolutions are reached or all chromosomes converge to the same mapping. This genetic algorithm randomly selects chromosomes. Crossover is the process of swapping certain sub-sequences 607

© 2009 ACADEMY PUBLISHER

SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009 in the selected chromosomes. Mutation is the process of assignments, while the other assignments are unchanged. replacing certain sub-sequences with some task-mapping If the new makespan is an improvement, the new solution choices new to the current population. Both crossover and is saved, replacing the current solution. The short hop mutation are done randomly. After crossover and mutation, procedure ends when (1) every pair-wise remapping a new population is generated. Then this new population combination has been exhausted with no improvement, or is evaluated, and the process starts over again until some (2) the limit on the total number of successful hops stopping criteria are met. The stopping criteria can be, for (limithops) is reached. When the short hop procedure example, 1) no improvement in recent evaluations; 2) all ends, the final mapping from the local solution space chromosomes converge to the same mapping; 3) a cost search is added to the tabu list. The tabu list is a method bound is met. of keeping track of the regions of the solution space that have already been searched. Next, a new random B. Simulated Annealing (SA) mapping is generated, and it must differ from each SA is a search technique based on the physical process mapping in the tabu list by at least half of the machine of annealing, which is the thermal process of obtaining assignments (a successful long hop). The intuitive low-energy crystalline states of a solid. At the beginning, purpose of a long hop is to move to a new region of the the temperature is increased to melt the solid. If the solution space that has not already been searched. After temperature is slowly decreased, particles of the melted each successful long hop, the short hop procedure is solid arrange themselves locally, in a stable "ground" state repeated. The stopping criterion for the entire heuristic is of a solid. SA theory states that if temperature is lowered when the sum of the total number of successful short sufficiently slowly, the solid will reach thermal equilibrium, hops and successful long hops equals limithops. Then, the which is an optimal state. By analogy, the thermal best mapping from the tabu list is the final answer. equilibrium is an optimal task-machine mapping (optimization goal), the temperature is the total III. PROPOSED ALGORITHM completion time of a mapping (cost function), and the A. Combined Heuristics change of temperature is the process of mapping change. If the next temperature is higher, which means a worse GA can be combined with TS to create combinational mapping, the next state is accepted with certain probability. heuristics. For example, The Genetic Tabu Search This is because the acceptance of some "worse" states Algorithm (GTA) heuristic is a combination of the GA and provides a way to escape local optimality which occurs TS techniques. In general, GTA follows procedures often in local search. similar to the GA outlined above. However, for the The initial system temperature is the makespan of the selection process, GTA uses the Tabu search process. initial (random) mapping. The initial SA procedure These Nature's heuristics were only relatively implemented here is as follows. The first mapping is introduced into the scheduling area and more work needs generated from a uniform random distribution [10]. The to be done to fit them in a Grid context. There are a lot of mapping is mutated in the same manner as the GA, and interesting questions. First, the meaning of controlling the new makespan is evaluated. If the new makespan is measurements in such heuristics needs to be refined. For better, the new mapping replaces the old one. If the new example, each possible pair of tasks, each possible pair of makespan is worse (larger), a uniform random number machine assignments, while the other assignments are z [0, 1) is selected. Then, z is compared with y, where unchanged. y=1/ (1+e(old makespan – new makespan)/Temperature)

(1)

Table 3.1 Genetic Algorithm pseudo code

If z>y, the new (poorer) mapping is accepted; otherwise it is rejected, and the old mapping is kept. So, as the system temperature "cools", it is more difficult for poorer solutions to be accepted. This is reasonable because when the temperature is lower, there is less possibility to find a better solution starting from another poorer one. After each mutation, the system temperature is reduced to 90% of its current value. (This percentage is defined as the cooling rate.) This completes one iteration of SA. The heuristic stops when there is no change in the makespan for a certain number of iterations or the system temperature approaches zero.

1. 2.

Choose initial population Evaluate the fitness of each individual in the population 3. Repeat until termination: (time limit or sufficient fitness achieved) a. Select best-ranking individuals to reproduce b. Breed new generation through crossover and/or mutation (genetic operations) and give birth to offspring c. Evaluate the individual fitnesses of the offspring d. Replace worst ranked part of population with offspring If the new makespan is an improvement, the new solution is saved, replacing the current solution. Second, there is a trade-off between the search cost and the degree of optimality of solutions found. For example, in a genetic algorithm, historical knowledge can be used to guide the chromosome selection, crossover, or mutation

C. Tabu Search (TS) TS is implemented beginning with a random mapping as the initial solution, generated from a uniform distribution. To manipulate the current solution and move through the solution space, a short hop is performed. The intuitive purpose of a short hop is to find the nearest local minimum solution within the solution space. The basic procedure to perform a short hop is to consider, for each possible pair of tasks, each possible pair of machine 608 © 2009 ACADEMY PUBLISHER

SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009 process so that the search process can converge quickly. But this adjustment seems to contradict the 1. Get the subtask from the central node and p, the philosophy of an evolutionary algorithm: randomization exchange parameter. and diversity generate better results, and it may not bring a 2. while (p . 0) better solution. begin Experiments have shown that a good initial solution for Simulated–annealing (m). TS improves both the quality of the solution as also Send the best solution obtained to execution time. We require m initial solutions for the central node. distributing among m nodes; we choose to combine TS with P=p-2 (loop–iteration–value)8r. GA. end. In GA, an initial population consisting of a set of 3. Run SA. solution is chosen and then the solutions are evaluated. 4. Send the converged value to the central node. Relatively more effective solutions are selected to have more off springs which are, in some way, related to the original solutions. If the genetic operator is chosen properly, A. Implementation of Genetic Tabu Search Algorithm the final population will have better solutions. GA improves In the case of Genetic Tabu Search Algorithm (GTA), the whole population. TS aim at producing one best first the genetic algorithm is run on the central node to get solution. For the TS, we require several good initial the required m initial solutions. These initial solutions are solutions to ensure the required number of good initial used by the m client nodes of the distributed systems as a solution. The pseudo-code for the GA and GTA is given in starting solution for the Tabu Search algorithm. The code the Table 3.1 and Table 3.2 respectively. that is executed on the central node is the same as the code in Table 4.1 except that in step 3 the m schedules is IV. EXPERIMENTS AND RESULTS the best m solutions chosen from the population after applying GA. The genetic algorithm starts with an initial Both the above algorithms have been implemented by population. It then performs the crossover operation and using Alchemi [12] running on a network of 5 the population is updated. This is repeated a number of workstations. It is built on a communication channel. The times for solving TSP. Since the main focus of this paper channel is possible to send task messages, result is to combine GA withTS, for solving TSP. Each machine messages, configure messages and partial result can process only one operation at a time. Each job messages, amount the various nodes of the network. The consists of a sequence of operations in a predefined full implementation details of the algorithm are given in precedence order. The problem is to find a schedule the following sections. having minimum total time (cost), often called Table 3.2 Genetic Tabu Search Algorithm ‘‘makespan’’ [9] of the schedule. The algorithm improves on the initial schedule by generating neighborhood 1. Central node generates n initial solutions using schedules and evaluating. GA. It runs GA for fixed number of iterations, t. a.

2. 3. 4.

Choose initial population of fixed size and set j=1 b. While(j