You are on page 1of 15

J. Intell. Syst.

2017; 26(1): 123–137

Prashanth Podili, K.K. Pattanaik* and Prashanth Singh Rana

BAT and Hybrid BAT Meta-Heuristic for Quality


of Service-Based Web Service Selection
DOI 10.1515/jisys-2015-0032
Received April 13, 2015; previously published online January 22, 2016.

Abstract: Efficient QoS-based service selection from a pool of functionally substitutable web services (WS)
for constructing composite WS is important for an efficient business process. Service composition based
on diverse QoS requirements is a multi-objective optimization problem. Meta-heuristic techniques such as
genetic algorithm (GA), particle swarm optimization (PSO), and variants of PSO have been extensively used
for solving multi-objective optimization problems. The efficiency of any such meta-heuristic techniques lies
with their rate of convergence and execution time. This article evaluates the efficiency of BAT and Hybrid BAT
algorithms against the existing GA and Discrete PSO techniques in the context of service selection problems.
The proposed algorithms are tested on the QWS data set to select the best fit services in terms of maximum
aggregated end-to-end QoS parameters. Hybrid BAT is found to be efficient for service composition.

Keywords: Web service, composition, meta-heuristic, particle swarm optimization (PSO), BAT algorithm,
Hybrid BAT algorithm.

1 Introduction
Service-oriented architecture (SOA) provides an amicable way of integrating web services (WSs) by means
of standard protocols such as Service Oriented Architecture Protocol (SOAP) and Web Services Description
Language (WSDL) to accomplish complex business processes. This effectively helps reuse of services through
service composition for complex business process applications. The business process execution language
(BPEL) is currently a de facto standard for composing and executing business processes. BPEL defines the
order of execution of services in a service composition [22] and the service discovery engine identifies the
available services for each task or process using existing infrastructure (e.g. Universal Description, Discovery,
and Integration) by semantic functional matching between the tasks and the service descriptions [1]. The
availability of functionally similar services will produce different compositions with possibly different overall
QoS associated with each composition.
With the proliferation of the number of WSs providing the same functionality in the recent times, the
selection of services satisfying user-specified QoS constraints is a key in building a desired composite service.
The aggregated end-to-end QoS values of a WS composition are decided collectively by the selected indi-
vidual service components rather than by any single component. Selection of services considering diverse
QoS parameters under users global constraints is a multi-objective optimization and has been proven to be
NP hard [5]. The number of combinations for a composition plan increases as the number of services under a
service category (task) increases.
Early research formalized service selection problem with global optimization of end-to-end QoS param-
eters as linear integer programming problem (LIP), multi-index multi-choice (MIMC) 0–1 knapsack problem,
and multi-constraint optimal path problem based on graph model [29, 30]. Much recent works proposed

*Corresponding author: K.K. Pattanaik, A-117, Atal Bihari Vajpayee-Indian Institute of Information Technology and Management
Gwalior, Morena Link Road, Gwalior, MP 474015, India, e-mail: kkpatnaik@iiitm.ac.in
Prashanth Podili: School of Computer Engineering, Indian Institute of Technology, Hyderabad, India
Prashanth Singh Rana: Thapar Institute of Engineering and Technology, Patiala, India

Unauthenticated
Download Date | 2/26/20 3:18 PM
124      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

meta-heuristic algorithms to solve the problem. The rate of convergence and the execution time required to
achieve the maximum fitness value in terms of aggregated QoS is still a concern when the number of ser-
vices available for a task increases. In this article, first, the BAT and Hybrid BAT algorithms, meta-heuristic
techniques proposed recently are discussed, and then the service selection problem was modeled according
to these algorithms. BAT algorithm [8, 24] is based on the echolocation behavior, variation in the frequency,
and loudness parameters of the bats. The proposed approach uses local best strategy [18] along with modi-
fied differential evolution (DE) strategy used for local search in Hybrid BAT algorithm. The fitness function
designed for the algorithms in both genetic algorithm (GA) and the proposed BAT algorithms is evaluated
to get the composite QoS values of availability, response time, reliability, latency, throughput, and success
rate parameters. The algorithm efficacy in terms of number of iterations and execution time to achieve the
maximum fitness value is compared with GA.
Several experiments were performed for different number of tasks with a number of candidate services
for GA, BAT, and Hybrid BAT algorithms. The composition plan having maximum overall end-to-end QoS
is obtained by selecting the services using the fitness function designed from the QoS parameters consid-
ered. The algorithm is tested for compositions having 10, 15, 20, 25 tasks with 50, 100, 100, 100 services in
each, respectively. Experimental results prove that the Hybrid BAT algorithm outperforms the GA and BAT
­algorithms in terms of number of iterations and execution time.
This article is organized as follows: Section 2 explains the related work. The QoS Model for WS composi-
tion is presented in Section 3. The significance of BAT algorithm over the recent meta-heuristic techniques
and modeling the service selection problem according to BAT and Hybrid BAT algorithms are discussed in
Section 4. Sections 5 and 6 describe GA and Discrete PSO algorithms respectively. Theoretical analysis of
algorithms is presented in Section 7. Experiment and analysis are described in Section 8. Finally, Section 9
concludes the work.

2 Related Work
Hitherto, research in the domain of QoS-based WS selection has been done using different algorithms for
decision making and optimization to obtain the best composition plan. The scalability issues and the high
computational complexity are inevitable for the exhaustive computing methods such as LIP, Mixed LIP, and
MIMC 0–1 knapsack problems. Evolutionary algorithms are a better alternative for these kinds of combinato-
rial optimization problems.
These optimization algorithms are often based on swarm intelligence. Although GAs and particle swarm
optimization (PSO) are very useful, some drawbacks are observed while solving multi-modal optimization
problems. Firefly algorithm (FA) based on the flashing characteristics of tropical fireflies [23] demonstrated
major improvement. The attraction behavior, light intensity coding, and distance dependence provides a sur-
prising capability to enable FA to handle non-linear, multi-modal optimization problems efficiently. Cuckoo
search (CS) algorithm is based on the brooding behavior of some cuckoo species [27] that is combined with
Levy flights. The CS algorithm is efficient because it has very good convergence behavior that can be proved
using Markovian probability theory. Other methods such as eagle strategy are also very effective [12, 28]. The
artificial bee colony algorithm shows good performance in numerical optimization in large-scale global opti-
mization and also in combinatorial optimization [13].
Yang [24] proposed BAT algorithm, a new meta-heuristic technique that works based on the echolocation
behavior of micro-bats. BAT algorithm uses a frequency-tuning technique to increase the diversity of the solu-
tions in the population. The algorithm uses automatic zooming to try to balance exploration and exploitation
during the search process by mimicking the variations of pulse emission rates and loudness of bats when
searching for prey [26]. As the algorithm converges very fast, it could be problematic for higher dimensional
problems. Hence, Hybrid BAT algorithm proposed in [8] combined features of BAT algorithm with DE strategy
described in [16]. This algorithm was tested against standard multi-objective functions such as Griewangk’s,
Rastirigin, Rosenbrock’s, Sphere, and Ackley’s functions. Hybrid BAT significantly improved the results of
BAT algorithm in finding out optimized value with lesser functional evaluations.

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      125

WS selection problem formalized in [16] according to GA uses crossover and mutation operators, with the
chromosome population initialized randomly and each chromosome representing a possible composition
plan. The algorithm is found to be inefficient in terms of execution time when the number of candidate ser-
vices for each task increases. In [10], fitness function to evaluate the end-to-end QoS of the composite service
is designed considering response time, availability, reliability, and cost attributes. Xia et al. [10] used PSO to
achieve Pareto optimal solution for different service categories, with each having a maximum of 12 candidate
services. Ludwig [15] proposed standard PSO and hybrid PSO combined with Munkres algorithm to address
the service selection problem that considers availability, reliability, execution duration, reputation, and price
parameters to design the fitness function. Kang et al. [11] propose the global optimization of dynamic web
service selection (GODSS) strategy to realize WS selection. The fitness function is designed based on the
minimum of time and cost parameters such that the constraints on reputation and reliability are satisfied.
The depth first search (DFS) algorithm is used for initializing population and the algorithm used two point
crossover and uniform mutation operations. In [14], the PSO-GODSS strategy, based on PSO algorithm, is
used to solve the WS composition problem. The fitness function is taken from [11]. As the PSO algorithm is
aimed at continuous solution space problems,the authors used encoding method to ensure the particles fly in
integer space to update the velocity and position of the particles. Experimental results for 10 service groups
for different iteration time were used to compare with GODSS proposed in [11].
In design optimization of steel frames [6], BAT algorithm was used to optimize the design of minimum
weight steel space frames subject to the required constraints and achieved accurate results over other meta-
heuristics algorithms. Nakamura et al. [19] proposed an algorithm for feature selection using Binary BAT algo-
rithm over five public data sets. Here, a binary version of the continuous valued BAT algorithm was derived
where a bat position is represented as a string of bits that encodes whether or not a feature is selected. The
experimental results are compared with well known meta-heuristic algorithms such as PSO, GA, Harmony
Search, and FAs. BAT algorithm is found to be efficient among all the algorithms used for comparison.
This interesting behavior of bat and its application in the recent research for solving optimization prob-
lems motivate us to study the BAT algorithm and consider it for solving WS selection problem. As the BAT
algorithm was used traditionally for solving continuous solution space problems and the service selection
problem is a discrete solution space problem, the BAT algorithm and the Hybrid BAT algorithms need to be
remodeled to their discrete versions.

3 QoS Model for Service Composition


The non-functional properties of a WS are described by its QoS parameters. The following six QoS parameters
are considered in the proposed work from the QWS data set provided by the University of Guelph [2, 3] while
selecting candidate services for each task in a service composition process.
1. Response Time (Qresp), measured in milliseconds (ms), is the time taken to send a service request and
receive corresponding response.
2. Availability (Qava), measured in %, is the number of successful invocations/total invocations of a service.
3. Throughput (Qtput), measured in invokes per second, is the total number of service invocations in a given
time period.
4. Successability (Qsuc), measured in %, is the ratio of number of response messages received to the number
of request messages sent for a service.
5. Reliability (Qrel), measured in %, is the ratio of the number of error messages to total messages of a service.
6. Latency (Qlat), measured in milliseconds (ms), is the time taken for the server to process any given service
request.

As the metrics used for measuring QoS values are different and to normalize the values, the parameters
are divided into positive and negative parameters. Their values decide the probability of a service(s) being
selected for the composition. The normalization process used in proposed work has been adopted from [4]
and reproduced below in Equations (1) and (2) for the positive and negative parameters, respectively.

Unauthenticated
Download Date | 2/26/20 3:18 PM
126      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

 q − qmin
 q − qmin ≠ 0
qnrm =  qmax − qmin max (1)
 1 qmax − qmin = 0
 

 qmax − q
 q − qmin ≠ 0
qnrm =  qmax − qmin max (2)
 1 qmax − qmin = 0
 

3.1 WS Composition Problem

Assume that a complex business process with n different tasks (Ti) requires composition of the form nij. Each
of these n tasks may have m number of functionally equivalent services with varying QoS values [Equation
(3)]. In other words, QoS value associated with a service is the prime deciding factor for QoS-based service
selection.

f ( x ) = ∀Ti , ( i = 1, 2, …, n ) ∈Composition, ∃ nij


(3)
( j = 1, 2, …, m )

Figure 1 describes a representative WS composition model where the total possible service compositions mn
with composition structures arising such as sequence, parallel, case, and loop. The global QoS of a composite
service is computed [17] based on the structure of the composition plan. Let the QoS vector of a composite
service be denoted by

Qglob ( CS ) = [ Qresp , Qava , Qrel , Qsuc , Qtput , Qlat ], (4)




where Qresp, Qava, Qrel, Qsuc, Qtput, and Qlat represent the aggregate values of the response time, availability,
reliability, success rate, throughput, and latency, respectively, of the candidate services chosen for service
composition.
Service selection problem is a QoS maximization problem wherein a service from a set of functionally
substitutable services is found, each service having k number of QoS parameters and wi as the respective
weights, a structure of such services are constructed in Equation (5) to formulate the overall composition
maximizing the QoS.
k
Maximize ∑wi ∗Qglob ( CS ) (5)
i=1


Task Task Task


1 2 n

n11 n21 nn1

Start n12 n22 nn2 Stop

n1m n2m nnm

Figure 1: WS Composition.

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      127

Table 1: Aggregate QoS for Various Structures.

Parameters   Sequence   Parallel   Conditional   Loop

Response time 
n
Qrespt = ∑ i = 0qrespt   Qrespt = min n
i =0
qrespt   n
Qrespt = ∑ i = 0qrespt ∗ αi  
n
Qrespt = k ∗∑ i = 0qrespt

Availability  
n
Qava = ∏ i = 0qava   Qava = max in= 0 qava  
n
Qava = ∏ i = 0qava ∗ αi  
n
Qava = k ∗∏ i = 0qava
n
∑ Qthrup = max in= 0 qthrup   n n
Throughput   q
i = 0 thrup
  Qthrup = ∑ i = 0qthrup ∗ αi   Qthrup = k ∗∑ i = 0qthrup
Qthrup =
n
n
∑ Qsucc = max in= 0 qsucc   n n
Success rate   q
i = 0 succ
  Qsucc = ∑ i = 0qsucc ∗ αi   Qsucc = k ∗∑ i = 0qsucc
Qsucc =
n
Reliability  
n
Qrel = ∏ i = 0qrel   Qrel = max ni = 0 qrel  
n
Qrel = ∏ i = 0qrel ∗ αi  
n
Qrel = k ∗∏ i = 0qrel

Latency  
n
Qlat = ∑ i = 0qlat   Qlat = minni = 0 qlat  
n
Qlat = ∑ i = 0qlat ∗ αi  
n
Qlat = k ∗∑ i = 0qlat

Subject to constraint
k

∑w = 1. i (6)
i=1

The multi-objective optimization problem at hand is NP hard and cannot be solved in polynomial time,
which is critical to any business process composition. The proposed work explores the use of BAT and Hybrid
BAT algorithms for solving this problem and evaluates the effectiveness with respect to existing GA technique.

3.2 Fitness Function

The sequence structure of the composition plan is considered to evaluate the global QoS. However, the aggre-
gate QoS of each parameter is described in Table 1 for sequential, loop, conditional, and parallel structures.
n
αi corresponds to the probability of branch i being choosen, ∑ i = 1αi = 1 and k is the number of loop. The total
fitness is computed using Equation (5).

4 BAT and Hybrid BAT Approach to Model WS Composition


BAT algorithm [24] is based on the echolocation behavior of the bats and uses the time delay from the emis-
sion and detection of the echo, the time difference between the two ears, and the loudness variations of the
echoes to build up a three-dimensional scenario of the surroundings, such as the distance and orientation of
the target and the type of prey [9, 20, 25]. In general, all the evolutionary algorithms follow the exploration
and exploitation approaches. In the exploration phase, a global search is performed, and in exploitation
phase, a local search is performed.
When using soft computing approach to WS selection, one important concern is to check if the solution
is giving better fitness value as the iterations proceed, which means that the solution is going to the right
orientation. Thus, the proposed algorithms consider only the orientation parameter. The loudness of the bat
decreases and the rate of emission increases while the bat moves toward its prey, which indicate that the
loudness and emission parameters control the convergence of the solution in a local search. Based on this
behavior of bats, a new meta-heuristic technique is formulated [24] and has been used in many optimization
problems. In the following, the BAT algorithm is revisited while simultaneously explaining the analogy. The
following subsections discuss the algorithms and the complete optimized solution-finding process spread
over four phases: initialize bats, global search and update, local earch, and update, and iterate the process.

Unauthenticated
Download Date | 2/26/20 3:18 PM
128      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

4.1 Phase 1: Initialization Phase

BAT algorithm (see Algorithm 1) starts by randomly initializing a population of bats, each bat representing
a potential solution of the optimization problem. In the WS selection scenario where there are n tasks and m
substitutable services for each task, the solution space contains mn possible compositions each associated
with their corresponding overall fitness (or QoS) value. Each possible composition is list of candidate WSs
and considered as one bat position. A subset of all combinations can be taken as initial population of bats’
positions. For instance, the list [3, 15, 25, 10, 45] represents a bat position indicating the list of candidate
services involved for composite service. Each candidate service is taken randomly from a set of substitutable
WSs for a given task.
Bats fly in the solution space with velocity vi at position xi with a fixed wavelength, varying frequency
fi, and loudness li in search of prey. Bat updates the frequency of its emitted pulses and the rate of emission
with respect to the target every time it changes its position. Each bat has a fitness value evaluated based on
the position it achieved while searching for the prey. In the service composition scenario, a bat position is
a list of candidate services forming a composition and each position represents a candidate solution. The
frequency parameter fi in this case is the number of candidate services in each task represented by vector fi
given by Equation (10), which takes a random value representing there can be varying number of substitut-
able services for any given task.

4.2 Phase 2: Global Search and Update

The bat with the maximum fitness value x* is found from the initial population, and the positions of the
remaining bats from the same initial population are updated in every iteration per Equations (7), (8), and (9):
fi = fmin + ( fmax − fmin ) β, (7)

t−1
vit = vi + ( xit − x ∗ ) fi , (8)

t−1
xit = xi + vit , (9)

where fmin and fmax are the frequency ranges of bat and are uniformly distributed over β(0, 1).

Algorithm 1: BAT Algorithm for WS Composition.

Data: bat population, number of iterations, and ∀, bat: initialize position vector xi, frequency vector fi, loudness li, rate of
emission ri
Result: Global best position, fitness value
begin
 While (number of iterations) do
  ∀, bat: Calculate fitness value and rank in decreasing order;
  Update bat positions using Global Search;
  % local search to find if any better WS exist for a task %
  if (rand ∈ (0, 1)  >  ri) then
   Update candidate WSs with higher local QoS values;
   Evaluate fitness of the updated bat position;
  end
  if (rand ∈ (0, 1)  <  Ai and (fitnesscurrent  <  fitnessupdated)) then
   Bat position  =  updated bat position;
   Decrease Ai, increase ri using Equations (15) and (16) respectively;
  end
 end
end

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      129

In the proposed approaches, the remaining bats’ positions are updated with respect to the global best
position obtained from Equation (11):
fi = βi ( fmax , fmin ) (10)

Updated position = ( X  X ∗ )  fi , (11)


where β is a random list of WSs ∈ (1, 2, … m) representing the number of substitutable WS for each task.
 is the difference operation performed between two bat positions. Each service from the list corresponding
to the global best bat position is compared with the corresponding service from another bat position having
a list of services. A difference indicates there exists better potential candidate service to increase the fitness
value.  is the replacement operation used to replace the differing items in the bat position under consid-
eration with respect to global best bat position list. The list is updated with random values from the range
of substitutable services for a task.
An example scenario is presented here to explain the  and  operations. Consider the bat position [3,
15, 25, 10, 45] as the present global optimum. To check if a better bat position exist, a comparison is performed
with another potential bat position [4, 15, 20, 15, 45]. If differences are found, the latter is updated and its cor-
responding fitness value is estimated. Likewise, the comparison and updating of all initialized bat positions
are done with respect to the present global optimum. Finally, the outcome will have a new set of bat positions.
For example,
([3, 15, 25, 10, 45]  [4, 15, 20, 15, 45])  fi
= ([_, 15, _, _, 45])  fi = [ f1 , 15, f2 , f 3 , 45]

A difference in the two lists at indexes 1, 3, and 4 indicates the existence of a better bat position. The list
is updated with random values chosen from the range of substitutable services for a task.

4.3 Phase 3: Local Search and Update

A random walk for each bat position is made that modifies the current position for an improved solution
according to Equation (12)

xit = best + εAit , (12)



where ε(0, 1) is a random number and Ait is the average loudness at time t.
The algorithm adopts the local best first (LBF) strategy [18] to find if a candidate service exist with a better
local QoS and updated accordingly. Local QoS is defined as the QoS associated with each candidate WS and
is given in Equation (13). In the proposed approach, the local search implements a list of dictionaries, each
for a task and sorted in ascending order of their QoS values of candidate services. Each index of bat position
is updated with its immediate next value in the respective dictionary of each task. The candidate service
having higher local fitness is to be selected for the composition to achieve an overall aggregate fitness of the
bat position.
The local QoS value of WS:
q
nij = ∑wi qi , (13)
i=0

where wi is the weight of the parameter, same as in Equation (6), and qi is the corresponding parameter value
of the WS.
The Hybrid BAT algorithm (see Algorithm 2) performs local search using DE [7, 21], a technique for opti-
mization proposed by Storn and Price in 1995. Differential optimization technique consists of a population
of candidate solutions for the optimization problems. The new solutions are created by DM process first and

Unauthenticated
Download Date | 2/26/20 3:18 PM
130      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

Algorithm 2: Hybrid BAT Algorithm for WS Composition.

Data: bat population, number of iterations, and ∀, bat: initialize position vector xi, frequency vector fi, loudness li, rate of
emission ri
Result: Global best position, fitness value
begin
 while (number of iterations) do
  ∀, bat: Calculate fitness value and rank in decreasing order;
  Update bat positions using Global Search;
  % local search to find if any better WS exist for a task %
  if (rand ∈ (0, 1)  >  ri) then
   Update candidate WSs with DM and LBF strategy;
   Evaluate fitness of the updated bat position;
  end
  if (rand ∈ (0, 1)  <  Ai and (fitnesscurrent  <  fitnessupdated)) then
   Bat position  =  updated bat position;
   Decrease Ai, increase ri using Equations (15) and (16) respectively;
  end
 end
end

then differential crossover (DC). The best fit candidates are then selected and retained in differential selec-
tion. The DM process randomly picks two candidate solutions and then adds a scaled difference between the
second and the third solutions. When the Hybrid BAT algorithm is applied on a WS selection problem, the
result obtained from a modified DM suitable to WS selection cannot be processed for DC, as the DC process
randomly takes parts of the list of candidate WSs pertaining to different bat positions. In a WS composition,
a random combination of two partial lists will not lead to an improved fitness value. Hence, the process of
DC is not used in the exploitation phase of a WS composition problem. Further, the algorithms use the LBF
approach using ⊕ operator for finding a candidate WS with maximum QoS within a task. The DM process
used in the proposed algorithm is described with the help of an example:

Updated position = Xi ⊕ ( Xi + 1  Xi + 2 ), (14)




where Xi, Xi + 1, and Xi + 2 are the three bat positions in decreasing orders of their fitness values, respectively.
The ⊕ operation is defined as the comparison of QoS values associated with every candidate WS within
a task to obtain the WS with best QoS.
The  operation is the set difference operation performed on two bat positions under consideration. Let
X 1 = [3, 15, 25, 10, 45], X 2 = [4, 15, 20, 15, 45], X 3 = [5, 15, 21, 35, 45],

be the bat positions in descending order of their fitness values. The position of bat X1 is updated as
X 2  X 3 = ([4, 15, 20, 15, 45]  [5, 15, 21, 35, 45]) = ([4, _, 20, 15, _])

X 1 ⊕ ( X 2  X 3 ) = [3, 15, 25, 10, 45] ⊕ ([4, _, 20, 15, _])

Indexes 2 and 5 of X1 are updated to 15 and 45.


Index 1 of X1 is updated to 4 as local QoS (3)  <  local QoS (4).
Index 3 of X1 remains 25 as local QoS (25)  >  local QoS (20).
Index 4 of X1 is updated to 15 as local QoS (10)  <  local QoS (15).
The updated position  =  [4, 15, 25, 15, 45].

The loudness li and rate of emission ri parameters together control the convergence rate of algorithm and
get updated as the iteration proceeds. The strategy signifies that the randomized bat positions are initially
updated, exploring the global space, and as the iterations proceed, the local search plays an important role in

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      131

Table 2: Analogy of BAT and Hybrid BAT Algorithms with WS Selection Problem.

Position vector   Represented as vector of candidate WSs for the composite service
Frequency vector   Chosen randomly in the range (1, number of candidate services for a task)
Global search   Bat positions are updated with respect to the current best bat position.
Loudness, emission parameters  To control the convergence of algorithm in local search in both BAT and Hybrid BAT
Local search   LBF search for BAT algorithm, DM and LBF for Hybrid BAT algorithm

improving the solutions generated in the global search. In the original BAT algorithm, the range of the initial
loudness and emission rates chosen are close to [1, 2] and (0, 1], respectively. In the proposed algorithms,
the change in loudness and rate of emission parameters are updated using Equation (15) and (16) and is
described in Algorithm 1.
t+1
Ai = αAit , (15)

t+1
ri = 1 − (1 − ri0 ) γt ≤ rmax , (16)

where α and γ are constants.

4.4 Phase 4: Iteration Phase

The above three phases repeat until either the maximum fitness value is reached or the number of iterations
is completed.
Table 2 presents the analogy of parameters and functions used in bat algorithm to WS composition
problem.

5 Genetic Algorithm
GA (see Algorithm 3) starts by randomly initializing a population of chromosomes. Each chromosome repre-
sents a list of candidate WSs for the composite service. The fitness value of each chromosome is calculated using
Equation (5). Crossover and mutation operations are performed on the population, and the best population

Algorithm 3: GA for WS Composition.

Data: Chromosome population, number of iterations, mutation rate, crossover rate


Result: Global best position, fitness value
begin
 Select a set of vectors of WSs for initial population, iterations, mutation rate, crossover rate;
 while (number of iterations) do
  ∀, chromosome: Calculate fitness value and rank in decreasing order;
  if (rand ∈ (0, 1)  <  crossover rate) then
   Select a subset of chromosomes from the total population;
   Apply crossover on the subset to generate new chromosomes;
   Rank the chromosomes and select the population based on fitness value;
  end
  if (rand ∈ (0, 1)  <  mutation rate) then
   Select a subset of chromosomes from the total population;
   Apply mutation on the subset;
   Rank the chromosomes and select the population based on fitness value;
  end
 end
end

Unauthenticated
Download Date | 2/26/20 3:18 PM
132      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

having maximum fitness values among all the newly generated chromosomes are selected for next iteration.
Our approach uses single-point crossover operation and uniform mutation operations as explained below.
Crossover operation: Consider two chromosomes, [3, 15, 25, 10, 45], [4, 15, 20, 15, 45], each representing
a list of candidate services involved for composite service. Each candidate service is taken randomly from a
set of substitutable WSs for a given task. A random point is chosen in the range of number of tasks (here 5)
and performed crossover to get two child chromosomes. Let chosen random point be 2 and the child chromo-
somes are [3, 15, 25, 15, 45] and [4, 15, 20, 10, 45].
Mutation operation: Consider the chromosome [3, 15, 25, 10, 45]. A random point is chosen in the range
of number of tasks (here 5), and the value at that index is replaced with a uniform random value selected
between the upper and lower bounds for that task. For example, let 3 be the random point generated from the
list, the corresponding value 25 is replaced with another candidate service chosen randomly from the range
of number of candidate WSs (m) considered for this task. Let 30 be the randomly chosen point. The chromo-
some generated is now [3, 15, 30, 10, 45].

6 Discrete PSO
Basic PSO and its variants are used for continuous solution space problems. We adopted discrete PSO (see
Algorithm 4) for solving WS composition problem. Particle population is initialized randomly where each
particle represents a list of candidate WSs for the composite service, e.g. [2, 7, 5, 23, 11, 45]. The fitness value
is calculated for each particle and ranked based on fitness value. The best particle with maximum fitness
value is set as gbest. In every iteration, every particle position is compared with the best position attained by
that particle till then (local best) with the current position. The best position with respect to fitness is selected
as pbest. The position update is performed according to Equations (17)–(19). V1 and V2 corresponds to position
updates with respect to local best and global best particles.
Change in position( V ) = ( V1 ⊕ V2 ), (17)


V = r1  ( X pbest  X ) ⊕ r2  ( X gbest  X ), (18)



Updated position = X ⊕ V , (19)


where r1 and r2 are random lists of WSs ∈ (1, 2, … m) representing the number of substitutable WS for each task.
The  operation is the difference operation performed as described earlier in Section 4.2. The ⊕ ­operation is
performed by comparing corresponding positions in X and V. If found same, service is retained, else value is
taken from V.

Algorithm 4: Discrete PSO for WS Composition.

Data: particle population, number of iterations, and ∀, particles: initialize position vector Xi,
Result: Global best particle,Best fitness value
begin
 while (number of iterations) do
  ∀, particle: Calculate fitness value and rank in decreasing order;
  % update using local best to find if any better WS exist for a task %
  V1  =  r1  (Xpbest  X)
  % update using global best to find if any better WS exist for a task %
  V2  =  r2  (Xgbest  X)
  Change in Position(V)  =  (V1 ⊕ V2)
  Updated particle position  =  Xi ⊕ V;
 end
end

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      133

7 Theoretical Analysis
The time complexity of the algorithms under consideration are calculated based on a single iteration. Let P be
the initial population. Calculation of fitness value takes constant amount of time if we get to know the WSs
used in composition. The global search and update phase in both BAT and Hybrid BAT takes O(PlogP+PN)
time, with O(PlogP) time to sort and to find the best bat with maximum fitness value, and O(PN) time to
update bat position, where N is the number of services in the composition. The worst case complexity for local
search and update also takes O(PlogP+PN), with O(PlogP) for sorting after global update and O(PN) time to
update positions based on LBF and DM strategies in BAT and Hybrid BAT algorithms, respectively. However,
in Hybrid BAT algorithm, the number of updates in each position is relatively less compared to BAT algorithm
due to DM strategy. This saves significant time during the local search and update process and is much less
than PN. In GA, for every iteration, P chromosomes generate P child chromosomes after single point crosso-
ver. The chromosomes are sorted to get the best P chromosomes in O(2*Plog2P+2*PN) time. Mutation opera-
tion takes O(PlogP+PN) time to update the population P. Thus, the total time taken is O(2*Plog2P+2*PN). PSO
algorithm takes O(P log P+2*PN2). O(P log P) time is required to sort population P and 2*PN2 to randomly select
WSs for each tasks and update using local best and global best positions. However, the update is performed
only if the local fitness value is greater than corresponding positions. Also, the random update using local
best and global best increases as the number of tasks increases in PSO and the time taken for every iteration
increases significantly as the solution space increases.

8 Experiment and Analysis


The experiments are performed on the Guelph data set for WSs first using the standard GA approach and then
using the proposed approaches. For the sake of clarity, the standard GA approach applied to the WS composi-
tion problem is mentioned in Algorithm 3. The algorithms are implemented in Python version 2.3 deployed
in Windows 7 operating system running on i3 processor. Table 3 describes the parameters considered in the
simulation.
The analysis is structured around which approach attains the maximum fitness value in lesser number of
iterations for varying number of tasks, reason for attaining the solutions early, and suitability of an approach.
To elaborate the analysis, different cases with varying number of tasks and candidate WSs for each task was
considered and plots of number of iterations versus fitness value are obtained, as presented in Figures 2–5.
This is done to have a comparative analysis of their efficiency in terms of fitness values and the correspond-
ing iterations.
The BAT algorithm performs poorly in all the cases. The reason for its poor performance is due to the
increase in search space. For every solution obtained after global search, the algorithm performs a local
search using LBF to check for the presence of any better candidate WS for that task within that composi-
tion. Meanwhile, the Hybrid BAT approach uses modified DM that combines the global solutions obtained to

Table 3: Simulation Parameters.

GA   cr   0.5   Crossover rate


  mr   0.5   Mutation rate
BAT   α   0.9   For updating loudness parameter
  β   0.1   For updating emission parameter
Hybrid   α   0.9   For updating loudness parameter
BAT   β   0.1   For updating emission parameter
Parameter weights   0.2, 0.15, 0.2, 0.1,   Weights of the QoS parameters in evaluating fitness value in
0.15, 0.2 Equations (5) and (13)
Number of tasks   10, 15, 20, 25   Composite service size
Candidate WSs per task   50, 100, 100, 100   Number of candidate WSs per task

Unauthenticated
Download Date | 2/26/20 3:18 PM
134      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

Number of tasks=10
4.4

4.3

4.2

4.1
Fitness value

3.9

3.8

3.7
BAT
3.6 Hybrid BAT
GA
PSO
3.5
0 100 200 300 400 500
Iteration

Figure 2: WS Composition – 10 tasks, 50 Candidate WSs.

Number of tasks=15
6.3

6.2

6.1

6
Fitness value

5.9

5.8

5.7
BAT
5.6 Hybrid BAT
GA
PSO
5.5
0 200 400 600 800 1000 1200 1400
Iteration

Figure 3: WS Composition – 15 tasks, 100 Candidate WSs.

Number of tasks=20
8.3

8.2

8.1

8
Fitness value

7.9

7.8

7.7

7.6
BAT
7.5 Hybrid BAT
GA
PSO
7.4
0 200 400 600 800 1000
Iteration

Figure 4: WS Composition – 15 tasks, 100 Candidate WSs.

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      135

Number of tasks=25
10.3

10.2

10.1

10
Fitness value

9.9

9.8

9.7

9.6
BAT
9.5 Hybrid BAT
GA
PSO
9.4
0 200 400 600 800 1000 1200 1400
Iteration

Figure 5: WS Composition – 25 tasks, 100 Candidate WSs.

update its solutions with services having higher local QoS using LBF. This approach is the main contribut-
ing factor for the reduced overall search space and time. GA generates new solutions through crossover and
mutation processes and ranks the solutions based on their fitness value, thus reducing the search space. To
update an existing solution, Hybrid BAT compares the services to check for the presence of WS with higher
local QoS. Thus, for the same search space, Hybrid BAT performs better, especially when the number of pos-
sible compositions are large. Table 4 describes a comparative analysis of the three approaches.
The average iteration time (for all cases) consumed by the algorithms are evaluated and presented in
Figure 6. The Hybrid BAT algorithm takes less time compared to GA and BAT algorithms for all the cases. The
BAT algorithm, however, consumes less time than GA for less number of tasks, but as the number of tasks
increases, the search space increases and it consumes more time compared to GA due to the local search strat-
egy that checks for better candidate WSs for each composition. In GA, the crossover and mutation operations
generate new solutions in each iteration. The fitness of the new solutions are calculated and the population
having better fitness from the current as well as the new solutions are selected for next iterations, whereas in
the Hybrid BAT algorithm, global search and local search operations check to find a composition with better
fitness value and update the existing solutions, resulting in less iteration time.

9 Conclusion
This article discusses the analogy of the BAT and Hybrid BAT approaches to WS selection problem and
proposes mechanisms to find a composition with maximum fitness value in terms of overall QoS of the
composite service. Experiments performed on the QWS data set for different set of tasks in the composi-

Table 4: Performance Comparison.

Algorithm   10 tasks, 50 WSs  15 tasks, 100 WSs per   20 tasks, 100 WSs per   25 tasks, 100 WSs
per task task task per task

GA   Better   Comparable to Hybrid BAT  Comparable to Hybrid BAT  Poor


Hybrid BAT   Poor   Comparable to GA   Comparable to GA   Better
BAT   Poor   Poor   Poor   Poor
PSO   Very poor   Very poor   Very poor   Very poor

Unauthenticated
Download Date | 2/26/20 3:18 PM
136      P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection

Avg iteration time comparison


0.3

0.25

0.2
Iteration time

0.15

0.1

0.05
Hybrid BAT
BAT
GA
PSO
0
10 12 14 16 18 20 22 24 26
Tasks

Figure 6: Average iteration times.

tion with varying candidate WSs in each task. It is observed that the Hybrid BAT algorithm can, in general,
achieve the maximum fitness value in fewer number of iterations compared to GA, BAT, and PSO. Further,
in no case did the PSO and BAT algorithms perform better over their counterparts. Specifically, the Hybrid
BAT can be a better alternative for service selection problems having a large set of tasks and substitutable
WSs for each task.

Bibliography
[1] A. Albreshne, P. Fuhrer and J. Pasquier, Web services orchestration and composition, IEEE Computer Society Press, Los
Alamitos, CA, USA, 2009.
[2] E. Al-Masri and Q. H. Mahmoud, Discovering the best web service, poster, in: 16th International Conference on World Wide
Web (WWW), pp. 1257–1258, 2007.
[3] E. Al-Masri and Q. H. Mahmoud, QoS-based discovery and ranking of web services, in: IEEE 16th International Conference
on Computer Communications and Networks (ICCCN), pp. 529–534, 2007.
[4] M. A. Amiri and H. Serajzadeh, Effective web service composition using particle swarm optimization algorithm, in: 2012
Sixth International Symposium on Telecommunications (IST). IEEE, 2012.
[5] G. Canfora, M. Di Penta, R. Esposito and M. L. Villani, A lightweight approach for QoS-aware service composition, in: Pro-
ceedings of 2nd International Conference on Service Oriented Computing (ICSOC‘04), 2004.
[6] S. Carbas and O. Hasancebi, Optimum design of steel space frames via bat inspired algorithm, in: 10th World Congress on
Structural and Multidisciplinary Optimization, 2013.
[7] I. Fister Jr., I. Fister and J. Brest, A hybrid artificial bee colony algorithm for graph 3-coloring, in: Swarm and Evolutionary
Computation, pp. 66–74, Springer, Berlin, Heidelberg, 2012.
[8] I. Fister Jr., D. Fister and X.-S. Yang, A hybrid bat algorithm, preprint (2013). http://arXiv:1303.6310.
[9] A. H. Gandomi, X. S. Yang, A. H. Alavi and S. Talatahari, Bat algorithm for constrained optimization tasks, Neural Comput.
Appl. 22 (2013), 1239–1255.
[10] X. Hong and Z. Li, Particle swarm algorithm for the quality of service-oriented web services selection, in: Second Interna-
tional Symposium on Knowledge Acquisition and Modeling, 2009. KAM’09, Vol. 3. IEEE, 2009.
[11] G. Kang, L. Jianxun, T. Mingdong and X. Yu, An effective dynamic web service selection strategy with global optimal QoS
based on particle swarm optimization algorithm, in: Proceedings of the IEEE 26th International Conference on Parallel and
Distributed Processing Symposium Workshops & PhD Forum (IPDPSW), 2012. IEEE, 2012.
[12] D. Karaboga and B. Basturk, A powerful and efficient algorithm for numerical function optimization: artificial bee colony
(abc) algorithm, J. Global Optim. 39 (2007), 459–471.
[13] D. Karaboga and B. Basturk, On the performance of articial bee colony (abc) algorithm, Appl. Soft Comput. 8 (2008),
687–697.

Unauthenticated
Download Date | 2/26/20 3:18 PM
P. Podili et al.: BAT and Hybrid BAT Meta-Heuristic for QoS-Based Web Service Selection      137

[14] S. Liu, Y. Liu, N. Jing, G. Tang, and Y. Tang, A dynamic web service selection strategy with QoS global optimization
based on multi-objective genetic algorithm, in: Grid and Cooperative Computing-GCC 2005, pp. 84–89, Springer,
Berlin, Heidelberg, 2005.
[15] S. A. Ludwig, Applying particle swarm optimization to quality-of-service-driven web service composition, in: IEEE 26th
International Conference on Advanced Information Networking and Applications, AINA, 2012. IEEE, 2012.
[16] Y. Ma and C. Zhang, Quick convergence of genetic algorithm for QoS-driven web service selection, Comput. Networks 52
(2008), 1093–1104.
[17] L. Min, et al., A quality of service (QoS)-aware execution plan selection approach for a service composition process, Future
Generation Comp. Syst. 28 (2012), 1080–1089.
[18] A. Mohammad and R. Thomass, Combining global optimization with local selection for efficient QoS-aware service compo-
sition, in: Proceedings of the IEEE International Conference on Web Services, pp. 881–890, Los Angeles, CA, USA, 2009.
[19] R. Y. M. Nakamura, et al. BBA: a binary bat algorithm for feature selection in: 25th SIBGRAPI Conference on Graphics,
­Patterns and Images (SIBGRAPI), 2012. IEEE, 2012.
[20] P. W. Tsai, J. S. Pan, B. Y. Liao, M. J. Tsai and V. Istanda, Bat algorithm inspired algorithm for solving numerical optimization
problems, Appl. Mech. Mater. 148 (2012), 134–137.
[21] R. Storn and K. Price, Differential evolution: a simple and efficient heuristic for global optimization over continuous spaces,
J. Global Optimization 11 (1997), 341–359.
[22] W. Wang, et al., An improved particle swarm optimization algorithm for QoS-aware web service selection in service
­oriented communication, Int. J. Comput. Intell. Syst. 3 (2010), 18–30.
[23] X. S. Yang, Nature-inpsired metaheursitic algorithms, Luniver Press, Frome, UK, 2008.
[24] X.-S. Yang, A new metaheuristic bat-inspired algorithm, in: Nature Inspired Cooperative Strategies for Optimization (NISCO
2010), J. R. Gonzalez, et al., Eds., Stud. Comput. Intell. 284, pp. 65–74, Springer, Berlin, 2010.
[25] X. S. Yang, Review of meta-heuristics and generalised evolutionary walk algorithm, Int. J. Bio-Inspired Comput. 3 (2011),
77–84.
[26] X.-S. Yang, Bat algorithm: literature review and applications, Int. J. Bio-Inspired Comput. 5 (2013), 141–149.
[27] X. S. Yang and S. Deb, Cuckoo search via Levy flights, in: Proceedings of the World Congress on Nature & Biologically
Inspired Computing (NaBic 2009), pp. 210–214, IEEE Publications, USA, 2009.
[28] X. S. Yang and S. Deb, Eagle strategy using Levy walk and firefly algorithms for stochastic optimization, in: Nature Inspired
Cooperative Strategies for Optimization (NICSO2010), C. Cruz, J. R. Gonzalez, D. A. Pelta, G. Terrazas, Eds., Stud. Comput.
Intell. 284, pp. 101–111, 2010.
[29] T. Yu, Y. Zhang and K.-J. Lin, Efficient algorithms for Web services selection with end-to-end QoS constraints, ACM Trans.
Web (TWEB) 1 (2007), 6.
[30] L. Zeng, B. Benatallah, A. H. H. Ngu, M. Dumas, J. Kalagnanam and H. Chang, QoS-aware middleware for web services
composition, IEEE Trans. Software Eng. 30 (2004), 311–327.

Unauthenticated
Download Date | 2/26/20 3:18 PM

You might also like