Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 39 (2012) 177–184 www.elsevier.com/locate/endm
Variable Neighborhood Search and Tabu Search for the Web Service Selection Problem Nina Turajli´c 1 Siniˇsa Neˇskovi´c 2 Faculty of Organizational Sciences, University of Belgrade, Belgrade, Serbia
Abstract When a composition of web services is needed to achieve some desired functionality it is necessary to choose a particular service for each of the components. There may be a large number of web services offering similar functionality and when choosing a service, the decision should be based on the relevant Quality of Service (QoS) attributes. Therefore, the main goal of the web service selection problem is to choose the composition with the best performance which also satisfies certain constraints regarding the required QoS levels. Since for large problems the exact solution may be impossible to reach in an acceptable timeframe, due to the exponentially growing number of possible combinations, for the first time Variable Neighborhood Search (VNS) is introduced for solving this problem. The greedy-add algorithm with backtracking is introduced for obtaining the initial solution and a better solution is sought through VNS as well as Tabu Search. The experimental results demonstrate the efficiency of the proposed approaches. Keywords: Web Service Selection Problem, QoS, MMKP, Cloud Computing, 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.024
178
1
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
Introduction
A large number of web services providing the certain functionality are accessible on the Internet and they could be grouped into classes on the basis of this functionality. On the other hand, often a single service cannot provide the required functionality by itself yet a set of services, composed together, might. With the growing popularity of Cloud Computing the Quality of Service (nonfunctional properties such as: performance, security, availability etc.[10]) of distributed applications have become even more important. So the goal is to select the composition with the best performance which at the same time satisfies certain constraints regarding the required QoS levels of the composite service. The problem is modeled as a multi-dimensional multiple-choice knapsack problem (MMKP) as in most approaches [9]. Since the MMKP is known to be NP-hard the use of heuristic methods is preferable and, though they do not guarantee the global optimal solution will be found, they can give good near-optimal results in an acceptable timeframe. While heuristics, such as local search methods, are based on local improvements of the initial solution until a local optimum is found, metaheuristics (e.g. Tabu search, Variable Neighborhood Search) use different techniques to avoid getting trapped in poor local optima. Tabu search (TS) [3] is based on a local search which keeps track not only of the current solution but also the search history which is used to avoid cycling and getting trapped in a local optimum (by forbidding the search to return to recently visited solutions for a number of iterations). Contrary to most other local search methods and TS, the Variable Neighborhood Search (VNS) [6] does not follow a trajectory but explores increasingly distant neighborhoods of the current incumbent solution. Both TS and VNS can be used for solving the MMKP problem in [8,4]. The proposed approach assumes that an initial feasible solution is found using a novel method based on the greedy-add approach with back-tracking and a better solution is sought through VNS or TS. Section 2 gives an overview of the related work, Section 3 details the problem and the proposed solution and the experimental results are shown in Section 4.
2
Related Work
A large number of approaches to solving the web service selection problem exist [9] and only those with similar approaches to the ones presented in this paper will be presented. In [5] the concept of dominance is used to skip those variables which can be substituted by others. The aggregate resource value
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
179
is calculated and the services in a group are sorted in non-descending accordingly. The initial solution is sought by primarily choosing those services with the highest value in the group and in the next upgrading step services with a higher resource value than the initial are selected along the sorting queue in each group. In [1] first a LP relaxation of mixed integer programming (MIP) formulation of the problem is solved and then a backtracking algorithm is used to obtain a feasible solution of the original, non-relaxed problem. To improve this solution two meta-heuristics are also proposed: the first consists of randomly replacing services in the solution in order to achieve a feasible solution with higher overall QoS and the second is based on Simulated Annealing. In the heuristic proposed in [2] a neighborhood of the current point is defined and then a move is made to the best point in the neighborhood. The neighborhood is the set of all allocations obtained by replacing for each activity the service providing the best improvement for each of the QoS attributes. The heuristic for finding the initial solution proposed in this paper is based on the sorted utilities of services in a class similar to [5]. The random replacement of variables as in [1] is incorporated into the VNS approach but is carried out in a controlled manner by constricted the replacement only to variables in the current neighborhood of the solution. Compared to [2] TS restricts the moves in the neighborhood by not allowing the search to return to recently visited solutions while VNS uses several neighborhoods instead on just one.
3
Solving Web Service Selection Heuristically
The main goal of the web service selection problem is to choose component services from each of the required classes on the basis of the chosen QoS attributes so that an optimal composition is achieved. Generally, certain constraints regarding the required QoS attribute levels of the composition are also given. Though there exist various QoS attributes [10] which could be regarded, the proposed algorithms do not depend on the chosen set. The QoS values of each service first need to be scaled to the [0,1] interval then aggregated. The nature of the aggregation depends on the chosen attributes e.g. the response time of a composition is calculated as the sum of the response times of the participating services, while the reliability is calculated as a product etc. The aggregated values for the chosen QoS attributes are combined into a single utility function by using the Simple Additive Weighting technique where non-linear aggregation functions are have previously been transformed into linear ones. The utility function should also reflect the fact that certain QoS attributes should be maximized while others should be minimized.
180
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
To define the problem the following assumptions are made: For a given set of classes C = {C(1), ..., C(m)} each containing a set of services sij , where j refers to a particular service in class C(i)(j = 1, ..., pi ) and a chosen set of QoS attributes q k where k = 1, ..., n the quality level of each service for attribute q k is defined by qijk . Therefore, the utility of a particular service sij is: (1)
n1 n qijk − Qkmin Qkmax − qijk wk − wk fij = Qkmax − Qkmin Qkmax − Qkmin k=1 k=n +1 1
where n1 attributes should be maximized and n−n1 minimized, wk denotes the relevance of the k-th attribute, Qkmin = min∀sij qijk and Qkmax = max∀sij qijk . The goal is to maximize the overall utility of the composite service while satisfying the given QoS constraints. Since all aggregation functions are now linear the overall utility of the composite service can be calculated as the sum of the individual utilities. As previously stated the problem is modeled as a MMKP. A solution represent a set of vectors X = xi , xi = [xi1 . . . xipi ], where xij = 1 if service sij should be included in the composition, otherwise xij = 0. 3.1 Initial Solution An initial feasible solution is found using a method based on the greedy-add approach and which includes back-tracking developed specifically for this problem. The premise is that each of the classes is given a preference. The classes are sorted according to these preferences and the services within them are sorted according to the value of the objective function that they achieve. The class with the highest preference is regarded first. The first service from this class which satisfies the given constraints is added to the solution. Then the class with the second highest preference is regarded etc. If no service from a class satisfies the given constraints the algorithm back-tracks by dropping the previously selected service from the solution and continuing the search within the previously regarded class for the next service satisfying the constraints. Once it has been found and added to the solution the search continues in the next class from its first service. The procedure proceeds in the same manner, moving forward or back-tracking, until services satisfying the constraints have been selected from each of the classes. Since the algorithm only allows feasible solutions and backtracks if none can be found, it ultimately results in an exhaustive search. Therefore, the only way it can generate an infeasible solution is if there is no feasible solution to the problem. Subsequently, a better solution is sought through either TS or VNS. Both of these algorithms use the same local search procedure (BEST MOVE).
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
181
3.2 Local Search The local search method completely explores the neighborhood of the current solution. For each class the service which is part of the incumbent solution is excluded and all of the remaining services in that class are evaluated. For each service it is first necessary to check whether it is possible to add it to the solution without violating the constraints. If it is feasible the next step is to calculate its effect on the objective function. The method results in the solution with the best objective function value among the regarded solutions. Algorithm 1 BEST MOVE(X) maxΔ = 0; X = X; for i = 1, ..., m for j = 1, ..., pi if xij = 1 then X = X; xij = 1; xil = 0; //Substitute sil (xil = 1) with sij if X is feasible then Calculate Δ = fij − fil ; if Δ > maxΔ then maxΔ = Δ; X = X ; endif endif endif end end return X 3.3 Tabu Search Algorithm 2 TABU SEARCH(X0 , tabuListDimension, timeLimit) X = X0 ; X ∗ = X0 ; F ∗ = F (X0 ); T abuList = ∅; repeat the following steps until timeLimit is exceeded X = BEST MOV E(X); //Services in the T abuList are not regarded X = X ; Update T abuList; if F (X ) > F ∗ then X ∗ = X ; F ∗ = F (X ); endif end return X ∗
182
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
In each iteration only one service will be excluded from the solution. In order to determine which a local search is performed. The local search is adjusted by the restriction that only those services which are not in the Tabu List may be regarded. Once the local search concludes, the solution with the best objective function value among the regarded solutions becomes the current solution, regardless of the fact that it may not present an improvement. Both the current and best solutions are stored. If the current solution presents an improvement it becomes the best solution and the service from the same class which was part of the previous solution is added to the Tabu List. 3.4 VNS Unlike local search and TS in VNS a set of neighborhoods is defined Nd , d = 1, ..., dmax (where dmax is a VNS parameter) thereby expanding the search over an increasing radius to avoid getting trapped in a poor local optimum. The neighborhood Nd of a given solution is the set of all solutions that differ from the current solution in exactly d services. The algorithm starts with N1 . In each iteration a random starting point is generated i.e. d services comprising the solution are randomly chosen and excluded (shake). The local search method is applied and the current neighborhood of the current incumbent solution is completely explored. If the local optimum is better than the current incumbent, the whole process is re-iterated within N1 of the new solution, otherwise if no improvement can be achieved Nd+1 is explored. Algorithm 3 VNS(X0 , dmax , timeLimit) X ∗ = X0 ; F ∗ = F (X0 ); repeat the following steps until timeLimit is exceeded d = 1; repeat the following steps until d = dmax Randomly generate a solution X in the neighborhood of X ∗ ; // Shake X = BEST MOV E(X); if F (X ) > F ∗ then X ∗ = X ; F ∗ = F (X ); d = 1;// Move else d = d + 1; //Next neighborhood endif end end return X ∗
183
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
4
Experimental Results
All of the proposed algorithms were implemented in the C# programming language 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. The algorithms were tested by varying the number of classes, services, attributes and relevant parameters ( (tabu list dimension, maximum number of neighborhoods and time limit). Because of the randomness present in the VNS algorithm the corresponding tests where run several times and the most frequently obtained results are presented. For implementation purposes the problem was defined as a minimization problem. Table 1 Experimental results (the time is measured in milliseconds) m
p
n
Exact solution
7
77
4
46859.4
Time:15.625
10 110
4
Initial solution
Tabu list dimension
dmax
Time limit
TS
VNS
1.41
1.82
3
3
200
1.45
1.44
Time:
Iterations:177 5
5
200
1.45
1.44
3
3
1000
2.52 2.25/2.20/2.18
10000
2.52 2.20/2.16/2.24
2.06
2.55
Time:
Iterations:2987
26218031.25
Time:31.25
5
7
5
5
7
1000
2.16 2.24/2.29/2.16
10000
2.16
1000
2.16 2.24/2.18/2.16
10000
2.16
2.16
2.16
Conclusions
The main goal of the web service selection problem is to choose an optimal composition of services (from each of the classes required to achieve the desired functionality) on the basis of chosen QoS attributes which satisfies the given QoS constraints. Since the number of combinations to be evaluated grows exponentially with the increase in the number of services the exact solution may be impossible to reach in an acceptable timeframe. Therefore, the use of heuristic methods for solving this type of problem is preferable and in this paper the use of Tabu Search and Variable Neighborhoods Search is proposed. To the best of our knowledge this is the first time these two metaheuristics have been used for solving the web service selection problem modeled as a MMKP, though Tabu Search has been applied to a different model of the problem [7].
184
N. Turajli´c, S. Neškovi´c / Electronic Notes in Discrete Mathematics 39 (2012) 177–184
The experimental results show that both improvement algorithms give optimal or near-optimal solutions in a short timeframe regardless of the dimensions of the problem (a near-optimal solution was found by both algorithms in less than 10 seconds for 110 services in 10 classes while the exact solution was found through an exhaustive search in 7.5 hours). Therefore, they can be used to solve a larger class of problems than those that can be solved by exact algorithms. Even though VNS has, on average (due to the randomness present in the shaking step), given slightly better results than TS for all of the tested instances, more extensive testing is necessary to achieve a fair comparison of these two approaches and this would be a subject of further work.
References [1] Berbner, R., M. Spahn, N. Repp, O. Heckmann, R. Steinmetz, Heuristics for QoS-aware Web Service Composition, Proc. ICWS’06, Illinois (2006), 72–82. [2] Dubey, V. and D. Menasce, Utility-Based Optimal Service Selection for Business Processes in Service Oriented Architectures, ICWS10, Florida (2010), 542–550. [3] Glover, F., Tabu Search, ORSA J. Comput. (1989) 1, 190–206. [4] Hanafi, S., J. Lazi´c, N. Mladenovi´c, C. Wilbaut, and I. Crevits, New hybrid matheuristics for solving the multidimensional knapsack problem, Hybrid Metaheuristics, LNCS, 6373 (2010), 118-132. [5] Luo, Y., Y. Qi, L. Shen, D. Hou, C. Sapa, and Y. Chen, An Improved Heuristic for QoS-Aware Service Composition Framework, Proc. of HPCC-2008, China (2008), 360–367. [6] Mladenovi´c, N., and P. Hansen, Variable neighborhood search, Comput. Oper. Res. 24 (1997), 1097–1100. [7] Parejo, J. A., P. Fernandez, and A. R. Cortes, QoS-Aware Services composition using Tabu Search and Hybrid Genetic Algorithms, Actas de los Talleres de las Jornadas de Ingeniera del Software y Bases de Datos, 2 (2008), 55–66. [8] Romaine, J., “Solving the Multidimensional Multiple Knapsack Problem with Packing constraints using Tabu Search“, M.Sc. Thesis, Air Force Institute of Technology, Ohio (1999). [9] Shi Y., and X. Chen, A Survey on QoS-aware Web Service Composition, Proc. of MINES ’11, China (2011), 283–287. [10] W3C, QoS for Web Services: Requirements and Possible Approaches(2003), http://www.w3c.or.kr/kr-office/TR/2003/ws-qos.