**7. Mutation based simulated annealing algorithm for minimizing makespan in grid computing systems (MSA)**

SA is a global optimization technique. It derived from the concept of metallurgy which crystallizes the liquid to the required temperature. Traditional SA, as shown in figure 9 (Akella, 2009), explores globally, spending more time in regions which on average have fitter solutions. In the later stages, the search is confined to a small area, and SA optimizes within that area. In these final stages, it is similar to local search.

Instead of population which is used in GA, two solutions are maintained in MSA algorithm at a time.

Interestingly, MSA works iteratively keeping two tentative chromosomes at every iteration. For the first iteration, single exchange mutation operator is applied to initial chromosome, with different genes to produce two new solutions. For the remaining iterations, First chromosome is generated from the previous one by applying single exchange mutation operator to it, while the second chromosome is generated by applying single exchange mutation operator to initial chromosome (generated by Random-MCT algorithm 1), and each one either replaces it or not depending on acceptance criterion. The acceptance criterion works as follows: the old and the new solutions have an associated makespan *Makespan*, determined by a fitness function. If the new solution is better than the old one, then it will replace it, if it is worse, it replaces it with probability P. This probability depends on the difference between their *Makespan* values and control parameter T named temperature. This acceptance criterion provides a way of escaping from local minimum. Therefore, the probability of moving to the new solution decreases exponentially as its fitness gets worse, and also temperature gets lower. Usually temperature is gradually decreased so that uphill movements (for minimization problem) become less and less as the run progresses.

find better solutions in less average time. Note that in table 2 stopping criterion is refered as the total number of *Neighbours*. As *Neighbours* increases, more solutions will be evaluated and larger areas of the search space may be searched. This enhances MSA chances to find the

Task Scheduling in Grid Environment Using Simulated Annealing and Genetic Algorithm 101

In order to make additional comparison with other algorithms, Min-Min algorithm is chosen as a benchmark because most related works evaluated this algorithm (Wael et al., 2011). The idea of algorithm Min-Min is as follows: calculate the shortest execution time of every task, select the shortest task to match a resource, then delete the task. Repeat the steps until all tasks finished. This algorithm takes *O*(*N*2.*M*) time. While computational time complexity of MSA algorithm is expressed as O(*M*.*N*+*Q*.*M*.*N*) or O(*Q*.*M*.*N*), where Q is total number of MSA

In order to measure the final schedule of both algorithms MSA, and RGSGCS, the following

*LBF* <sup>=</sup> *Makespan*

Note that *LBF* measures load balancing of an algorithm's solution, when *LBF* minimizes, algorithm's quality is better. Finally, when *LBF* equals to zero the load balancing of algorithm's solution is optimal. MSA algorithm needs to spend very less time to come up with an optimal solution. Second, average resource utilization is given by the following equation:

*<sup>U</sup>* <sup>=</sup> *mean*(*Cm*)

Where *m* = 1, 2, ··· , *M*. However, according to the simulation results, it is proved that MSA

The simulation results of algorithms RGSGCS, MSA and Min-Min of RM are shown in table 3 for eight different experiments. The reason of testing experimenting is to explore the dynamic behavior of grid environment. For the experiment 1, workloads of tasks are (6, 12, 16, 20, 24, 28, 30, 36, 40, 42, 48, 52, 60) cycles, and the computing capacities of resources are (4, 3, 2) Cycle Per Unit Time(CPUT). The computing capacities of resources, experiments 2 to 8 in the table 3, diverse randomly from 2 to 8 CPUT for each resource. Furthrmore, the workload of tasks ranges randomly from 10 to 150 cycles. The parameters of MSA and RGSGCS are listed in table 2. MSA, Min-Min and RGSGCS are simulated using MATLAB. In table 3, the values of makespan, average time and *LBF* for both algorithms RGSGCS and MSA are compiled together for purpose of comparison. Table 3 and figures( 10 (a), (b) and (c) ) lay out that:

The average gains in time of MSA expressed as percentages are 97.66%, 91.03%, 96.83%, 89.6%, 93.35%, 90.95%, 92% and 92.29% for experiments 1 upto 8 respectively. Hence the total average

*mean*(*Cm*) <sup>−</sup> <sup>1</sup> (8)

*Makespan* (9)

global optimum.

iterations.

parameters are used:

**8. Performance analysis of RGSGCS and MSA**

**9. Simulation results Of RGSGCS and MSA**

gain in time for all the experiments is 92.964%.

First, Load Balancing Factor *LBF*, which is in the following equation:

is effective in speeding up convergence while providing an optimal result.

Fig. 9. Convergence of Simulated Annealing.

In single exchange mutation operator, it picks up two genes of a chromosome selected randomly, then exchanges resource indices between them if these indices are not the same vaue (Wael et al., 2011). The MSA algorithm is described by algorithm 3. In the traditional SA,

#### **Algorithm 3** MSA

1: Choose an initial chromosome *s* ∈ *S* using Random-MCT 2: *i* = 0, *s*<sup>∗</sup> = *s*, *Tinitial* = 1000, *best* = *Makespan*(*s*) 3: *ti* = *Tinitial* 4: **repeat** 5: Generate chromosome *s*1 ∈ *Neighbor*(*s*) by using Single Exchange mutation. 6: Apply using Single Exchange mutation on initial chromosome *s* to generate chromosome *s*2 . 7: Calculate *Makespan*(*s*1) and *Makespan*(*s*2). 8: **for** *l* = 1 to 2 **do** 9: Δ=exp( *Makespan*(*sl*)−*Makespan*(*s*) *ti* ) 10: **if** random[0,1] *<* Δ **then** 11: *s* = *sl* 12: **else** 13: **if** Makespan(*sl*) *>* best **then** 14: *s*∗=*sl* 15: *s* = *s*∗ 16: *best* = *Makespan*(*s*∗) 17: **end if** 18: **end if** 19: **end for** 20: *ti*+1=*ti* × 0.99; 21: **until** *Neighbours* is reached 22: return *s*∗, and best *Makespan*(*s*∗) // Where *Makespan* is makespan value of candidate chromosome.

only one neighborhood solution is created in each temperature. The main difference between MSA and traditional SA is that MSA creates two neighborhood solutions in each temperature using single exchange mutation, and selects one of them according to the probability and the fitness function. Applying this modification to the traditional SA causing MSA algorithm to find better solutions in less average time. Note that in table 2 stopping criterion is refered as the total number of *Neighbours*. As *Neighbours* increases, more solutions will be evaluated and larger areas of the search space may be searched. This enhances MSA chances to find the global optimum.

In order to make additional comparison with other algorithms, Min-Min algorithm is chosen as a benchmark because most related works evaluated this algorithm (Wael et al., 2011). The idea of algorithm Min-Min is as follows: calculate the shortest execution time of every task, select the shortest task to match a resource, then delete the task. Repeat the steps until all tasks finished. This algorithm takes *O*(*N*2.*M*) time. While computational time complexity of MSA algorithm is expressed as O(*M*.*N*+*Q*.*M*.*N*) or O(*Q*.*M*.*N*), where Q is total number of MSA iterations.
