Greedy Binary Particle Swarm Optimization for multi-Objective Constrained Next Release Problem

Software companies, that adopt agile methodologies in the development of a large and complex software product, encounter the problem of selecting the subset of requirements to be included in the next release of the product. This problem is known as the next release problem (NRP). NRP is identified as an NP-hard problem as it involves a set of conflicting objectives that need to be addressed. These objectives are as follows: (1) maximizing the customer satisfaction taking into consideration that each customer has an importance level to the company, and (2) minimizing the development cost such that it does not exceed the allocated budget. Furthermore, the requirements have dependency and precedence relationships, and each requirement has a priority for each customer according to the customer’s needs. Therefore, metaheuristic algorithms are good candidate for tackling this problem. This paper proposes a hybrid approach to address the multi-objective constrained NRP. The proposed approach is based on adapting an improved binary particle swarm optimization (IBPSO) algorithm. Additionally, a greedy methodology was utilized for swarm initialization to seed the swarm with good solutions. Experimental results, of over six small and large NRP instances, demonstrated that the proposed approach converges much faster to solutions better than the ones discovered by the original binary PSO.


I. INTRODUCTION
During the last decade agile methodologies [1] have gained a substantial popularity among software development companies. In these methodologies, the software product is developed through releases that have to be produced within iterative cycles. Each release includes a new subset of the requirements that should meet the needs of the customers and should be developed within the allocated budget for each iteration [2]. The following constraints must be taken into consideration: (1) The customers have different importance levels to the company, (2) the precedence and dependency relationships among the requirements such that some requirements cannot be developed before others, (3) each requirement has a development cost and (4) requirements have different priority levels to the different customers. This problem is known in the literature as the next release problem (NRP) [3], [4].
The larger the set of requirements, the more complex the NRP gets; due to the huge number of possible combinations that can be formed by all the features. In addition to considering the aforementioned constraints, this context leaves the decision maker with 2 possible combinations to decide from. This is why the NRP is considered one of the complex combinatorial optimization problems [3]. Maximizing the total satisfaction of the customers, and minimizing the company's development cost/effort, are two conflicting objectives that categorize the NRP as a multiobjective optimization problem which is best tackled by metaheuristic algorithms [4]. Some researchers tackled the NRP problem using PSO [5]- [9], ant colony optimization (ACO) [5], [10]- [12], genetic algorithms (GA) [5], [16], [13]- [15]. Some previous research proved that the original BPSO (OBPSO) surpasses both of the ant colony and the GA [3] in solving the NRP, especially the large scale NRP.
This paper proposes a solution to the constrained multiobjective NRP using a hybrid approach that adapts an improved version of the BPSO (IBPSO) [16] and a greedy methodology for the swarm initialization.

A. Research Questions
The paper aims at answering the following research questions: RQ1: Does the performance of the IBPSO surpass the performance of the OBPSO in solving the multi objectives, constrained NRP?
The aim of this question is to compare the performance of the adapted IBPSO algorithm and the adapted OBPSO in solving different sizes of the NRP instances.

RQ2: Does the proposed greedy-random swarm initialization method improve the performance of the IBPSO and the OBPSO?
The aim of this question is to assess the ability of the proposed greedy initialization methodology on guiding the BPSO to discover better solutions.

RQ3: Is the hybrid greedy-random IBPSO scalable?
The aim of this question is to compare the performance of the proposed approach over small and large NRP instances.
The rest of the paper is organized as follows: Section II discusses the previous studies that addressed the NRP. Section III describes the multi-objective constrained NRP. Section IV introduces the PSO algorithm. Section V discusses the proposed approach. While, Section VI discusses the experimental design and the datasets. Section VII discusses the experimental results and provides answers to the research questions. Finally, Section VIII concludes the paper and suggests further extensions to this work.

II. RELATED WORK
NRP was proved to be NP-complete [17]; so several research studies have been conducted to solve the NRP or to prioritize the requirements using metaheuristic algorithms [4]. Bagnall et al. [3] compared greedy randomized adaptive search procedure (GRASP), hill climber and simulated annealing (SA) algorithms in solving different sizes of the NRP; and they found that the SA outperformed both the GRASP and the hill climber especially with large scale NRP instances. Glauber et al. [5] investigated solving the large scale NRP using two metaheuristic algorithms, the ant colony optimization (ACO) and the particle swarm optimization (PSO). The researchers aimed to identify which metaheuristic algorithm is more suitable for handling the large scale NRP. They proved that PSO algorithm achieved much better performance than ACO and the PSO's best results were obtained with the higher number of particles. Moreover, their experiments showed that ACO can achieve same performance of PSO for small sizes of the NRP. However, the work of [3] and [5] did not consider the interactions among the requirements. Three research studies considered the interactions among the requirements [4], [11], [12]. Jose et. al. [4] used differential evolution algorithm [18], while Sagrado et al. [11] and Souza et al, [12] used ACO algorithms.

III. MULTI-OBJECTIVE NEXT RELEASE PROBLEM
In this paper the NRP is formulated as follows: A software product has a set of requirements of size m R= {r1, r2, …, rm}. Each of these requirements has an associated cost value ei, which represents the amount of resources or the development cost/effort needed for this requirement. The dependency and precedence among these requirements are represented as a directed acyclic graph, in which there exist a set of nodes and a set of edges, where each node represents a requirement and each edge represents a dependency between the nodes.
Given an edge (rj, ri) in which ri is the child node of the parent rj; this means that the requirement ri depends on the requirement rj. In this paper we consider one functional interdependence among the requirements which is REQUIRE (ri, rj). This interdependency was selected as it is the most popular in software projects [19]. A REQUIRE (ri, rj) interdependency indicates that requirement a ri cannot be selected to the next release if rj is not selected also or has been developed in a previous release [4], [11], [12]. But requirement rj can be included in the next release without ri. Fig. 1 shows an example to the dependencies among the requirements and the customers' requests for certain requirements. In this example, r2 is in the first level, which means that r2 is the parent of all the requirements and is required to be developed first.
Furthermore, there is a set of customers of size k (C1, C2, …, Ck); each customer has an importance to the company. Each customer requests a subset of requirements and maybe more than one customer is interested in the same requirement. So there will be a value vij associated with each requirement i and customer j denotes the satisfaction of the customer when including this requirement in the next release. The cost of a release is the cost of all the requirements selected to be developed in the next release. The objective of the NRP is to determine the subset of requirements that will be included in the product's next release, such that the total satisfaction of the customers is maximized and the release's development cost is minimized; furthermore, the cost does not exceed the company's budget.

IV. PARTICLE SWARM OPTIMIZATION
PSO is one of the swarm intelligence algorithms that was designed by Eberhart and Kennedy in 1995 [6][7][8][9]. It is inspired by the social behavior of the bird flocks that collaboratively work together to reach the point that has the most resources. The whole flock is called the swarm, and each bird in the swarm is called a particle. Each particle represents a solution in the search space and has three attributes, namely, velocity, position and best explored position by the particle. The velocity attribute guides the particle to move to its next position. The particle's position is updated every iteration according to the particle's current velocity value, the global best position that was found by the swarm, and the best explored position found by the particle. The PSO algorithm iterates for a predetermined number of iterations or until a minimum error value is achieved.

V. PROPOSED BPSO STRATEGIES FOR THE NRP
The proposed strategy starts by initializing the swarm with solutions to the NRP in the feasible search space, where the NRP constraints are valid. Then, each particle in the swarm is evaluated and their positions are updated according to their velocity vectors. The velocity vectors guide the particles toward better solutions. These steps are repeated until the swarm reaches a point where no better solutions are found, or the iteration count is reached. The following subsections discuss the formal description of the fitness function used in evaluating the particles, the particles encoding, the swarm initialization strategies and the steps of both of the IBPSO and OBPSO.

A. Multi-Objective Fitness Function Formulation
Assume that = {r1, r2, …, rn} is a subset of the set of requirements R, which are selected to be developed for the International Journal of Machine Learning and Computing, Vol. 9, No. 5, October 2019 next release of a software package and they satisfy the requirements' precedence constraints. Each of these requirements ri has an associated cost ei, that represents the development effort needed for this requirement. Let E = {e1, e2, …, en} be the set of costs that are associated to the n requirements. These requirements are enhancements or extensions to the current software system that are endorsed by a set of k clients C = {c1, c2, …, ck}. Each client has a grade of importance for the company that is represented by a weight. The weights of the set of k clients are denoted by W = {w1, w2, …, wk}. Each requirement rj has an importance to the client ci, and this importance is defined by a value vij > 0. A zero value for vij means that the client ci has not suggested the requirement rj for the next release. The total satisfaction sj of a requirement rj is calculated as the weighted sum of its importance values for all the clients that suggested it, which is expressed by (1): The overall satisfaction produced by the set of requirements selected for the next release is calculated as the sum of the satisfactions of this set of requirements which is calculated by (2): The cost of developing is calculated as the summation of the cost of developing all the requirements included in which is given by (3): The fitness function is formulated in a way to maximize the global satisfaction and minimize the development cost of the release which is given by (4): Such that: where, is the budget allocated by the company for developing the release.

B. Solution Encoding
A sample position vector Xi of a particle Pi.
In PSO each particle Pi has a position vector Xi which represents a solution to the tackled problem. We encoded the solution as a binary string of size m, Xi = (xi1, xi2, …, xim). Where each bit xij corresponds to a requirement rj, the bit value is equal to zero or one. The value of one means that the requirement rj is selected for the next release, while the value of zero means that the rj is not selected. Fig. 2 shows a sample particle of size m=10 in which r1, r3, r6, r7, r8, and r10 are selected and r2, r4, r5, and r9 are not selected for the next release. The particle position vector is mutated every iteration depending on the particle's velocity vector according to the BPSO algorithm utilized (the OBPSO or the IBPSO).

C. Swarm Initialization
The swarm holds a population of solutions to the problem. The selection of the initial swarm is very important; it directly affects the quality of the best solution found. In this paper two strategies were used to initialize the swarm which are: Random and Greedy-Random strategies.

1) Swarm random initialization
Each particle's position Xi is randomly initialized within the feasible search space of the NRP, which must comply to the following constraints: 1) Requirement precedence relationship.
2) The particle's cost does not exceed the release's allocated budget. Initialization procedure starts by adding randomly to the particle a requirement and its precedence requirements. If the total cost of the requirements included in the particle exceeds the release budget, this action is undone. This process is repeated until the particle's cost is equal to the release's budget.

2) Swarm greedy-random initialization
Greedy approach is utilized to seed the initial population with valuable feasible solutions. Valuable solutions are selected based on the values of the requirements. The value of a requirement is calculated as the summation of the satisfactions of this requirement and its precedencies divided by the summation of its cost and the cost of its precedencies. Greedy-random Initialization procedure proceeds as follows:

Split the swarm into three compartments
Initialize the first compartment using greedy as follows: -For a particle i, add to the particle requirements starting from the i th most valuable one and add its precedencies.
-Check out the budget constraint after each step.
-Stop when budget -Cost (Xi) ≤ epsilon Initialize the second compartment using Greedy-Random as follows: -At random add to the particle one of the five most valuable requirements and its precedencies -Include more requirements randomly till the budget -Cost (Xi) ≤ epsilon Initialize the third compartment according to the random initialization procedure D. Binary Particle Swarm Optimization PSO was originally developed for continuous valued spaces but in this work, we use binary encoding for the particles. Therefore, two binary PSO algorithms were implemented in this paper that is the original BPSO developed by Kennedy and Eberhart [8] and the improved BPSO developed by Mojtaba et al. [16]. The following subsections introduce the both algorithms.

1) Original BPSO
The original BPSO (OBPSO) differs from the PSO in that the velocity vector Vi of the i th particle Pi represents the probabilities of the corresponding bits of the particle's position vector Xi to mutate from its current state to another. For example, if the j th position in the particle's velocity vector equals to 0.40, it means that there is a 40% chance that will be equal to "one" and a 60% chance it will be equal to zero.
is updated according to (5): where, 1 and 2 are two parameters representing the particle's confidence in itself (local behavior) and in the swarm (social behavior) respectively. The values of these two parameters are very important as they control the balance between exploration and inclinations. Higher values of 1 encourage the particles to move toward their local best positions, while higher values of 2 cause faster convergence to the global best position. 1 and 2 are two random numbers uniformly distributed in the range (0, 1), while, w is the inertia weight. An upper bound Vmax was set to the components of the velocity vector. Vmax and w maintain the balance between the local and the global search [8], [9]. and are the best positions experienced so far by the i th particle and the whole swarm, respectively.
In order to keep in the range (0, 1), a sigmoid transformation function is applied as given by (6): The j th position of the i th particle is updated according to (7): where, is a random uniform number in the range (0, 1).
The algorithm of the OBPSO to solve NRP can be summarized as follows: Compute the fitness of the particle using its current position vector F( ) -If the particle's current fitness is higher than its best experienced position, (F ( ) > F ( )), then replace the particle's best position with the current position ( = ).
-If particle's best position is better than the global best position (F ( ) > F ( )), then replace the global best position with this particle's best-position ( = ).
-Update the particle's position vector Xi according to (7).
-If the particle is not in the feasible search space, mutate the particle to meet the precedencies and the budget constraints.
3. Go to step 2 and repeat until convergence or for a predetermined number of iterations.

2) Improved BPSO
The improved BPSO (IBPSO) defines two more velocity vectors for each particle 0 , 1 . Where, 0 , 1 are the probabilities of the bits of the particle's position vector to change to 0, or to change to 1, respectively. 0 1 are not complement. The velocity vector of the particle is defined by (8): where, is the probability of change in the j th bit of the i th particle position vector Xi.
The vectors 0 , 1 are updated according to the particle's best position ( ) and the global best position ( ) vectors. Such that if the j th bit in or is equal to zero the velocity 0 is increased and the probability of changing to one 1 is decreased with the same rate. Similarly, if the j th bit in or is equal to one 1 is increased and 0 is decreased. The advantage of the IBPSO over the OBPSO is that the bits of the particle's position vector benefit from the previously found direction of change to one or to zero. Equations 9 and 10 show the calculation of the j th bit of the velocity vectors V 1 and V 0 .
where, w is the inertia weight and the values of where, r1 and r2 are two random numbers in the range (0,1). c1 and c2 are defined parameters.
The velocity vector is calculated and normalized using the sigmoid function defined by (6); then the particle position vector is updated according to (15): where, is a random uniform number in the range (0, 1). Equation 15 implies that if is less than the current velocity, then the current position bit is changed to the 2 nd complement of itself; that is, if is 0 then is 1 or vice versa. On the other hand, if is greater than the current velocity, then the current position bit remains the same. The algorithm of IBPSO proceeds similarly to the OBPSO except the approach of calculating the position and the velocity vectors.

VI. EXPERIMENTAL METHODOLOGY
All the experiments conducted in this paper have been run under the same environment. On the hardware side, we used Intel(R) Core(TM) i5-6402P CPU @ 2.80GHz (4CPUs), ~2.8GHz, Memory: 8192MB RAM. On the software side we used Operating System: Windows 10 Pro 64-bit (10.0, Build 17134). As the BPSO is a stochastic algorithm, 25 independent runs have been carried out for each experiment. The results provided in the paper are the arithmetic mean of the results of these independent runs. The arithmetic mean is a valid statistical measurement because the results follow a normal distribution.
Two NRP datasets were used in the experiments to assess the proposed approach. Furthermore, the budget of the release (total development effort of the release) was restricted to three limits 30%, 50%, and 70% of the total development effort ( ) for each dataset. So, it could be said that 6 instances of an NRP were utilized in assessing the proposed approach. The datasets are copied from [4], [11], and [20]. The first dataset comprises 30 requirements and 5 clients. Table I shows the development effort/cost of each requirement, the priority level assigned to each requirement by each client, and the requirement interactions. Priority levels take values from 1 to 5: Value "1": means not important requirement, value "2": minor requirement, value "3": important requirement, value "4": highly important requirement, and value "5": tremendously important. These priority levels were used in measuring the total satisfaction of a requirement. The development effort of each requirement is defined on a scale from 1 to 10. It should be pointed out that this dataset is not large however we used it to assess the effectiveness of the proposed approach over small-scale NRP. The second dataset is more complex than the first one. It comprises 100 requirements, 5 clients and forty four requirement interactions. Table II lists the development effort of each requirement, the priority level assigned to each requirement by each client, and the interactions. In dataset#2, the development costs of the requirements are taken from real agile software projects. The development effort of a requirement is established in 20 effort units, which can be translated into 4 weeks. The values of the priority levels in this dataset are between one and three, as the clients prefer to use a coarse-grained scale to indicate the benefit of the inclusion of a requirement. The value 'one' indicates inessential, 'two' indicates desirable and 'three' indicates mandatory [21], [22]. Furthermore, for the two datasets, each client is assigned a relative importance in the decision making of the company. A client's importance in the two datasets has values in the range of 1 to 5, where value of '1' means the less important client, while value of '5' means the most important client. Table III shows the clients' relative importance for both datasets. The experiments were designed to answer the previously stated three research questions. The setup of the experiments is listed in Table IV.

VII. RESULTS AND DISCUSSION
This section This section discusses the results of the experiments and provides answers to the research questions. Tables V, VI and VII list the mean results of the experiments, while Fig. 3 shows the average convergence curves of the experiments over the six NRP instances.
As observed from Table V, the IBPSO algorithm surpasses the OBPSO in solving the NRP across the six NRP instances. It could be observed also that the proposed greedy random initialization algorithm enhanced the performance of the IBPSO especially across the difficult NRP instances (the two instances with budget limit 30% of the total effort), while it improved the performance of the OBPSO across two instances of the NRP. However, as observed from Table VI, the greedy random initiation boosted the robustness of both the OBPSO and the IBPSO over the small and the large datasets. The robustness of the evolutionary algorithms is measured using the standard deviation. The smaller the standard deviation, the more robust the algorithm. Small standard deviation means that the algorithm is capable of finding acceptable solutions in the different runs, with small discrepancy.
We also analysed the execution time required by the algorithms to find the best solution. The execution time values are listed in Table VII, which shows the average execution time in seconds. As observed, the running time of the IBPSO, to find the best solution, is smaller than the OBPSO. Furthermore, the greedy random initialization assisted the IBPSO to converge faster to the best solution, while it did not benefit the OBPSO.

VIII. CONCLUSIONS AND FUTURE WORK
An improved approach for BPSO was adapted to solve the constrained multi-objective NRP taking into considerations the dependency relations among the requirements. Moreover, the original BPSO algorithm was adapted to solve the same problem. The two algorithms were assessed using three NRP instances of a small dataset and three NRP instances of a large dataset.
It was found that the IBPSO surpasses the OBPSO and not only that but also its execution time was extremely faster than the OBPSO.
It was found that the greedy random initialization speeded up the search for the best solution in the case of utilizing the IBPSO, while its influence on the BPSO was minimal.
As a further extension to this work, the IBPSO approach could be extended to find the Pareto front instead of a particular best solution. Also, the performance of the IBPSO could be compared with other recent computational intelligence techniques like the bat and cuckoo search algorithms.