A Fuzzy-Particle Swarm Optimization Based Algorithm for Solving

1 downloads 0 Views 243KB Size Report
Abstract—In this paper, an efficient particle swarm optimization (PSO) algorithm based on fuzzy logic for solving the single source shortest path problem (SPP) is ...
A Fuzzy-Particle Swarm Optimization Based Algorithm for Solving Shortest Path Problem Afshin Ghanizadeh, Saman Sinaie, Amir Atapour Abarghouei, and Siti Mariyam Shamsuddin Soft Computing Research Group Faculty of Computer Science and Information Systems University Technology Malaysia Skudai, Malaysia [email protected], [email protected], [email protected], [email protected]

Abstract—In this paper, an efficient particle swarm optimization (PSO) algorithm based on fuzzy logic for solving the single source shortest path problem (SPP) is proposed. A particle encoding/decoding scheme has been devised for particle-representation of the SPP parameters, which is free of the previously randomized path construction methods in computational problems like the SPP .The search capability of PSO is diversified by hybridizing the PSO with fuzzy logic. The local optimums will not be the point of convergence for the particles and the global optimum will be found in a shorter period of time if the PSO is correctly modified using fuzzy logic rules. Numerical computation results on several networks with random weights illustrate the efficiency of the proposed method for computation of the shortest paths in networks. Keywords: Shortest Path Problem, Particle Swarm Optimization, Fuzzy Logic

I.

INTRODUCTION

The shortest path problem (SPP) is one of the most fundamental computational problems in graph theory, and of utmost importance in communication networks. This wellknown problem is concerned with finding the shortest path from a specific origin to a certain destination in a given network while minimizing the cost and perhaps taking specific constraints into consideration. This problem’s wide range of applications, such as path planning in robotic systems [1], vehicle routing in transportation systems [2], sequence alignment in molecular biology [3], and traffic routing in communication networks [4], has made this important computational problem the center of attention in the scientific community. A computer network’s performance is significantly influenced by routing, especially in multi-hop networks, such as the Internet and mobile ad-hoc Networks. An acceptable routing algorithm must be capable of finding an optimal path for packet transmission within a specified period of time to fulfill the Quality of Service (QoS) [5, 6, 7]. Several well-known deterministic algorithms, such as Dijkstra [8] and Bellman-ford [9] are commonly used to solve the shortest path problem. However, these classic algorithms suffer from serious shortcomings, one of which is that they cannot be used for networks with negative weights of edges. For instance, in some communications networks, the weights can represent the transmission line capacity, and the negative weights depict the links with gain rather than loss. One of the other problems of these algorithms is the fact

c 978-1-4244-6349-7/10/$26.00 2010 IEEE

that they require highly-complex computations for real-time communications involving rapidly changing network topologies such as the earlier-mentioned wireless ad-hoc networks [10]. Hence, there is an obvious need for more efficient optimization algorithm for the shortest path problem. Recently, there has been a huge interest in the Particle Swarm Optimization (PSO) due to its great potential as an evolutionary algorithm, which is based on the simple social behavior of flocks of birds and schools of fish [11]. In this paper, a modified version of the PSO, based on the use of fuzzy logic, is proposed for computation of the single source shortest path problem, which can be of great use in improving the routing in multi-hop communication networks. However, the PSO itself is not flawless. It can fall into the local optimum trap and converges slowly. By combining the PSO with fuzzy logic [12], these problems can be solved. The effectiveness of the proposed algorithm for solving the shortest problem is verified through experimental results which will be presented later on. The rest of the paper is organized as follows. In section 2, a brief overview of the PSO paradigm is presented. Section 3 presents the proposed method, followed by the encoding mechanism and fuzzy inference system. The experimental results are discussed in section 4, and section 5 concludes the paper. II.

PARTICLE SWARM OPTIMIZATION

The Particle Swarm Optimization algorithm is based on certain social behaviors observed in flocks of birds, schools of fish, etc., from which certain aspects of intelligence emerge. After its development by Kennedy and Eberhart [13] in 1995, this evolutionary paradigm has been seriously studied on and grown in the past decade. The standard PSO model consists of a swarm of particles, moving interactively through the feasible problem space to find new solutions. Each particle has a position represented by a position vector ; where i is the index of the particle, and a velocity represented by a velocity vector . Each particle remembers its own best position so far in the vector pbest and the best position vector among the swarm is stored in a vector gbest. The search for the optimal position (solution) advances as the particles’ velocities and positions are updated. In every iteration, the fitness of each particle’s position is calculated using a pre-defined fitness function and the velocity of each

V6-404

particle is updated using the gbest and pbest which were previously defined. A particle’s velocity and position are updated as follows: v id = wv id + c1 r1 ( p Best − x id ) + c 2 r2 ( g Best − x id ); i = 1, 2,..., N , and d = 1, 2,..., D

(1)

x id = x id + v id

(2)

Where w is the inertia weight which usually decreases linearly in the interval [0,1]. c1 and c2 are positive constants, called acceleration coefficients, N is the total number of particles in the swarm, D is the dimension of the search space or in other words, number of the parameters of the function being optimized, and r1 and r2 are two independently generated random numbers in the interval [0,1]. In (1), w is the inertia weight, which as mentioned earlier decreases in the interval [0,1]. w is one of the factors that control the velocity of the particles and therefore their position updates. The larger the w, the more globally the particles search the space; and the smaller the w, the more locally the particles search the space. Thus, by decreasing the w as the iterations move on, the global search changes into a local search gradually. c1 and c2 are two learning factors that control the effects of pbest and gbest on the way the particles travel through the search space. In most studies done on the PSO, c1 and c2 are given the value of 2. However, mostly the particles far from the global best attain velocities with large values; therefore have huge position updates, and may leave the boundaries of the search space as a result. Hence, the velocity of the particles must be controlled. Velocity clamping, which could be used in (1), gives a particle in a dimension the velocity of , if the right side of (1) for that particle exceeds the maximum value in that dimension. It should be noted that many other improvements have been made into this algorithm. Manrice [14] proposed the use of a constriction factor χ to prevent the velocity from increasing out of bounds so that there would be no need for clamping. In the Constriction Factor Method (CFM), (1) is modified as follows: vid = χ [ vid + c1r1 ( p Best − xid ) + c 2 r2 ( g Best − xid )]

III.

FUZZY-BASED MODIFIED PSO METHOD FOR SHORTEST PATH PROBLEM

In this section, the proposed Fuzzy-based modified PSO algorithm is described. Two main components of the proposed method are particle representation and fuzzy inference system, which are discussed in details. A. Particle Representation One of the most important issues in solving the shortest path problem and the ones similar to it, such as the traveling salesman problem, using the PSO (and GA), is how to encode a path in a network graph into a particle (or a chromosome). The way this encoding is done greatly affects the efficiency of the search process. In the approach proposed in this paper, the position vector of a particle in the PSO is represented by a priority vector, which contains some guiding information about the nodes that constitute the path in the graph. This method of encoding, which was first used by Gen et al. [16] in a GA-based method, involves the priorities of various nodes in the network. These priorities are initially assigned randomly. The path is generated as a sequence of nodes starting with the source node and ending at the destination node. According to the nature of the shortest path problem, as a path is being constructed, there are usually several nodes available for consideration, at each step of the path construction. In this approach, the node with the highest priority is chosen and the process continues until the destination node is reached. Fig. 1 illustrates a typical 20-node random network [17], on which the shortest path problem solving methods can be applied. The described encoding scheme is depicted in Fig. 2. p1, p2,… are the priorities of the nodes 1,2, …, respectively. Fig. 2(b) shows a simple example of the encoding scheme described above for the graph in Fig. 1. The path construction begins from node 1, and from the node adjacency relations, the node with the highest priority (node 4) is chosen as the next node in the path. Then, out of all the possible non-visited nodes that can be visited from node 4, the node with the highest priority (node 9) is chosen. The process is repeated until a complete path (1, 4, 9, 15,14, 20) is obtained.

(3)

Where -1

χ = 2⎛⎜ 2 − φ − φ 2 − 4φ ⎞⎟ if φ = c1 + c 2 > 4 ⎝



(4)

However, better results were presented by Eberhart and Shi [15] who used both the constriction factor and velocity clamping in their work. Before beginning the simple process of PSO implementation, which includes devising a coding scheme for particle representation as the first step, the Fuzzybased modifications made in the PSO are discussed.

[Volume 6]

Figure 1. A typical 20-node random network. node numbers are encircled. The weights of the connecting edges are also shown adjacent to the corresponding edges [17].

2010 2nd International Conference on Computer Engineering and Technology

V6-405

Figure 2. Illustrations of priority-based encoding scheme [15] for the 20-node network of Fig. 1.

In some cases, the path is not terminated at the destination node which leads to an invalid path, as shown in Fig 2(c). the nodes sequence 1,4, 11, 5 should not go further due to the creation of a loop. B. Fuzzy Inference System Fuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic. The process of fuzzy inference involves membership functions, logical operations, and If-Then rules. There are two types of fuzzy inference systems, Mamdani-type [18] and Sugeno-type [19]. These two types of inference systems vary somewhat in the way outputs are determined. Mamdani's fuzzy inference method, which is used in this paper, is the most commonly seen fuzzy methodology. Mamdani's method was among the first control systems built using fuzzy set theory. Falling into the trap of local optimum and slow convergence are of the most important shortcomings of the PSO. There have been many methods proposed to solve the first problem, all of which involve detecting the local optimum and avoiding it. In [20], to avoid the local optimum, when the velocity of the particle is lower than a specific threshold, but the fitness is not acceptable, a function is used to give a shock to the particle and increase its velocity. In [21,22], a non-linear function for decreasing the inertia weight is used to increase the velocity of a particle when the inertia weight is small, but the fitness is unacceptable. All these methods prevent the particles to converge to a local optimum and some even speed up the convergence. In this paper, a fuzzy-based method proposed by Noroozi and Meybodi [12] is used to overcome the above-mentioned shortcomings of the PSO. In this method, a variable called the CBPE (Current Best Performance Evaluation), which indicates the fitness level of a particle at the moment, is used. CBPEmin is the best fitness attained so far and CBPEmax is the worst fitness attained so far. In (5), a normalized value NCBPE in the interval [0,1] is obtained using the three mentioned-above variables:

V6-406

NCBPE =

CBPE − CBPE min CBPE max − CBPE min

(5)

In this method, a fuzzy function is defined with the parameters d1, d2 and NCBPE as its input and w as its output (Fig. 3). d 1 = p best − x , d 2 = g best − x

(6)

In (6), d1 and d2 represent the distance between the current position of the particle and its local best, and the global best, respectively. The lingual values “low”, “medium”, and “high” are used to describe the parameters. d1 and d2 are determined with respect to the size of the search space; therefore, these three parameters are the basis for the fuzzy system to decide the value of w, which is in the interval [0,1]. Choosing the correct fuzzy rules has a direct influence on the obtained results. A number of the rules used in this system are illustrated in Table 1. It should be noted that a large number of rules in the system can not affect the result significantly, but the quality of the chosen rules is what produces accurate results.

d1

d2

Fuzzy Inference System

w

NCBPE

Figure 3. Fuzzy inference system for solving shortest path problem.

2010 2nd International Conference on Computer Engineering and Technology

[Volume 6]

TABLE 1.

SOME OF FUZZY INFERENCE SYSTEM RULES. Inputs

Rules

Output

d1

d2

NCBPE

w

1

Low

Low

Low

Low

2

Low

Low

Not Low

High

3

Low

Not Low

Medium

High

4

High

High

High

High

Table 1 can be described as follows: • Rule 1: if d1, d2, and NCBPE are low, the particle is close to the optimum and the fitness is acceptable; therefore w is given a low value so that the search continues around the global optimum. • Rule 2: if d1 and d2 are low, but NCBPE is not low, it means that the particle is close to the optimum, but the fitness is not acceptable (local optimum); therefore w is given a high value to increase the particle’s velocity and change its position. • Rule 3: if d1 is low, d2 is not low, and NCBPE is medium, it means that the particle is close to the local optimum but not close to the global optimum; therefore w is given a high value to increase the particle’s velocity and change its position • Rule 4: if both d1 and d2 are not low; the particle’s velocity must increase; therefore w is given a high value.

IV.

EPERIMENTAL RESULTS

Many networks with different number of nodes are used to evaluate the performance of the proposed approach. Networks with different number of nodes are generated to investigate the quality of solution and the convergence speed of the proposed method. These Networks are randomly generated with the maximum number 40 of nodes and edges are given random values between (0,100). To have a better evaluation, the proposed algorithm is run 100 times for each network. The other PSO parameters are chosen as: w reduces linearly from 0.9 to 0.2; c1 and c2 are chosen to be 2. The performance of the algorithm is assessed by success rate which is defined as the number of times the shortest path is found over the number of runs. The success rate for different swarm sizes between 10 and 40 is obtained to compare the PSO with the proposed method which is illustrated in Fig. 5. In Fig. 6, the Average Best So Far is shown in different iterations of both algorithms. As it can be seen clearly, the proposed approach presents more accurate results. Although both algorithms seem to be similar in the beginning iterations, the proposed method converges to a better solution as the time passes. According to Fig. 5 and Fig. 6, it is easy to see that by using a fuzzy inertia weight the performance of PSO can be improved and have similar or better results than that of PSO with a linearly decreasing inertia weight.

According to these fuzzy inference rules, the inertia weight w is updated. The pseudo-code of the proposed algorithm is illustrated in Fig. 4. Begin Initialize the position and velocity randomly. Initialize the inertia weight. Calculate fitness value for each particle. Calculate pbest and gbest for each particle. Do Update velocity of each particle using (1). Update position of each particle using (2). Calculate fitness value of each particle. Update pbest for each particle if its current fitness value is better. Update gbest for each particle. i.e, choose the position of the particle with the best fitness value among all particles as the gbest . Update the inertia weight using fuzzy inference rules. While termination criterion is not violated. End

Figure 5. Success rate vs. Swarm Size for a network of 30 nodes

Figure 4. Pseudo-codes for general algorithmic flow of Particle Swarm Optimization

[Volume 6]

2010 2nd International Conference on Computer Engineering and Technology

V6-407

[4] [5]

[6]

[7]

[8] [9] [10]

[11]

Figure 6. Average Best So Far over iterations for PSO and the proposed modified PSO.

V.

CONCLUSION

A hybrid fuzzy-PSO search algorithm for solving the single source shortest path problem is presented in this paper. The method takes advantage of an efficient encoding mechanism in the PSO so as to include the parameters of the path graph in the representation itself. Additionally, in order to enhance the search efficiency, the inertia weight whose right values can prevent the search from falling in the trap of local optima, is determined using fuzzy rules. The results show that the modification improves the performance of the algorithm significantly by achieving a success rate of 0.99.

[12]

[13]

[14]

[15]

[16]

[17]

ACKNOWLEDGMENT This work is supported by University Technology Malaysia, Skudai Johor Bahru MALAYSIA and Ministry of Higher Education (MOHE). Authors would like to thank Soft Computing Research Group (SCRG) for their moral support and incisive comments to improve this article.

[18]

REFERENCES

[21]

[1]

[2] [3]

G. Desaulniers, and F. Soumis, “An efficient algorithm to find a shortest path for a car-like robot,” IEEE Trans. Robot. Automat. 11 (6), pp. 819–828, 1995. F.B. Zahn, and C.E. Noon, “Shortest path algorithms: An evaluation using real road networks”, Transport. Sci. 32, pp. 65–73, 1998. N. Deo, and C. Pang, “Shortest-Path Algorithms: Taxonomy and Annotation,” Networks, vol. 14, pp. 275-323, 1984.

V6-408

[19] [20]

[22]

Moy, J., 1994. Open Shortest Path First Version 2. RFQ 1583, Internet Engineering Task Force. http://www.ietf.org. M. K. Ali and F. Kamoun, “Neural networks for shortest path computation and routing in computer networks,” IEEE Trans. Neural Networks, vol. 4, pp. 941–954, 1993. D. C. Park and S. E. Choi, “A neural network based multi-destination routing algorithm for communication network,” in Proc. Joint Conf. Neural Networks, pp. 1673–1678, 1998. C. W. Ahn, R. S. Ramakrishna, C. G. Kang, and I. C. Choi, “Shortest path routing algorithm using hopfield neural network,” Electron. Lett., vol. 37, no. 19, pp. 1176–1178, 2001. E.W Dijkstra. “A note on two problems in connection with graphs,” Numerische Mathematik, 1, pp. 269-271, 1959 E.L. Lawler, “Combinatorial Optimization: Networks and Matroids”, Holt, Rinehart, and Winston, New York, pp. 59–108, 1976. Ammar W. Mohemmed, Nirod Chandra Sahoo , and Tan Kim Geok, “Solving Shortest Problem using Particle Swarm Optimization,” Applied Soft Computing, 8(4), pp. 1643-1653, 2008. J. Kennedy and R. C. Eberhart., “Particle swarm optimization.,” Proceedings of the IEEE Int. Conf. on Neural Networks, Perth, Australia, pp. 1942-1948, 1995. M. H. Noroozi Beyrami, and M. R. Meybodi, , "Improving Particle Swarm Optimization using Fuzzy Logic," Proceedings of the Second Iranian Data Mining Conference, Amirkabir University of Technology, Tehran, Iran, pp. 108-120, 2008. J. Kennedy and R. C. Eberhart., “Particle swarm optimization.,” Proceedings of the IEEE Int. Conf. on Neural Networks, Perth, Australia, pp. 1942-1948, 1995. C. Maurice, “The swarm and queen: Towards a deterministic and adaptive particle swarm optimization,” Proceedings of the IEEE Congress on Evolutionary Computation, Washington, pp. 1951 – 1957, 1999. R. C. Eberhart and Y. Shi, “Comparing inertia weight and constriction factors in particle swarm optimization,” Proceedings of the IEEE Congress on Evolutionary Computation., San Diego, CA, pp. 84-88, 2000. M. Gen, R. Cheng, D.Wang, Genetic Algorithms for solving shortest path problems, in: Proceedings of the IEEE International Conference on Evolutionary Computation, pp. 401–406. 1997. C.W. Ahn, R.S. Ramakrishna, A genetic algorithm for shortest path routing problem and the sizing of populations, IEEE Trans. Evol. Comput. 6 (6), pp. 566–579, 2002. Mamdani, E.H. and S. Assilian, "An experiment in linguistic synthesis with a fuzzy logic controller," International Journal of ManMachine Studies, Vol. 7, No. 1, pp. 1-13, 1975. M. Sugeno, “Industrial Applications of Fuzzy Control”, Elsevier , New York, 1985. L. Hongbo, and M. Abraham, “Fuzzy Adaptive Turbulent Particle Swarm Optimization”, IEEE Fifth International Conference on Hybrid Intelligent Systems (HIS'05), pp.445-450, 2005. K. P. Wang, L. Huang, C. G. Zhou and W. Pang, “Particle swarm optimization for traveling salesman problem,” Proceedings of International Conference on Machine Learning and Cybernetics, pp. 1583-1585, 2003. B. Waxman, “Routing of multipoint connections,” IEEE J. of Selected Areas in Communications, Vol. 6, No. 9, pp. 1622–1671, 1988.

2010 2nd International Conference on Computer Engineering and Technology

[Volume 6]