• 沒有找到結果。

The Process to Develop a New Particle Swarm Optimization

CHAPTER 3 DEVELOPING A PARTICLE SWARM OPTIMIZATION FOR A

3.5 The Process to Develop a New Particle Swarm Optimization

As mentioned above, we separated PSO into several parts. The particle position representation determines the program data structure and other parts are designed for the specific particle position representation. Therefore, the first step of developing a new PSO is to determine the particle position representation. Then design particle

representation. Finally implement some search strategies for further improving solution quality. Figure 3.1 shows the process to develop a new particle swarm optimization. All the PSOs in this research are developed by the process described as Figure 3.1.

Figure 3.1 The process to develop a new particle swarm optimization Design particle position representation

Design particle velocity and particle movement for the specific particle position representation

Design decoding operator for the specific particle position

representation

Implement other search strategies

(#optional)

CHAPTER 4

A DISCRETE BINARY PARTICLE SWARM

OPTIMIZATION FOR THE MULTIDIMENSIONAL 0-1 KNAPSACK PROBLEM

Kennedy and Eberhart (1997) proposed a discrete binary particle swarm optimization (DPSO), which was designed for discrete binary solution space. Rastegar et al. (2004) proposed another DPSO based on learning automata. In both of the DPSOs, when particle k moves, its position on the jth variable x equals 0 or 1 at kj random. The probability that x equals 1 is obtained by applying a sigmoid kj transformation to the velocity v ))kj (1/1+exp(−vkj . In the above two DPSOs, the positions and velocities of particles can be updated by the following equations:

) between 0.9975 and 0.0025.

The DPSOs proposed by Kennedy and Eberhart (1997) and Rastegar et al. (2004) are designed for discrete binary optimization problems with no constraint. However, there are resource constraints in MKP. If we want to solve MKP by DPSO, we have to modify DPSO to fit the MKP characteristics.

There are two main differences between the DPSO in this chapter and the DPSOs

in previous research: (i) particle velocity and (ii) particle movement. The particle velocity is modified based on the tabu list and the concept of building blocks, and then the particle movement is modified based on the crossover and mutation of the genetic algorithm (GA). Besides, we applied the repair operator to repair solution infeasibility, the diversification strategy to prevent particles becoming trapped in local optima, the selection strategy to exchange good blocks between particles, and the local search to further improve solution quality. The computational results show that our DPSO effectively solves MKP and better than other traditional algorithms.

4.1 Particle Position Representation

In out DPSO, the particle position is represented by binary variables. For a MKP with n items, we represent the particle k position by n binary variables, i.e.

] , , ,

[ k1 k2 kn

k x x x

x = K

Where xkj

{ }

0,1 denotes the value of jth variable of particle k’s solution. Each time we start a run, DPSO initializes a population of particles with random positions, and initializes the gbest solution by a surrogate duality approach (Pirkul, 1987). We determine the pseudo-utility ratio uj = pj

mi= yirij

/ 1 for each variable, where yi is the shadow price of the ith constraint in the LP relaxation of the MKP. To initialize the gbest solution, we set gbestj ←0 for all variable j and then add variables (gbestj ←1) into the gbest solution by descending order of uj as much as possible without violating any constraint.

Initializing the gbest solution has two purposes. The first is to improve the consistency of run results. Because the solutions of DPSO are generated randomly, the computational results will be different in each run. If we give DPSO the same initial point of gbest solution in each run, it may improve result consistency. The second

purpose is to improve result quality. Similar to other local search approaches, a good initial solution can accelerate solution convergence with better results.

4.2 Particle Velocity

When PSO is applied to solve problems in a continuous solution space, due to inertia, the velocity calculated by equation (4.1) not only moves the particle to a better position, but also prevents the particle from moving back to the previous position. The larger the inertia weight, the harder the particle backs to the current position. The DPSO velocities proposed by Kennedy and Eberhart (1997) and Rastegar et al. (2004) move particles toward the better position, but cannot prevent the particles from being trapped in local optima.

We modified the particle velocity based on the tabu list, which is applied to prevent the solution from being trapped in local optima. In our DPSO, each particle has its own tabu list, the velocity. There are two velocity values, v and kj v′ , for kj each variable x . If kj x changes when particle k moves, we set kj vkj←1 and v′kj

x . When kj v equals 1, it means that kj x has changed, variable j was added into the kj tabu list of particle k, and we should not change the value of x in the next few kj iterations. Therefore, the velocity can prevent particles from moving back to the last position in the next few iterations. The value of v′ is used to record the value of kj x kj

after the value of x has been changed. The set of variable kj v′ is a “block” which kj is a part of a solution that particle k obtained from the pbest solution and gbest solution. It is applied to the selection strategy with the concept of building blocks that we will describe in section 4.6.

In our DPSO, we also implement inertia weight w to control particle velocities where w is between 0 and 1. We randomly update velocities at the beginning of each

iteration. For each particle k and jth variable, if v equals 1, kj v will be set to 0 with kj probability (1- w ). This means that if variable x is in the tabu list of particle k, kj variable x will be dropped from the tabu list with probability (1- w ). Moreover, the kj exploration and exploitation can be controlled by w . The variable x will be held kj in the tabu list for more iterations with a larger w and vice versa. The pseudo code of updating velocities is given in Figure 4.1.

for each particle k and variable j do rand ~ U(0,1)

if (vkj =1)and (randw) then

←0 vkj

end if end for

Figure 4.1 Pseudo code of updating velocities.

4.3 Particle Movement

In the DPSO we proposed, particle movement is similar to the crossover and mutation of GA. When particle k moves, if x is not in the tabu list of particle k (i.e. kj

v =0), the value of kj x will be set to kj pbest with probability kj c (if 1

xkjpbest ), set to kj gbest with probability j c (if 2 xkjgbest ), set to (1-j x ) kj with probability c , or not changed with probability (1-3 c -1 c -2 c ). Where 3 c , 1 c , 2 and c are parameters of the algorithm with 3 c1+c2 +c3 ≤1 and ci ≥0, i=1, 2, 3.

Since the value of x may be changed by repair operator or local search kj procedure (we will describe them in section 4.4 and in section 4.7 respectively), if x kj is in the tabu list of particle k (i.e. v = 1), the value of kj x will be set to the value of kj v′ which is the latest value that kj x obtained from the pbest solution or gbest kj

solution. At the same time, if the value of x changes, we update kj v and kj v′ as kj we mentioned in section 4.2. The pseudo code of particle movement is given in Figure

4.2.

Figure 4.2 Pseudo code of particle movement.

4.4 Repair Operator

After a particle generates a new solution, we apply the repair operator to repair solution infeasibility and to improve it. There are two phases to the repair operator.

The first is the drop phase. If the particle generates an infeasible solution, we need to drop (xkj ←0, if xkj =1) some variables to make it feasible. The second phase is the add phase. If the particle finds a feasible solution, we add (xkj ←1, if xkj =0) more variables to improve it. Each phase is performed twice: the first time we consider the particle velocities, and the second time we do not consider the particle velocities.

Similar to initializing the gbest solution described in section 4.1, we applied the Pirkul (1987) surrogate duality approach to determine the variable priority for adding or dropping. First, we determine the pseudo-utility ratio uj = pj

mi= yirij

/ 1 for each variable, where y is the shadow price of the ii th constraint in the LP relaxation of the MKP. We drop variables by ascending order of u until the solution is feasible, and j then we add variables by descending order of u as much as possible without

violating any constraint. The pseudo code of repair operator is given in Figure 4.3.

Ri = the accumulated resources of constraint i

U permutation of (1,2,…,n) with uU[j]uU[j+1] (j = 1,…, n-1)

Figure 4.3 Pseudo code of repair operator

4.5 The Diversification Strategy

If the pbest solutions are all the same, the particles will be trapped in local optima. To prevent such a situation, we propose a diversification strategy to keep the pbest solutions different. In the diversification strategy, the pbest solution of each particle is not the best solution found by the particle itself, but one of the best N solutions found by the swarm so far where N is the size of the swarm.

The diversification strategy is performed according to the following process.

After all of the particles generate new solutions, for each particle, compare the particle’s fitness value with pbest solutions. If the particle’s fitness value is better than the worst pbest solution and the particle’s solution is not equal to any of the pbest solutions, replace the worst pbest solution with the solution of the particle. At the same time, if the particle’s fitness value is better than the fitness value of the gbest solution, replace the gbest solution with the solution of the particle. The pseudo code of updating pbest solutions is given in Figure 4.4.

k is the index of the worst pbest solution *

Figure 4.4 Psudo code of updating pbest solutions.

4.6 The Selection Strategy

Angeline (1998) proposed a selection strategy, which is performed as follows.

After all the particles move to new positions, select the s best particles. The better particle set S ={k1,k2,K,ks) replaces the positions and velocities of the other particles. The addition of this selection strategy should provide the swarm with a more exploitative search mechanism that should find better optima more consistently.

We modified the method proposed by Angeline (1998) based on the concept of building blocks where a block is part of a solution, and a good solution should include some superior blocks. The concept of building blocks is that if we can precisely find out the superior blocks and accumulate the superior blocks in the population, the genetic algorithm will perform better (Goldberg, 2002).

Find out the s best particles S ={k1,k2,K,ks)

Figure 4.5 Pseudo code of selection strategy.

In our DPSO, the velocities vk′ ={vk1,vk2,K,vkn′ } is a block that particle k obtained from pbest solution and gbest solution in each iteration. The v′ may be a k superior block if the solution of particle k is better then others. Therefore, in our modified selection strategy, the better particle set S only replaces the velocities (i.e.

v and k v′ ) of the other particles. The pseudo code of selection strategy is given in k Figure 4.5.

4.7 Local Search

We implement a local search procedure after a particle generates a new solution for further improved solution quality. The classical add/drop neighborhood is that we remove a variable from the current solution and add another variable to it without violating any constraint at the same time. We modified the neighborhood with the concept of building blocks to reduce the neighborhood size. We focus on the block when we implement a local search. The variables are classified to 4 sets:

} 0

|

0 ={j xkj =

J , }J1 ={j|xkj =1 , }J0′ ={j|xkj =0∧vkj =1 , and J1′ ={j|xkj =1 }

=1

vkj . The modified neighborhood is defined as follows: add (or drop) one variable from J0′ (or J1′) and drop (or add) one variable from J (or 1 J ) without 0

violating any constraint at the same time. In our experiment, the size of the modified neighborhood is about twenty times smaller then the classical one. Besides, we add variables by descending order of p as much as possible without violating any j constraint after the add/drop process.

Ri = the accumulated resources of constraint i

// Add/drop local search begin 0 // Add/drop local search end

// Add more variables begin do

// Add more variables end for

end

Figure 4.6 Pseudo code of local search procedure.

We do not repeat the local search until the solution reaches the local optima. The local search procedure is performed four times at most for reducing the computation time and preventing being trapped in local optima. The pseudo code of local search is given in Figure 4.6.

4.8 Computational Results

Our DPSO was tested on the problems proposed by Chu and Beasley (1998).

These problems are available on the OR-Library web site (Beasley, 1990) (URL:

http:// people.brunel.ac.uk/~mastjjb/jeb/info.html). The number of constraints m was set to 5, 10, and 30, and the number of variables n was set to 100, 250, and 500. For each m-n combination, thirty problems are generated, and the tightness ratio α (α =bi/

nj=1rij ) was set to 0.25 for the first ten problems, to 0.5 for the next ten problems, and to 0.75 for the remaining problems. Therefore, there are 27 problem sets for different n-m-α combinations, ten problems for each problem set, and 270 problems in total.

The program was coded in Visual C++, optimized by speed, and run on an AMD Athlon 1800+ PC. The numeric parameters are set to c1 =0.7, 1c2 =0. , c3 =1/n, N = 100, and s = 20. The inertia weight w is decreased linearly from 0.7 to 0.5 during a run. Allof the numeric parameters are determined empirically.There are two versions of our DPSO. The first version, DPSO, does not implement the local search procedure, and the second, DPSO+LS, implements the local search procedure. Each run will be terminated after 10,000 iterations on DPSO and 15,000 iterations on DPSO+LS, respectively.

The program performs 10 runs for each of the 270 problems. The term ‘Best’ is

according to the 10 problems of the problem set. The term ‘Average’ is applied to the average solution of 10 runs of each problem and averaged according to the 10 problems of the problem set.

t* is the average time in seconds that the DPSO or DPSO+LS takes to first reach the final best solution in a run, and T is the total time in seconds that the DPSO or DPSO+LS takes before termination in a run. The surrogate duality was pre-calculated by MATLAB, so the computation times in Table 4.1 do not include the computation time of calculating surrogate duality. The average computation time for solving LP relaxation problems was less then 1 CPU second, so the surrogate duality calculation is not important to computation time.

The computational results are shown in Table 4.1. The algorithms have different computation times, so we compared DPSO with GA (Chu and Beasley, 1998) since their computation times are similar. The computational results show that DPSO performed better than GA (Chu and Beasley, 1998) in 20 of 27 problem sets.

We compared DPSO+LS with Fix+Cuts (Osorio et al., 2002) and LP+TS (Vasquez and Hao, 2001). The Fix+Cuts (Osorio et al., 2002) takes 3 hours on a Pentium III 450 MHz PC for each run, and LP+TS (Vasquez and Hao, 2001) takes about 20-40 minutes on a Pentium III 500 MHz PC for each run. Our DPSO+LS takes less than 8 minutes on the largest problems and our machine is about four times faster than Fix+Cuts (Osorio et al., 2002) and LP+TS (Vasquez and Hao, 2001), so the computation time that DPSO+LS takes is similar to LP+TS (Vasquez and Hao, 2001) and much less than Fix+Cuts (Osorio et al., 2002). The computational results show that DPSO+LS performed better than Fix+Cuts (Osorio et al., 2002) in 15 of 27 problem sets, and better than LP+TS (Vasquez and Hao, 2001) in all of the 9 largest problem sets.

Table 4.1 Computational results 500 10 0.25 118566 118584 118600 118629 118569 118540.8 26.4 58.0 118605 118580.7 242.8 467.5 500 10 0.5 217275 217297 217298 217326 217295 217260.6 25.6 59.4 217312 217288.6 216.0 459.0 500 10 0.75 302556 302562 302575 302603 302572 302553.4 22.1 59.5 302591 302577.3 165.8 434.0 500 30 0.25 115474 115520 115547 115624 115481 115435.6 31.0 69.8 115559 115493.0 208.1 454.6 500 30 0.5 216157 216180 216211 216275 216188 216138.2 28.8 73.8 216221 216184.8 189.4 452.0 500 30 0.75 302353 302373 302404 302447 302369 302343.7 26.4 76.7 302405 302382.9 193.2 438.0 Average 120153.7 120162.7 120161.6 120146.5 11.9 34.5 120173.4 120163.8 74.8 239.9 t* = average best-solution time (CPU seconds); T = average execution time (CPU seconds).

Table 4.2 The percentage gaps between DPSO+LS and Fix+LP+LS (Vasquez and Vimont, 2005)

Problem DPSO+LS

n m α Best Average

500 5 0.25 -0.0019% 0.0034%

500 5 0.5 -0.0003% 0.0006%

500 5 0.75 0.0003% 0.0009%

500 10 0.25 0.0204% 0.0407%

500 10 0.5 0.0063% 0.0172%

500 10 0.75 0.0039% 0.0085%

500 30 0.25 0.0562% 0.1133%

500 30 0.5 0.0248% 0.0417%

500 30 0.75 0.0138% 0.0212%

Average 0.0137% 0.0275%

We do not compare our algorithms with Fix+LP+TS (Vasquez and Vimont, 2005), since Fix+LP+TS (Vasquez and Vimont, 2005) takes 7.6-33 hours on a Pentium4 2GHz PC to obtain the solution for each problem. In general, a metaheuristic does not perform such a long time and the solution quality of Fix+LP+TS (Vasquez and Vimont, 2005) could not be reached in a short computation time. However, we show the percentage gaps between our DPSO+LS and Fix+LP+TS (Vasquez and Vimont, 2005) in Table 4.2. The percentage gaps show that the results of our DPSO+LS very close to Fix+LP+TS (Vasquez and Vimont, 2005) in a short computation time.

4.9 Concluding Remarks

In this chapter we have presented a new discrete binary particle swarm optimization (DPSO) for solving multidimensional 0-1 knapsack problems and a local search procedure based on the concept of building blocks. The proposed DPSO adopted new concepts of particle velocity and particle movement, and obtained good solutions in a reasonable CPU time.

There are two possible extensions to this study for future research. First, the

proposed DPSO can be extended for solving similar combinatorial optimization problems: for example, multidimensional 0-1 knapsack problems with generalized upper bound constraints. Second, the proposed DPSO can be extended for sequencing and scheduling problems. Similar to this chapter, we may modify the velocity based on the tabu list and the concept of building blocks, and modify particle movement based on crossover and mutation of genetic algorithm. Furthermore, we may develop the repair operator based on scheduling strategies for scheduling problems. Table 4.3 shows the summary of the DPSO for MKP.

Table 4.3 Summary of the DPSO for MKP

Components The concept of this components

1 Particle Position

Representation Binary variables

Since the solution of MKP is 0-1 variables, we represent the particle position by binary variables, which have the most Lamarckian.

Particle Velocity Blocks 2

Particle Movement Crossover operator

The binary variables is very appropriate to build blocks, so we implement the concept of building blocks and the relational crossover operator.

Restrict the search area in the feasible region.

4 Other Strategies

Diversification Selection Local search

The diversification strategy can prevent particles rapped in local optima.

The selection strategy can further accelerate the speed of building blocks.

The local search can further improve the solution quality,

4.10 Appendix

A pseudo code of the DPSO for MKP is given below:

Initialize a population of particles with random positions and velocities.

Initialize the gbest solution by surrogate duality approach repeat

update velocities according to Figure 4.1.

for each particle k do

move particle k according to Figure 4.2.

repair the solution of particle k according to repair operator (Figure 4.3).

calculate the fitness value of particle k.

perform local search on particle k (Figure 4.6).

end for

update gbest and pbest solutions according to diversification strategy (Figure 4.4).

perform selection according to selection strategy (Figure 4.5).

until maximum iterations is attained

CHAPTER 5

A PARTICLE SWARM OPTIMIZATION FOR THE JOB SHOP SCHEDULING PROBLEM

The original PSO is used to solve continuous optimization problems. Since the solution space of a shop scheduling problem is discrete, we have to modify the particle position representation, particle movement, and particle velocity to better suit PSO for scheduling problems. In the PSO for JSSP, we modified the particle position representation using preference-lists and the particle movement using a swap operator.

Moreover, we propose a diversification strategy and a local search procedure for better performance.

5.1 Particle Position Representation

We implement the preference list-based representation (Davis, 1985), which has half-Lamarckian (Cheng et al., 1996). In the preference list-based representation, there is a preference list for each machine. For an n-job m-machine problem, we can represent the particle k position by an m×n matrix, and the ith row is the preference list of machine i, i.e. of machine i. Similar to GA (Kobayashi et al., 1995) decoding a chromosome into a schedule, we also use Giffler & Thompson’s heuristic (Giffler &

Thompson, 1960) to decode a particle’s position to an active schedule. The G&T algorithm is shown as Figure 5.1. For example, there are 4 jobs and 4 machines

as shown on

Table 5.1, and the position of particle k is

⎥⎥

Table 5.1 A 4×4 job shop problem example

jobs machine sequence processing times

1 1, 2, 4, 3 p = 5, 11 p = 4, 21 p = 2, 41 p = 2 31

2 2, 1, 3, 4 p = 4, 22 p = 3, 12 p = 3, 32 p = 2 42

3 4, 1, 3, 2 p = 2, 43 p = 2, 13 p = 3, 33 p = 4 23 4 3, 1, 4, 2 p = 3, 34 p = 2, 14 p = 3, 44 p = 4 24

We can decode X to an active schedule following the G&T algorithm: k Initialization of others in the preference list of machine 4, and add it into schedule

S , as illustrated in Figure 5.2(a).

Update Ω={o11,o22,o13,o34}.

Notation:

o : the operation of job j that needs to be processed on machine i. ij

o : the operation of job j that needs to be processed on machine i. ij

相關文件