ADAPTIVE HARMONY SEARCH FOR OPTIMIZING CONSTRAINED RESOURCE ALLOCATION PROBLEM

Resource Allocation problem is finding the optimal assignment of finite available resources to tasks or users. Resource allocation problems refer to a wide range of applications such as production, supply chain management, transportation, ICT technologies, etc. Resource allocation problems are NP-hard in nature where the objective is to find the optimal allocations satisfying given constraints. Harmony search (HS) algorithm is a meta-heuristic population based algorithm found good for solving different optimization problems. This paper presents adaptive harmony search (AHS) for solving one-dimensional bin packing problem (BPP) and multi-objective virtual machine placement problem (VMP). The proposed real coded solution representation supports partial constraint satisfaction. Adaptive pitch adjustment rate (PAR) based on population diversity improves the performance of harmony search algorithm. Results show that proposed HS gives optimal solution for 50 BPP instances with 100 % success rate. The performance reduced for large instances of BPP. The proposed weighted AHS for multi objective VMP problem gives better results than genetic algorithm.


INTRODUCTION
Resource allocation problems are NP-hard problems in which the objective is optimal allocation of limited resources by satisfying constraints.Resources can be manpower, assets, raw material or anything that has limited supply which can be used to achieve goals and the goals can be minimizing the cost or maximizing the profit depending on the problem [1].It has a wide range of applications in project management, economics, storage management, scheduling, etc.The bin packing problem is an NP-hard resource allocation problem in which objects of different sizes are to be packed into bins of homogenous or heterogeneous size in such a way that minimum bins are required.The constraint needs to be satisfied in such a way that the sum of weights of objects in a bin must be no more than its maximum capacity.Bin packing problem is a well-known constraint satisfaction problem because of its wide real-life applications such as timetabling problems, scheduling problems.
Cloud computing is one of the fast-growing technology.One of the most important uses of cloud computing is that, it provides scalable/elastic resources for the application hosted on it as well as it makes full utilization of the available resources.In order to do so, a good virtual machine allocation/provisioning strategy is needed.In virtual machine management whenever a user requests a machine, an instance of virtual machine is created and is delivered to the customer.This task of creating VMs and assigning it with maximum profit and minimal wastage is known as virtual machine management.
Different resource allocation problems when solved using traditional algorithms get trapped in local maxima/minima and hence it is difficult to solve complex problems.Many researchers experimented GPU parallelization to accelerate the performance of these algorithms [2].Most of the traditional algorithms are problem specific, which is one of the important limitations, whereas, metaheuristic algorithms can be applied to a wide range of problems.To solve these problems various metaheuristic algorithm, namely Ant colony optimization (ACO), Genetic algorithm (GA), Harmony search algorithm (HS), Artificial bee colony algorithm (ABC) have been experimented by researchers.Paper [3] shows that performance of metaheuristic algorithms improves with hybridization and parallel implementation using CUDA.
There are various popular meta-heuristic algorithms such as particle swarm optimization (PSO), GA, HS, artificial bee colony, differential evolution (DE), Tabu search, etc. Harmony search algorithm is a meta-heuristic population based algorithm in which the improvisation process is analogous to that of composer in a musical production.The number of publications about harmony search algorithm is increasing rapidly [4].It has been used in solving various problems such as flow control [5], optimization of truss structures [6], etc. Music generally consists of a series of combined sounds that give rise to elegant effect.It takes combination of three factors -pitch, tone and intensity to produce any single sound.Music composer improvises the pitch of the instruments by search for perfect harmony.
This paper presents adaptive harmony search algorithm for resource allocation problem.The objective of this paper is to optimize onedimensional bin packing problem and multiobjective virtual machine placement problem using harmony search algorithm.
The contribution of the paper is twofold: 1.Firstly, adaptive harmony search algorithm is proposed.2. Secondly, initialization strategy that produces partially feasible solutions is offered.The next section describes different strategies used for solving one-dimensional bin packing problem and multi-objective virtual machine placement problem.Section 3 describes the problems and section 4 describes the proposed harmony search algorithm.Finally, section 5 shows the results tested on various datasets.At last, conclusions are stated in section 6.

RELATED WORK
To solve the bin packing problem and virtual machine placement problem researchers have experimented several traditional as well as metaheuristic algorithms.

BIN PACKING PROBLEM
In [7] authors, applied genetic algorithm (GA) for bin packing problem and results showed that GA has better performance when compared with First Fit Decreasing (FFD) and Best Fit Decreasing (BFD) heuristic.Dokeroglu and Cosar [8], proposed evolutionary grouping genetic meta-heuristic and bin-oriented heuristics which uses parallel computation techniques to solve large instances of one-dimensional BPP.Paper [9] used the concept of weight annealing for one-dimensional BPP.This strategy generated a high-quality solution in less time along with several optimal solutions.
A genetic algorithm which performs several perturbations for improving current solution was presented for one-dimensional bin packing problem [10].This algorithm is tested on benchmark instances and yields good results compare to best known methods.In [11], proposed hybrid steadystate grouping genetic algorithm and improved version of Perturbations MBS' heuristic.A hyperheuristic, which uses Evolutionary Algorithm (EA) to train a k-nearest neighbor algorithm was presented in [12] to solve one-dimensional bin packing problem.
Paper [13] proposed better-fit heuristic for onedimensional BPP, which outperforms off-line bestfit-decreasing heuristic and has better performance than on-line best-fit heuristic.In [14], hybrid improvement procedure with the use of lower bounding strategies is proposed as well as generation of initial solutions by dual min-max problem, load distribution based on dominance, differencing and unbalancing and tabu search for one-dimensional bin packing problem.In [8,14] hybrid algorithms for solving bin packing problem is used, the results on benchmark datasets are tested and good quality solutions are obtained.
A new variant of whale optimization algorithm known as improved Levy-based whale optimization algorithm was proposed for solving one-dimensional bin packing problem [15].
Scholl, Klein and Jürgens in [16] proposed BISON which is an exact hybrid solution that combines tabu search and branch and bound procedure for solving one-dimensional bin packing problem.Computational results show that BISON is very effective and outperforms existing approaches.In [17], authors proposed a graph-based algorithm for solving one-dimensional bin packing problem and the results tested on benchmark datasets showed that the performance of this algorithm was better than FFD.Paper [18] proposed several polynomialtime approximation algorithms for the onedimensional bin packing problem.In [19], heuristics based on variable neighborhood search, minimal bin slack for one-dimensional bin packing problem is proposed.

VIRTUAL MACHINE PLACEMENT PROBLEM
In literature, virtual machine placement problem is studied for different objectives such as maximizing providers' profit, maximizing resource utilization, minimizing power consumption, minimizing number of physical machines, etc.Many authors investigated performance of heuristic and metaheuristic algorithms for solving VMP problem in scientific literature.
Paper [20] presented review of different algorithms for solving virtual machine placement problem.Algorithms are categorized into different classes and their advantages & limitations are investigated.Paper [21] presented review of virtual machine placement problem in different aspects such as objectives, problem formulation and algorithms usage.
Paper [22] proposed a solution to reduce trade off by efficiently migrating VM to proper machine.Paper [23] presented SDN-based orchestration for live virtual machine management, which is capable of exploiting temporal network information for migrating virtual machines and minimizing the network-wide communication cost.In [24], authors proposed a two-level control system, which consists of an improved genetic algorithm with fuzzy multiobjective evaluation for efficiently searching large solution space and conveniently combining possibly conflicting objectives.In paper [25], VMP was investigated using differential evolution algorithm.Results indicate that for all instances DE algorithms is better than best-fit algorithm.Paper [26] presented crow search based algorithm for multiobjective VMP problem.The objectives were to minimize a number of physical machines, power consumption and maximize resource wastage.Performance of proposed algorithm is better than genetic algorithm and first fit decreasing algorithm.Proposed multiobjective genetic algorithm (GA) in paper [27] maximized the resource utilization of physical machines and minimized the energy consumption.

PROBLEM DESCRIPTION
This section presents problem definition for single objective bin packing problem and multiobjective virtual machine allocation problem.
In one-dimensional bin packing problem, items with varying weights are to be packed using homogeneous/heterogeneous bins.Consider a set of identical bins B1, B2 … Bn each of them have capacity C and N objects have weights W1, W2 … WN.The objective is to pack all the items into the bins in such a way that a minimum number of bins are used.A solution is said to be optimal if it uses a minimal number of bins.

MULTI-OBJECTIVE VIRTUAL MACHINE PLACEMENT
Various researchers proposed different problem formulations for virtual machine placement problem.In this paper, we considered problem formulation presented in paper [28].
Virtual machine and physical machine is abstracted as a node with three attributes, namely computing (CPU), memory (M) and bandwidth (B).The number and capacity of physical machines are known.Total numbers of virtual machines, their resource requirements and profit associated with them are known.The objective is to allocate all VMs to PMs that satisfies the VMs' resource requirements while fulfilling the following objectives.

Minimizing wastage of resources.
Two main constraints that must be satisfied are as follows: 1. Capacity Constraints: For all three attributes of a given physical machine, the sum of the resource requirements of all VMs placed on it should be less than or equal to the total available capacity. 2. Placement Guarantee Constraints: All virtual machines should be placed.Resource wastage is calculated on the basis of all three attributes (CPU, M and B).Wasted residual resource on a server is calculated as the sum of differences between the smallest normalized residual resource and the others [29].

HARMONY SEARCH ALGORITHM
Harmony search (HS) is relatively new population-based metaheuristic optimization algorithm that imitates the music improvisation process used by the musicians to improvise their instruments' pitch by searching for a perfect state of harmony.Researchers found solutions to different constraint satisfaction/optimization problem such as solving Sudoku [30], music composition [31], water network design [32], optimization of satellite heat pipe design [33], scheduling of multiple dam systems [34], vehicle routing [35] using HS.Paper [36] presents HS algorithm for solving combined heat and power economic dispatch problem.Paper [37] presents HS algorithm to solve the network reconfiguration problem to get optimal switching combination in the network that results in minimum loss.Paper [38] presents a hybrid harmony search algorithm (HHSA) to solve engineering optimization problems.

BASIC HARMONY SEARCH
HS is inspired from musicians' behavior in which they try to improvise pitches of their instruments to achieve pleasing harmony, which is measured by aesthetic standards.The fundamental steps involved in basic harmony search algorithm are [39]: Step

ADAPTIVE HARMONY SEARCH
Meta-heuristic algorithms work on two important concepts: intensification and diversification, which can also be termed as exploration and exploitation.The proper balance between them has a great effect on overall efficiency of the algorithm.The HSA is efficaciously administered using two crucial parameters: harmony memory consideration rate (HMCR) and pitch adjusting rate (PAR).The value of the parameter HMCR ranges from 0 to 1 and is used for exploration and exploitation.On the other hand, value of PAR varies between 0 and 1 is analogous to local search mechanism.PAR has considerable effect on the quality of final solution.
In [40], Wang and Huang proposed harmony search algorithm in which value of PAR is automatically adjusted and low-discrepancy sequences is used for initialization of harmony memory.Results showed that the proposed algorithm is superior to original HS.In order to solve network reconfiguration problem to minimize active and reactive power loss, in [41] self-adaptive harmony search algorithm (SAHSA) is proposed, which uses stochastic search and local search instead of gradient search.In [42] authors proposed adaptive harmony search algorithm, which uses novel approach for adjusting HMCR and PAR for making optimization process efficient.

PROPOSED ALGORITHM
The effectiveness of harmony search algorithm greatly depends on the value of PAR.A new variant of harmony search algorithm is presented to solve resource allocation problems.Adaptive Harmony Search (AHS) algorithm uses first-fit heuristics for initialization of harmony memory and automatic tuning of PAR, which is based on harmony memory diversity.

Real coded Representation:
A 1D representation as shown in Fig. 1. is used to solve the virtual machine placement and bin packing problem.Number of items to be packed indicates the size of the array.The values in the array indicate the resources to which the items are assigned.Fig. 1 shows the sample solution with 10 objects and 6 resources.For example, I5 is assigned to R3 and R7.This representation avoids violation of placement guarantee constraint.

Figure 1 -Memory Representation
Adaptive PAR: As mentioned earlier value of PAR plays a crucial role in the performance of harmony search algorithm.Dynamic PAR helps in achieving results when complexity of dataset is higher.As shown in the Fig. 2. HM diversity is calculated after every iteration.PAR is modified when diversity goes less than set threshold.This ensures that the value of PAR is modified only when it is necessary.
The value of PAR is tuned as per following equation: In equation ( 4), value of PAR is changed after every iteration depending on HM diversity.PARmax and PARmin are maximum and minimum values of PAR, which are set to 1 and 0 respectively, gn is the generation (current iteration) and NI represents maximum iterations.
Partially feasible initialization: Fig. 2. shows the pseudocode of the proposed harmony search algorithm.This algorithm benefits from heuristic inspired from first-fit strategy, which is used for initializing the harmony memory.In order to maintain diversity in the harmony population randomness is added in first-fit.
Objective function and Penalty Function: Bin packing problem is considered as minimization problem in which we have to minimize the number of bins used.Whenever there is violation of any constraints, penalty cost is added.The objective function for bin packing problem can be stated as follows: where pi is the total penalty of i th bin and P is the sum of total penalty of all the bins available.
The virtual machine placement problem is treated as maximization problem.The objective score of a solution is computed by assigning penalty costs (penalty points) for the violations of constraints.These penalty costs are specified according to the importance of the constraint.The objective function for individual 't' is calculated as follows.
where Hi represents the number of hard constraints violated by a solution for i th hard constraint and.αi represents penalty costs for violation of hard constraint.

RESULTS AND DISCUSSION
This section gives detailed explanation about the datasets used and the results obtained.The proposed algorithm is implemented using 'C' programming language and tested on a computer with the following specifications: Windows 7 Professional, Intel core i5-3210M CPU 2.5 GHz and 4 GB RAM.For every dataset harmony search algorithm was executed for 10 times.

BIN PACKING DATASET AND RESULTS
Dataset [43] consists of four instances in which the number of object varies from 9 to 33.The proposed algorithm was compared with bestfit.Results from Table 1 show that AHS has better performance than best-fit heuristic.Dataset [44] consists of six instances with varying number of objects and bin size.Table 2 shows comparison of AHS with GA [44].For all the instances AHS gives optimal solutions like that of GA.Success rate of AHS is 100%.

Pseudocode: Adaptive Harmony Search
Dataset [45] is a benchmark dataset, which consists of 50 objects and bin size of 100.Complexity of these datasets is more than [43] and [44].We have experimented with 40 instances mentioned in Table 3. Optimal solutions are obtained for all the 40 instances.But the success rate is reduced to 90%.Graph 3 shows the performance of AHS for dataset [45] with no. of objects 100.Results show that the performance of the AHS has reduced significantly.

VIRTUAL MACHINE PLACEMENT DATASET AND RESULTS
Data Generator: Five random problem instances are generated using data generator implemented in C programming language.For experimentation, we assumed homogeneous physical machines and heterogeneous virtual machines.Datasets contain combination of CPU intensive, memory intensive and bandwidth intensive virtual machines.Table 4 shows small sample dataset.The VM requirements were generated as a mix of different ranges of uniformly distributed random numbers as follows: <0.7-0.9, 0.1-0.3,0.1-0.3>:CPU intensive VMs <0.1-0.3,0.7-0.9,0.1-0.3>:Memory intensive VMs <0.1-0.3,0.1-0.3,0.7-0.9>:Bandwidth intensive VMs Five such configuration files of 60 VMs each were generated for input.Table 5 shows the results of adaptive harmony search for multi-objective VMP.Fig. 5 shows the results of real coded adaptive harmony search algorithm for multi-objective virtual machine placement problem.It is clear from the graph that profit, which needs to be maximized is maximum in all the runs with load balance being compromised.On the other hand, wastage is always minimized.Fig. 6 and 7 show results obtained from genetic algorithm and NSGA-II for VMP from [28].Results lead to following conclusions:  NSGA-II shows good exploration capability for all three objectives than AHS and GA.The pareto front obtained by NSGA-II algorithms gives importance to all three objectives under consideration.AHS shows better exploration capability as compared to GA.  Results obtained by NSGA-II are better than GA and AHS.Better resource wastage is obtained by AHS than GA.

CONCLUSIONS
Paper presents adaptive harmony search algorithm for constrained resource allocation problem.The proposed algorithm presents two modifications in the original harmony search: first, adaptive PAR and second, partially feasible initialization strategy with real coded solution representation.Experiments were performed to study one-dimensional bin packing problem and multi-objective virtual machine placement problem.55 instances of BPP dataset are used for testing performance of the algorithm.AHS performs better than best-fit heuristic and original harmony search.AHS gives optimal results with 100% success rate for BPP with 50 objects.The performance reduced for BPP with 100 objects.Results of virtual machine problem show that AHS has good performance as compared to GA but has less exploration capability than NSGA-II.
Future work: Performance of AHS reduced significantly for larger instances of BPP.There is scope to improve the strategy for adaptive PAR.

Fig. 4 .
Fig. 4. shows the comparison between original harmony search, harmony search with first-fit and harmony search with first-fit and adaptive PAR (AHS).Partially feasible initialization and adaptive PAR shows significant improvement on the performance of harmony search algorithm.Table5shows the results of adaptive harmony search for multi-objective VMP.

Initialization strategy for partially feasible solution for large datastes*/ while
Input: A Number of VMs and Resource requirement of each VM.Number of PMs and capacity of each PM.Output: Number of PMs required allocating all VMs.