Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 39 (2012) 145–152 www.elsevier.com/locate/endm
A Hybrid Metaheuristic Based on Variable Neighborhood Search and Tabu Search for the Web Service Selection Problem Nina Turajli´c 1 Ivana Dragovi´c 2 Faculty of Organizational Sciences, University of Belgrade, Belgrade, Serbia
Abstract One of the main ideas of the Service Oriented Approach is to provide complex functionality by combining the functionality of several services into a single composition. Once the services providing the required functionality for each component of the composition have been identified, it is necessary to select the set of services with the best overall Quality of Service (QoS) utility. This optimal set of services must also satisfy the given QoS requirements. For the first time a hybrid approach, combining the strengths of VNS and Tabu Search, is used for solving the web service selection problem. The results were compared to the results obtained by applying the Tabu Search and VNS algorithms separately on the same test instances and have shown that the hybrid algorithm outperforms both of them for larger problems. Keywords: Web Service Selection Problem, SOA, QoS, Variable Neighborhood Search, Tabu Search
1 2
[email protected] [email protected]
1571-0653/$ – see front matter © 2012 Elsevier B.V. All rights reserved. doi:10.1016/j.endm.2012.10.020
146
1
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
Introduction
Web services are software components, accessible on the Internet, which provide certain functionality. With the proliferation of web services offering similar functionality the problem of how to choose the best one from a given class (i.e. the class of services that achieve the desired functionality) has become increasingly important. When a single web service does not provide the required functionality a composition of different web services might - which is the basis of the Service Oriented Approach (SOA). The problem, then, consists of choosing the optimal composition of web services by choosing component services from each of the required classes on the basis of certain criteria. Often the selection is made on the basis of Quality of Service (QoS) attributes. QoS refers to the non-functional properties of a service such as: performance, security, reliability, availability etc. A detailed description can be found in [14]. There are several approaches in literature for modeling the web service selection problem. In a large number of them it is modeled as a multidimensional multiple-choice knapsack problem (MMKP) [10] and this approach has been adopted in this paper as well. A global search, to find the global optimal solution, could be accomplished through exact methods (i.e. an exhaustive search) but it requires a lot of computer effort and may, for larger problems, be impossible to achieve since the number of possible combinations grows exponentially with the increase in the number of services. Therefore, heuristic methods for solving NP-hard problems, which give good near-optimal results, or optimal results without proof of optimality, are widely used. Instead of developing specialized heuristics for specific combinatorial problems the use of metaheuristics (more general solution schemes easily adapted to a particular problem class [5]) is preferred. Widely known metaheuristics are: Genetic algorithms, Simulated Annealing etc. Two of these metaheuristics are the basis of the approach proposed in this paper namely: Tabu Search (TS) and Variable Neighborhood Search (VNS). Tabu search (TS) proposed in [6] is a trajectory method which tries to move from poor local optima to better ones by using tabu lists containing previously visited solutions and by allowing non-improving moves. TS starts from an initial feasible solution and in each iteration the search moves to the best neighbor of the incumbent solution even if it does not lead to improvement, while the incumbent solution is added to the tabu list in order to prevent the search from revisiting it in the following iterations. Variable Neighborhood Search (VNS) [9,4] is another metaheuristic which
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
147
uses a different technique for escaping from poor local optima. Instead of following a trajectory it expands the search over an increasing radius through the systematic change of neighborhoods. When a local optimum is found increasingly distant neighborhoods of the current solution are explored. In each neighborhood a random starting point is generated and a local search is conducted in order to find a better local optimum. Only if an improvement can be made will the search move to the new solution and restart the search process in its first neighborhood. Otherwise the search will be expanded. In this paper, the idea is to combine the techniques of the two approaches for escaping from poor local optima which may be far from the global optimum. More precisely the use of TS as the local search algorithm in VNS is proposed. The remainder of the paper is organized as follows: in Section 2 an overview of the related work is given. In Section 3 the details related to the modeling of the problem are presented. Section 4 outlines the proposed approach to solving the formulated problem. Experimental results are shown in Section 5.
2
Related Work
Many different approaches exist to solving the web service selection problem [10] and only several which are based on the MMKP model will be presented. The approaches presented in [13,1] solve the problem with integer linear programming which is too complex for large problems. The algorithm proposed in [12] is based on finding an initial feasible solution and then iteratively improving the solution either by feasible upgrades or by infeasible ones followed by downgrades to render the solution feasible. A refinement of this approach is proposed in [3] and is based on excluding solutions which are too bad to be included in the final solution through a rule-based library and thereby reducing the size of the search space. Several algorithms have been proposed in [7]: a heuristic based on the branch-and-bound approach (which discards subregions based on estimations of the QoS constraints or the overall QoS), a bottom-up approximation which implements a local hill-climbing method (it identifies a solution that satisfies the constraint and optimizes it while trying to keep the constraint), pattern-wise selection (which is not applicable if there are global constraints) and a constraint optimized selection (Candidates are sorted by the QoS category relevant for the constraint, and for each task the candidate offering the best QoS is assigned. Since this approach does not optimize the other QoS categories it results in a poor overall QoS). The combining of VNS and TS can be accomplished in different ways and can be found in literature. The approaches proposed in [2,8] use a similar
148
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
technique to the one proposed in this paper but for different problems.
3
Modeling the Web Service Selection Problem
Given a set of classes C = {C(1), ..., C(m)} which are necessary to provide the required functionality, each consisting of a set of services sij , the aim is to choose a single service from each of the classes to be included in the composition CS. When selecting services for a composition the performances of the composite service are the basis for the selection. First the relevant QoS attributes must be chosen q k (k = 1, ..., n) [14]. When computing the overall QoS for a composition several challenges arise. First, different QoS attributes are aggregated in different ways, e.g. the response time of a composition is calculated as the sum of the response times of the participating services, the throughput of a composition is equal to the throughput of its fastest component, while the reliability is calculated as the product of the reliabilities of the participating services etc. Since, all of the aggregation functions q k (CS) should be linear functions, non-linear aggregation functions should be transformed into linear ones (e.g. by applying a logarithmic function to products they can be transformed into a sum of logarithms). Next, if the selection should be made on the basis of more than one QoS attribute it is necessary to construct a single utility function incorporating all the relevant QoS attributes. Each of the chosen QoS attributes is assigned a preference wk , and a weighted sum is composed. The fact that for some of the QoS attributes the maximum value is preferable, while for others the minimum value is preferred, should be taken into account while constructing the utility function. A third challenge arises from the fact that the QoS attributes are usually heterogeneous and defined using different metrics and it is necessary to normalize their values so that they can be uniformly combined in the utility function. Generally, certain constraints regarding the required QoS attribute levels of the composite service are also given Q = {Q1 , ..., Qn }, so the goal is to select the best composition which satisfies the given constraints. It should be noted that, in general, the set of attributes in the objective function need not necessarily be the same as the set of attributes for which the constraints are given and the proposed approach does not require that these sets be the same. Thus, the problem can be defined as follows: Select a single service si j from each of the necessary classes to attain the maximum value of the composite QoS utility function while at the same time satisfying the given QoS constraints. The optimal composition CS is the set of selected services (CS = {sij }, i = 1, ..., m where only one service from each class may be in the solution).
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
149
In this paper the problem is modeled as a multi-dimensional multiplechoice knapsack problem (MMKP): k = 1, ..., n; - number of relevant QoS attributes, where n1 attributes should be maximized while the remaining n − n1 should be minimized. i = 1, ..., m; - number of classes in the composition. j = 1, ..., pi ; - number of services in class C(i). X = {xi }, xi = [xi1 . . . xipi ], where xij = 0 if service sij is not included in the composition otherwise, if the service is included in the solution xij = 1. wk - relevance of the k-th attribute ( nk=1 wk = 1, wk ≥ 0, k = 1, ..., n) n1 n (1) q k (CS)wk − q k (CS)wk maxf (CS) = max k=1
k=n1 +1
Subject to: (2) (3)
q k (CS) ≤ Qk , k = 1, ..., n pi xij = 1, xij ∈ {0, 1}, i = 1, ..., m;
j = 1, ..., pi ;
j=1
4
Solving the Web Service Selection Problem
The goal of the proposed algorithm is to select a single service from each of the classes which satisfies the given QoS constraints while at the same time maximizes the value of the composite utility function. Algorithm 1 HYBRID VNS(CSinitial , dmax , tabuListDim, timeLimit) CSopt = CSinitial ; Qopt (CS) = Q(CSinitial ); repeat the following steps until timeLimit is exceeded d=1; repeat the following steps until d = dmax Generate a neighboring solution CScurrent by substituting randomly chosen services in CSopt ;// Shake CSlocal = TABU SEARCH(CScurrent , tabuListDim, tabuT imeLimit); if Q(CSlocal ) > Qopt (CS) then CSopt = CSlocal ; Qopt (CS) = Q(CSlocal );// Move d = 1; else d = d + 1; //Next neighborhood endif end
150
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
end return CSopt The algorithm starts with an initial feasible solution obtained by the greedy-add approach with back-tracking proposed in [11]. The improvement of the initial solution is then attempted by the proposed algorithm which uses TS as the local search algorithm in VNS. The neighborhood Nd , d = 1, .., dmax (where dmax is a VNS parameter) of a given solution is the set of all solutions that differ from the current solution in exactly d services. The proposed algorithm starts with d = 1. In each iteration the change of neighborhoods is achieved by excluding services from d randomly chosen classes in the solution and replacing each of them with a randomly chosen service from the same class as the excluded service (shake). TS is applied as a local search method. In order to determine which service should be excluded from the solution in each iteration of the TS, for each class all of the remaining services in that class are evaluated. If the regarded service is not in the Tabu List and it is possible to add it to the solution without violating the constraints, the next step is to calculate its effect on the objective function. Once the current neighborhood of the current incumbent solution has been completely explored the service which yields the best objective function value among those regarded is added to the solution, regardless of the fact that it may not present an improvement. The service from the same class which was part of the previous solution must be excluded from it and added to the Tabu List so it cannot be included again in the following iterations. If the current solution yields an improvement it becomes the new local optimum. The search continues in the same manner with the new current solution and terminates once the time limit has been exceeded. Once the TS algorithm terminates, if a better solution than the current best is found the search moves there and the whole process is re-iterated, starting from the local optimum as the current incumbent and d = 1. Otherwise if no improvement can be achieved d = d + 1. The algorithm iterates the shake and TS phases until the time limit is exceeded.
5
Experimental Results
The algorithm was tested by varying the number of classes, services, attributes and parameters and repeated several times with the same parameters because of the randomness present in VNS (the most frequently obtained results are presented). The results were compared to the results obtained by applying the TS and VNS algorithms separately on the same test instances [11]. The proposed algorithm has been implemented in the C# programming language
151
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
for .NET Framework 4.0 and run on a machine with the following configuration: Intel Core 2 Duo CPU E7500 processor, 2.93Ghz, 3.24GB RAM. For implementation purposes the problem was defined as a minimization problem. Table 1 Experimental results (the time is measured in milliseconds) m
7
p
77
10 110
n
Exact solution
Initial solution
Tabu list dimension
dmax
Time limit
TS
VNS
1.41
1.82
3
3
200
1.45
1.44
1.44
5
5
200
1.45
1.44
1.44/1.41
3
5
200
4
4
Time:
Iterations:177
46859.4
Time:15.625
2.06
2.55
Time:
Iterations:2987
26218031.25
Time:31.25
1.44
5
3
200
3
3
1000
2.52 2.25/2.20/2.18
10000
2.52 2.20/2.16/2.24 2.07/2.16/2.13
5
7
3
5
6
Hybrid
5
7
5
3
1.41/1.44 2.07
1000
2.16 2.24/2.29/2.16
2.06
10000
2.16
2.06
1000
2.16 2.24/2.18/2.16
2.13
10000
2.16
2.06
2.16
2.16
1000
2.13
10000
2.13
1000
2.13
10000
2.06
Conclusions
The web service selection problem involves selecting a single service from each of the required composition classes to maximize the value of the composite utility function while at the same time satisfying the given QoS constraints. In this paper, the idea was to combine the techniques of the two approaches for escaping from poor local optima. Once an initial feasible solution is obtained the improvement of the initial solution is attempted by applying the VNS algorithm. The local search in the VNS algorithm is performed by the TS algorithm which terminates after the allotted time has been exceeded. The experimental results show that the hybrid algorithm gives optimal or near-optimal solutions in a short timeframe regardless of the dimensions of the problem (the exact solution for 110 services from 10 classes was found, through an exhaustive search of combinations, in 7.5 hours while a near-optimal solution was found in less than 10 seconds). Moreover, it consistently gives better results compared to both TS and VNS which was to be expected given the fact that it combines the strengths of both and has often achieved the exact solution in a significantly shorter timeframe. Therefore, it can be applied to a wide class of problems especially those for which the time taken for finding
152
N. Turajli´c, I. Dragovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 145–152
the exact solution is unacceptably long.
References [1] Aggarwal, R., K. Verma, J. A. Miller, and W. Milnor, Constraint Driven Web Service Composition In Meteor-S, Proc. of SCC04, China (2004), 23–30. [2] Belhaiza, S., Hybrid Variable Neighborhood - Tabu Search algorithm for the Site Dependent Vehicle Routing Problem with Time Window, GERAD Working Paper (2010). [3] Cao, H., X. Feng, Y. Sun, Z. Zhang, and Q. Wu, A Service Selection Model with Multiple QoS Constraints on the MMKP, Proc. of FIP Intl. Conf. NPC (2007), 584–589. [4] Hansen, P., N. Mladenovi´c, and J. Moreno Perez, Variable neighbourhood search: methods and applications, Ann. Oper. Res. 175 (2010), 367–407. [5] Gendreau, M., and J.-Y. Potvin, Metaheuristics in combinatorial optimization, Annals of Oper. Res. 140 (2005), 189-213. [6] Glover, F., Tabu Search, ORSA J. Comput. (1989) 1, 190–206. [7] Jaeger, M., G. Muhl, and S. Golze, QoS-aware Composition of Web Services: An Evaluation of Selection Algorithms, LNCS 3760 (2005), 646-661. [8] Luo, W., A Variable Neighborhood Tabu Search Algorithm for the Heterogeneous Fleet Vehicle Routing Problem with Time Windows,LEITS10,China (2010),1–4. [9] Mladenovi´c, N., and P. Hansen, Variable neighborhood search, Comput. Oper. Res. 24 (1997), 1097-1100. [10] Strunk, A., QoS-aware service composition: A survey, Proc. of the ECOWS10, Cyprus (2010), 67–74. [11] Turajli´c, N., and S. Neˇskovi´c, Variable Neighborhood Search and Tabu Search for the Web Service Selection Problem, to be presented at EUROmC-XVIII-VNS Montenegro (2012). [12] Yu, T., Y. Zhang, and K.–J. Lin, Efficient algorithms for Web services selection with end-to-end QoS constraints, ACM Trans. Web 1 (2007), 1–26. [13] Zeng, L., B. Benatallah, A. H. H. Ngu, M. Dumas, J. Kalagnanam, and H. Chang, Quality-aware middleware for Web service composition, IEEE Trans. Softw. Eng. 30, (2004), 311-327. [14] http://www.w3c.or.kr/kr-office/TR/2003/ws-qos/.