Genetic Algorithm-Based Multi-objective Optimisation for QoS-Aware Web Services Composition Li Li1 , Pengyi Yang2 , Ling Ou1 , Zili Zhang1 , and Peng Cheng1 1
2
Southwest University, Chongqing, 400715, P.R. China {lily,ouling,zhangzl,chengp}@swu.edu.cn School of IT, The University of Sydney, Sydney, 2006, Australia
[email protected]
Abstract. Finding an optimal solution for QoS-aware Web service composition with various restrictions on qualities is a multi-objective optimisation problem. A popular multi-objective genetic algorithm, NSGA-II, is studied in order to provide a set of optimal solutions for QoS-based service composition. Experiments with different numbers of abstract and concrete services confirm the expected behaviour of the algorithm.
1
Introduction
QoS-aware service composition for meeting non-functional requirements has been widely studied recently [1,2]. However, most existing QoS-aware compositions are simply based on the assumption that multiple criteria, no matter whether they are competing or not, can be handled by the weighted sum approach. Practically, this approach can be very difficult as utility functions or weights are not well known a priori [3]. A motivating scenario may explain the issues raised above clearly. A typical holiday package service includes four service components: flight Booking, hotel Booking, car Rental, and theme Park Family Pass Booking. Suppose a large number of candidate Web services with different quality criteria (e.g. cost, response time and availability) are available for every service component, the task of QoS-based service composition is to select the optimal candidate services for each of them. Obviously, qualities such as cost, response time and availability have dimensional constraints (e.g. availability≥ 0.6). In addition, there might have some sort of dependent relationships between objectives. Evolutionary algorithms are very popular approaches in dealing with such kinds of optimisation problems [4]. Genetic algorithms such as the Non-dominated Sorting Genetic Algorithm-II (NSGA-II) [5] and Strength Pareto Evolutionary Approach (SPEA2) [6] are two popular approaches. We will discuss NSGA-II in this paper. The discussion of SPEA2 along with the detailed comparison of these two approaches will be presented in another paper. In this paper, the terms such as criteria and qualities, candidate Web services and concrete Web services are used interchangeably unless otherwise specified. Y. Bi and M.-A. Williams (Eds.): KSEM 2010, LNAI 6291, pp. 549–554, 2010. c Springer-Verlag Berlin Heidelberg 2010
550
L. Li et al.
The rest of the paper is organised as follows. Section 2 introduces the QoS model followed by the problem formalisation. Section 3 discusses the customised NSGA-II. Section 4 adapts NSGA-II to solve QoS-aware service composition with experimental results. Section 5 concludes the paper.
2
Problem Description
One of the most promising features of Service Oriented Computing is service composition. The qualities play key role in decisively identifying the best set of services available at runtime. In what follows, we first introduce the QoS model followed by the formalisation of QoS-based composition. 2.1
QoS Model
QoS is an integral part of Web services. It is not uncommon that more than one concrete service realising a particular feature is available. Basically, these concrete services are functionally equivalent therefore they can be interchanged. As different concrete services may operate at different QoS measures, these QoS attributes can be used to differentiate a number of functionally equivalent concrete services. In practice, the choice between them is dictated by QoS criteria. Table 1. Aggregation functions Criteria availability reputation cost reliability regulatory throughput latency response time service capacity encryption
Aggregation functions n m ai,j xj,i , when xj,i = 1 i=1 j=1 m ( n ri,j xj,i )/n i=1 j=1 n m ci,j xj,i i=1 j=1 n m i=1 j=1 ei,j xj,i , when xj,i = 1 min( m j=1 gi,j xj,i )i∈(1...n) m ( n o x )/n i=1 n mj=1 i,j j,i l i,j xj,i i=1 j=1 n m t i=1 j=1 i,j xj,i min( m j=1 si,j xj,i )i∈(1...n) m ( n i=1 j=1 pi,j xj,i )/n
Table 1 presents aggregation functions for the computation of QoS qualities used in this paper. Currently 10 quality dimensions are discussed in the travel scenario, however, there is no limitation to the number of characteristics to be handled by the algorithms. 2.2
Problem Formulation
Without loss of generality, we assume that all objectives are to be minimised and all equally important. The minimisation1 of a multi-objective problem with 1
The maximisation of a multi-objective problem can be implemented as a reverse of minimisation functions.
Genetic Algorithm-Based Multi-objective Optimisation
551
k objectives is defined as follows (n, k ∈ N): to find a vector x = [x1 , x2 , ..., xn ]T which minmise [f1 (x), f2 (x), ..., fk (x)]T where x = [x1 , x2 , ..., xn ]T is a vector of decision variables, which satisfies a series of constraints. Specifically, xi is an integer in this paper, which specifies the index of the matched concrete service. For example, if we have a vector of concrete services in the form of x = [2, 5, 7, 4]T , it can be represented by a matrix xi,j with only the specific elements having values 1s. The definition of the matrix xu×v (u, v ∈ N) is given below. 1 if j = xi , and xi = 0, xi,j = 0 otherwise. with i in xi,j indicating which abstract service it represents, whilst j stands for which concrete service has been chosen to match this abstract service. Take the above vector for example, according the definition, we have x1,2 = 1, x2,5 = 1, x3,7 = 1 and x4,4 = 1, respectively.
3
NSGA-II
In this section, we will concentrate on the core algorithms of NSGA-II. The key algorithms are shown in Figure 1. Our implementation is similar to that developed by Deb et al. [5] with some customisation. The implemented modules are listed in Table 2.
MOGA core algorithms (01) initiateParameter; (02) initiateChromosome(popSize); (03) for g = 1 to generation do (04) fastNonDomiSort(chromosome); (05) crowdDistanceSort(chromosome); (06) nonDominateSelect(chromosome); (07) crossover(chromosome ); (08) mutate(chromosome); (09) for i = 1 to (popSize) do (10) for j = 1 to (NumOfObjective) do (11) computeFitness(i, j); (12) end for (13) end for (14) end for
Fig. 1. NSGA-II Algorithm
552
L. Li et al. Table 2. Implemented modules
Modules initiateParameters() initiateChromosome() fastNonDominateSort() crowdDistanceSort() nonDominateSelect() crossover() mutate()
4
Description initiate genetic parameters generate initiate GA chromosomes randomly non-dominated sorting measure the difference of each solution using the quick sort algorithm binary tournament selection by taking account of constraints and solution differences the chromosome crossover algorithm the chromosome mutation algorithm
Experimental Results
4.1
Multi-objectives and Constraints Handling
In order to incorporate multiple constraints, we follow the constraint-awareness selection strategy proposed in [7]. Two types of constraints are considered in the implementation. They are (1) single dimensional constraints; and (2) dependent constraints, respectively. 4.2
Parameter Configuration and Experimental Results
The detailed parameters depend on the nature of the problem. With the holiday package example introduced in Section 1, the parameter configuration is shown in Table 3. Table 3. Configuration Parameters population size chromosome size chromosome encoding selector
Values 500 4 and 12, respectively integer encoding scheme constraint aware tournament selection crossover single point (0.7) mutation single point (0.03) termination condition fixed number of generation No. of objectives 10 No. of constraints 6 No. of concrete services 30 and 90, respectively
We are interested in finding out the following statistics: (Q1) How many non-dominated solutions have been obtained at each generation? (Q2) How many solutions are dominated by the immediate succeeding generation for each generation? We expect the result will give us some hints to how the customised NSGA-II is progressing the Pareto front.
Genetic Algorithm-Based Multi-objective Optimisation
553
The test data are generated base on some empirical studies. The following are the experiment settings. – Setting1: No. of abstract services = 4, No. of concrete services = 90 – Setting2: No. of abstract services = 12, No. of concrete services = 30
500
480
480
460
460
440
Number of non−dominated solution
Number of non−dominated solution
We follow the given parameter configuration in the following two tests. The first test is focused on answering Q1 by illustrating how many nondominated solutions are obtained at each generation. We first randomly assign the generated dataset into 4 groups, each with 90 candidate concrete services (i.e., Setting1 ). We then evaluate the developed algorithms against the data. The outcome is called optimisation results. Then the evaluation work is carried out with another parameter setting, in which the number of the total abstract services is changed to 12, and each abstract service has 30 concrete services (i.e., Setting2 ). Figures 2 and 3 illustrate the number of non-dominated solutions obtained at each generation. Apparently, the number of non-dominated solutions increases at nearly the same rate in both figures. These results imply that NSGA-II is able to spread the solutions to the Pareto fronts.
440 420 400 380 360 340 320 300
50
100 Generation
Fig. 2. Q1 - setting1
400 380 360 340 320 300
abstract services = 4 0
420
150
280
abstract services = 12 0
50
100
150
Generation
Fig. 3. Q1 - setting2
The second test aims at answering Q2 listed above. Experiment settings and the dataset are the same as those in the first test. Figures 4 and 5 demonstrate that at each generation the number of solutions which dominates the solutions of its immediate preceding generation. It is evident that the evolution of the optimisation does not proceed smoothly but fluctuates enormously, which can be seen clearly from the figures. Essentially, Figure 4 and Figure 5 imply that the same pattern exists regardless of the number of abstract services. Moreover, the optimisation process is evidently affected by the increase of the number of abstract services from 4 to 12. The bigger the number of abstract services is, the greater fluctuation the optimisation processes are.
L. Li et al.
100 abstract services = 4
90 80 70 60 50 40 30 20 10 0
0
50
100 Generation
Fig. 4. Q2 - setting1
5
Number of solution dominate those from previous generation
Number of solution dominate those from previous generation
554
150
100 abstract services = 12
90 80 70 60 50 40 30 20 10 0
0
50
100
150
Generation
Fig. 5. Q2 - setting2
Conclusion
We have proposed the use of NSGA-II in order to optimise QoS-based Web service composition. NSGA-II is customised accordingly. The experiment based on the motivating scenario is presented. The experimental results revealed that NSGA-II is a reasonably good fit in solving QoS-aware service composition problems with satisfied convergence and distribution properties. As future work, we envision comprehensive evaluation of NSGA-II, SPEA2 and particle swarm optimisation with empirical QoS data.
Acknowledgment The work is supported in part by the research fund for the Doctoral Program of Southwest University, P. R. China (No. SWU109018, No. SWUB2008006).
References 1. Ardagna, D., Pernici, B.: Adaptive service composition in flexible processes. IEEE Trans. on Software Engineering 33, 369–384 (2007) 2. Hwang, S.Y., Lim, E.P., Lee, C.H., Chen, C.H.: Dynamic web service selection for reliable web service composition. IEEE Trans. on Services Computing 1, 104–116 (2008) 3. Fonseca, C.M., Fleming, P.J.: Genetic algorithms for multiobjective optimization: Formulation, discussion and generalization. In: Forrest, S. (ed.) ICGA 1993, June 1993, pp. 416–423. Morgan Kaufmann, San Francisco (1993) 4. Zhang, Z., Yang, P., Wu, X., Zhang, C.: An agent-based hybrid system for microarray data analysis. IEEE IS 24, 53–63 (2009) 5. Deb, K., Agrawal, S., Pratap, A., Meyarivan, T.: A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans. Evolutionary Computation 6, 182–197 (2002) 6. Zitzler, E., Laumanns, M., Thiele, L.: Spea2: Improving the strength pareto evolutionary algorithm. Technical report, ETH, Z¨ urich (2001) 7. Deb, K.: An efficient constraint handling method for genetic algorithms. Computer Methods in Applied Mechanics and Engineering 186, 311–338 (2000)