• No results found

PSI Selection Algorithm: The Particle Swarm Intelligence based Selection

4.4 Proposed Service Selection Algorithms

4.4.2 PSI Selection Algorithm: The Particle Swarm Intelligence based Selection

This section focuses on the proposed Particle Swarm Intelligence based Service Selection algorithm for the Grid services, based on an advanced multi-objective PSO algorithm. The approach relies on the concept of crowding distance, which helps to get a better solution during the match process. A brief description of this concept is given in the next few paragraphs, following which the actual description of the algorithm is provided. The crowding distance concept helps to choose the global best solution in the swarm [58]. It is calculated by first sorting the set of solutions in descending order of the personal best solution in the swarm. And, then the global best is selected from a predefined percentage of this sorted list. For example, if the problem is a maximizing problem, the global best is selected from the top 10% to 20% of the solution, while if the problem is a minimization problem the global best is selected from the bottom of the sorted list. [90]. The motivation for using the crowding distance based PSO algorithm amongst all other multi-objective optimization technique lies in the fact that it provides a better method to select the global best from the personal best solution set achieved in each generations. The crowding distance concept not only helps to diversify the search for the global best solution, which provides a better way of selecting the global best guide, but also avoids getting stuck into the local optima in the solution space. This

overcomes the problem of “biased” matching, found in the traditional requester-service matching algorithm, more efficiently. The traditional requester-service matching algorithm fails to assign services with the requesters appearing later in the list with a good match score. This is because the matching process is sequential, and not simultaneous. Hence, the requesters appearing earlier in the list dominates the overall match score. Using the crowding distance based PSO algorithm, helps to optimize the service requests efficiently by returning a better solution to the problem. Thereby, guaranteeing an unbiased matched solution by using this method. The multi-objective particle swarm optimization algorithm using crowding distance, introduced by Raquel in [90], has provided a great inspiration for this research. The algorithm provided in [90] has been modified to fit the Grid service selection problem description. The PSO algorithm used for solving this problem is named PSI Selection Algorithm, and can be explained as follows:

1. The Objective Function Definition: The definition of objective function is one of the most crucial steps in a swarm intelligence based algorithm. The objective function for this problem is based on the match score Equation 4.3, mentioned earlier in this chapter. It is mathematically represented as f (M V(Rjx,Six), N, n), where M S(Rj,Si) is the average of the

sum of match score of each requester-service pair, such as:

M S(Rj,Si)= PN i,j=1( Pn x=1 M V(Rjx,Six) n ) N 4.4

where, M V(Rjx,Six)represents the match values of the QoS parameters of a certain requester-

service pair, n is number of QoS parameters, and N is the number of requester-service match. A detailed description of the match value concept is given in Section 4.4.1. The objective of the PSI algorithm is to maximize f (M V(Rjx,Six), N, n).

2. Initialization: The second step of the algorithm is to randomly initialize all the particles in the swarm, with the list of requesters and services. This step includes randomly matching the requesters and the services, and generating a match score for the same to initialize the population of particle. Further, the initial velocities of the particle is randomly determined between the range of -max velocity and +max velocity, and then the personal best Pbest

positions for all the particles are initialized. The swarm is then evaluated to give the initial global best guide Gbest, based on the objective function of the problem. In this case, the Gbest

particle is the particle with the maximum match score. The objective function in this case is calculated using the equation mentioned in Equation 4.4. Also, variable named bestpos is defined to keep a track of the Gbest particle in the swarm. A brief pseudo code of PSI

selection process can be seen in Algorithm 4.

3. Core steps of PSI Algorithm: This step is the heart of the PSO algorithm. A counter is set to check the maximum number of iterations has been reached. If the program has reached

the maximum number of iterations, it stops. Otherwise, it executes the following steps: • Evaluate the objective function f(MS(Rj,Si)) for all the particles in the swarm.

• Update the personal best (Pbest) for all the particles.

• Update the global best (Gbest) of the swarm. The global best selection is done based on

the crowding distance concept, which is explained in the following paragraphs. • Update the velocity of each particle, based on the following equation:

V [i] = W × V [i] + R1× (Pbest− P [i]) + R2× (Gbest− P [i]) 4.5

In Equation 4.5, V [i] is the current velocity of the particle P [i]; W is the inertia weight is between the range of 0.5 and 0.3. and R1and R2, are the acceleration constant fixed

at 2. Finally, Pbest and Gbest are the personal and the global best guide of particle P [i]

respectively. The value W , R1 and R2, has an important role in the velocity equation.

The inertia weight W controls the impact of the previous velocities on the current velocity of the particle. It also influences the trade-off between global and local optima, i.e., wide area and narrowed area exploration capabilities of the particles. The inertia weight W is varied between the range of 0.5 and 0.3 over the first 2000 iterations. A greater value of W during the initial iterations avoids getting stuck in the local optima. Whereas a smaller value for the later iterations, i.e., when the particles are closer to the global optima, ensures a better local area search. The role of R1, and R2are similar to that of

W , i.e., both are responsible to influence the impact of Pbest and Gbest respectively, on

the velocity of the particle.

• Update the particle position, P[i]=P[i]+V[i].

This step is continued until the maximum number of iterations is reached.

4. Particle Swarm Parameter Definition: In this section we define the PSO parameters, such as the particle size, no. of iterations, type of problem - minimization or maximization, etc. In this research the particle parameters are fixed as follows:

• Maximum number of iterations: 5000; • Number of particles: 25;

• Acceleration constant 1 (local best influence): 2; • Acceleration constant 2 (global best influence): 2; • Initial inertial weight, default: 0.5;

• Final inertial weight, default: 0.3; • Problem description: maximization;

• Maximum particle velocity: 1;

These values are taken based on previous experiments conducted using PSO, and some are also suggested by the authors of [91, 92]. The next step of the algorithm involves initializing the particle swarm.

5. Crowding Distance calculation: The best global guide in the swarm is selected based on the crowding distance concept, which is one of the most crucial steps in the PSI service selection algorithm. It mainly affects both the convergence capability of the algorithm, based on the personal best solutions of the swarm. In this algorithm, a matrix stores personal best solutions found in the previous iterations for each particle in a descending order. Logically, because it is a maximization problem, the solution with the maximum value in the matrix can be chosen as the global best guide of the particles in the swarm. However, in order to ensure that the particles in the population converge towards the global optima and not a local optima, in PSI algorithm, the global best guide of the particles is randomly selected from the top 20% of the personal best solution matrix. In this case, the number of particles in the swarm is 25, the global best guide is randomly selected in each iteration from the top 5 maximum personal best solution in the sorted matrix. Selecting different global guides for each generation from the specified top part of the sorted list, allows the particles in the population, to diversify their search for the global best particle, hence, gives a better solution.

Algorithm 3: PSI Selection Algorithm

Data: R[ ],S[ ],P[ ],OBJ-FUNC Result: MS,Time

begin

t ←− 0 (Initialize iteration counter) for 1 ≤ i ≤ n do

Randomly initialize P[i] Initialize V[i] =0 Evaluate P[i] Set Pbest of P[i]

Set Gbestof P[n]

while !maxiterations do for 1 ≤ i ≤ n do

Evaluates the given Objective Function Set Pbest of P[i]

Calculate crowding distance (CD) for Pbest[i]

A ←− SortAinDescendingorderof CD Select Gbestfrom top 20% of A

Set Gbestof P[i]

Update Velocity for P[i]

V [i] = W × V [i] + R1× (Pbest− P [i]) + R2× (Gbest− P [i])

Update Position for P[i] P os[i] = V [i] + Curr P os[i] t ←− t + 1

return Gbest

The steps mentioned can be seen above in the pseudo code of the PSI Algorithm in 3. The actual source code for PSI Algorithm can be found in Appendix A, Section A.2. The program iterates until the maximum number of iterations has been reached. Then the algorithm stops, and returns the global best match score derived from the objective function of this problem. In this research the MATLAB PSO Toolbox mentioned in [93] is modified and implemented to perform the experiments and the evaluations. The PSO Toolbox has been modified to fit the Grid service selection problem, and also to accommodate the MOPSO features, such as selecting the global best guide, the inclusion of crowding distance concept, etc. It is important to note that, unlike as mentioned in [1, 90], no mutation and/or crossover operators have been included in this algorithm, as in this problem the number of QoS parameters, and the total number of requesters and services in the pool is fixed, and cannot change over a period of time.