Abstract
Virtual machine placement (VMP) is carried out during virtual machine migration to choose the best physical computer to host the virtual machines. It is a crucial task in cloud computing. It directly affects data center performance, resource utilization, and power consumption, and it can help cloud providers save money on data center maintenance. To optimize various characteristics that affect data centers, VMs, and their runs, numerous VMP strategies have been developed in the cloud computing environment. This paper aims to compare the accuracy and efficiency of nine distinct strategies for treating the VMP as a knapsack problem. In the numerical analysis, we test out various conditions to determine how well the system works. We first illustrate the rate of convergence for algorithms, then the rate of execution time growth for a given number of virtual machines, and lastly the rate of development of CPU usage rate supplied by the nine methods throughout the three analyzed conditions. The obtained results reveal that the neural network algorithm performs better than the other eight approaches. The model performed well, as shown by its ability to provide near-optimal solutions to test cases.
1. Introduction
The virtual machine placement (VMP) model, which is extensively used in modern computing, suggests that the demand for computer resources (e.g., memory, network bandwidth, processing power, and storage) in a particular application might change dramatically over time. By allowing flexibility of computer resources [1, 2], the cloud computing computation paradigm arose as a solution to this challenge. Hardware virtualization is commonly used to achieve such elasticity [3, 4]. The deployment of virtual machines under ideal settings on actual machines in cloud data centers is a challenging task in virtualization technology. In cloud data centers, the best way to put virtual computers over real ones can help manage resources and cut down on waste.
Currently, virtualization is becoming more widely adopted by data centers to enhance the utilization of servers and achieve a more effective allocation of resources performance management with a reduced cost of energy expense [5].
Many significant contributions to the virtual machine allocation problem have lately been presented [6, 7]. Virtual machine allocation on a physical host is seen as a nondeterministic polynomial time challenge, more precisely as an NP-hard problem, to which the NP-hard knapsack problem (KP) can be simplified. The KP is often a combinatorial optimization problem with a constraint on the solution objects. However, since it belongs to the class of NP-hard problems, it poses a difficulty for researchers.
We provide a situation in which a person is carrying a bag, as well as a list of goods that can be carried in the bag. Each item has a distinct value and occupies a distinct place in the bag. Because the capacity of the bag is limited, the challenge is to maximize the value of a collection of goods placed within the bag while not exceeding its capacity.
Combinatorial problems, such as KP, are hard to solve because the number of possible solutions usually goes up as the size and complexity of the problem goes up. Because of this, scientists have come up with many methods that can be put into two main groups: exact methods and approximate methods.
The knapsack problem’s method relies on the problem size, desired solution quality, computational resources, and problem instance. Exact methods such as dynamic programming (DP) and branch and bound (B&B) may provide optimum solutions for small to moderate cases but may be computationally infeasible for larger problems. Metaheuristics such as genetic algorithms (GAs), ant colony optimization (CO), simulated annealing (SA), greedy search (GS), tabu search (TS), and particle swarm optimization (PSO) may rapidly explore huge search spaces and discover excellent answers in a reasonable time, although they may not be optimum. Neural network algorithms (NNAs) may effectively approximate complicated functions and discover excellent solutions, by repeatedly modifying neural network weights.
This article compares nine different strategies to tackle the VMP as an KP issue, including the B&B and DP, which are accurate approaches, and seven approximation methods GA, ACO, SA, TS, GS, PSO, and NNA. The nine methods were chosen for two reasons: even though the B&B method and the DP algorithm are frequently employed for KP, their implementation in the context of the VMP issue is quite restricted, but as exact methods, they give the exact optimal solution. Furthermore, GA, ACO, SA, TS, GS, PSO, and NNA are used for the VMP issue in many studies [8–11], providing at least an overview of their effectiveness, but no comparative analysis has been conducted comparing the two approaches.
The main contributions of this paper are summarized as follows:(1)Comparing the accuracy and efficiency of nine different strategies for solving the virtual machine placement (VMP) problem as a knapsack problem(2)Testing the system under various conditions to determine its effectiveness(3)Illustrating, for each algorithm, the rate of convergence, the rate of execution time growth for a given number of VMs, and the rate of CPU usage throughout three analyzed conditions(4)Performing experiments to evaluate the performance of the methods used
The rest of the paper is organized as follows. Section 2 contains some related works. Section 3 includes our proposed model and discusses the mathematical formulation of the knapsack problem. A review of the various proposed algorithms is provided in Section 4. Section 5 presents the experiments and results obtained. Finally, Section 6 concludes the paper.
2. Related Work
Various methods have been presented in the literature to solve the knapsack problem. The majority of the algorithms deal with precise techniques. In this part, we will discuss numerous techniques to solve the KP problem. Before delving deeper into each method, we divide them into three categories: exact, metaheuristic, and machine learning algorithms.
One approach to the virtual machine placement problem is the heuristic method. To tackle the knapsack issue, the authors of [12] presented a divide-and-conquer heuristic. Other methods involve combining several low-level heuristics to produce a high-level solution known as a hyperheuristic. Nonetheless, the authors of [13] described hyperheuristics as automated mechanisms for choosing or developing low-level heuristics to address difficult computational problems and offered a classification of such methods. The study described in [14] explores the VMP problem using a two-dimensional knapsack formulation and a heuristic method in two phases. The first stage is to choose a subdatacenter to which a virtual machine will be allocated and the second step is to choose a server in the specified subdatacenter to fit the virtual machine. Throughout the process, the work addresses the cost of communication.
Another form of the algorithm used to handle the VM placement problem is the metaheuristic technique (such as the ant colony algorithm and particle swarm optimization). These techniques are thought to be promising for locating the nearly optimum solution. Some algorithms have been developed to reduce energy usage and waste, as well as manage computational resources. The authors of [15] suggested a metaheuristic approach for virtual machine deployment on physical equipment in a cloud data center. One of the most critical difficulties in cloud computing is making the greatest use of hardware resources while minimizing energy usage and providing the highest quality service. Thus, by optimizing virtual machines on real equipment, the suggested strategy in [15] intends to reduce energy usage in cloud data centers. The genetic algorithm was used to create the suggested approach. The goal of the study was to lower the amount of power used, the SLA, and the number of virtual machine moves in cloud data centers. The research provided in [16] proposes VMPACS, a multiobjective ant colony optimization (ACO) method. Ants deposit the pheromone between each VM-PM pair in VMPACS. The related pheromone is updated when a VM is placed on a PM. This algorithm’s purpose is to decrease resource waste and energy consumption by PMs.
In [17], the authors suggest a population-based simulated annealing approach (PSA) for determining which items would provide the greatest financial return while still fitting inside a given knapsack. Several well-known instances with small, medium, and large scale dimensions up to 10000 were used to rigorously test this method and compare it to various other optimizers and a number of existing simulated annealing modifications to prove its superiority. The experimental findings show that this method works better than the others; however, it still has room for improvement when applied to weakly correlated and strongly correlated high-dimensional cases.
Metaheuristic methods, including memetic optimization algorithm (MA) and local search, have been applied to various optimization problems in cloud and fog computing. MAs are a hybrid approach that combines evolutionary algorithms (EAs) with local search methods to improve the efficiency and effectiveness of the search process. They work by combining the global exploration capabilities of EAs with the local exploitation capabilities of local search methods. In cloud and fog computing, MAs have been used to optimize resource allocation, task scheduling, and load balancing, among other applications. For example, in [18], volunteers build a dynamic, peer-to-peer fog utilizing modified memetic algorithm (MA) for optimum service placement. Local-search heuristics and extra fitness functions prioritize services based on task completion delay and rate. Enhancements increase energy efficiency, service quality, and system throughput. Machine learning helps locate the most Pareto optimum solution. This study advances green computing systems.
Chhabra et al. [19] created a task scheduling paradigm that overcomes local search issue and enhances cloud scheduling performance by improving makespan and energy usage. This simulation improves cuckoo and OBL techniques by introducing a differential evolution parameter to better searching and scheduling. Simulation on CloudSim and workload traces from HPC2N were compared to metaheuristic techniques and showed improvement for above parameters. In [20], the authors propose a multiobjective virtual machine placement algorithm to optimize energy costs and scheduling in cloud data centers while reducing greenhouse gas emissions. The proposed method utilizes a modified memetic algorithm and outperforms baseline and state-of-the-art methods in reducing energy costs, carbon footprints, and service-level agreement violations, while improving the total response time of IoT requests. This study demonstrates the potential of metaheuristic methods, such as memetic algorithm, in addressing the NP-hard issues of energy consumption minimization and scheduling in IoT environments.
The knapsack problem, DNA fragment assembly problem, feature selection, task scheduling, and the travel salesman problem are all examples of combinatorial optimization problems; parameter estimation of photovoltaic models and nonlinear equations systems are continuous optimization problems; recently, metaheuristic algorithms and neural networks algorithms, either single-based or population-based, have strongly interacted to solve these problems [21–28]. Some of those recent algorithms used to solve the KP problem are presented in Table 1.
3. Formulation of the Knapsack Problem and System Model
The VMP problem in this work maximizes the number of VMs on a server while keeping the server’s limited capacity in mind as shown in Figure 1. The following evidence backs up our knapsack claim: The server represents the knapsack, VMs represent the things that may be placed in the knapsack, the value represents the average CPU use of a VM over a certain period, and the weight represents the amount of CPU available on a server.

As a result, the formula is as follows:
For item k:(1)Require a specific amount of CPU to be executed in a given amount of time(2)During the same time frame, the server makes CPU available(3)C: the server’s overall CPU capacity(4): based on whether or not an item is selected, the value is either 1 or 0
Following the formulation of the problem, the most appropriate approach for solving it must be determined. The needed background for the approaches used in this study is presented in the next section.
4. Methods for Solving KP: Background
4.1. Exact Methods
Exact algorithms are used to find at least one optimal solution to a problem. The most successful exact algorithms in the literature belong to paradigms from two main classes: dynamic programming and branch and bound methods.
4.1.1. Branch and Bound Algorithm
The branch and bound method (procedure by evaluation and progressive separation) consists of enumerating these solutions in an intelligent way in the sense that, by exploiting elements of the issue at hand, this method removes incomplete answers that do not lead to the desired outcome [29]. As a result, we frequently find the answer we need within a decent amount of time. Of course, in the worst-case scenario, we always explicitly eliminate all potential solutions to the problem. This technique offers a feature that allows you to confine certain solutions in order to discard them or maintain them as potential solutions. Obviously, this function’s quality affects how well a branch and bound technique works, as does its ability to get rid of incomplete solutions quickly.
4.1.2. Dynamic Programming Method
Dynamic programming has been called that since 1940 by Richard Bellman and allows us to apprehend a problem in a different way than we could imagine at first sight. The basic concept is simple: an optimal solution is the sum of subproblems solved in an optimal way [30]. Therefore, a given problem must be divided into subproblems and solved one by one. A dynamic programming algorithm’s design may be broken down into the following four parts:(1)Describe the structure of an ideal solution(2)Define the value of an ideal solution recursively(3)By going back to the original problem statement over and over, you can figure out how much an ideal solution is worth(4)Construct an optimal solution for the computed information
4.2. Metaheuristic Methods
They are modern metaheuristics dedicated to issue resolution, particularly optimization problems, with the goal of reaching a global optimum, typically buried in the center of several local optima [31].
Exploration and exploitation are two important aspects of any optimization algorithm. Exploration refers to the search for new solutions, while exploitation refers to the refinement of existing solutions. The balance between exploration and exploitation is crucial for finding a good solution in an efficient manner.
The proposed method may have an impact on exploration and exploitation in the following ways:(1)Exploration: the proposed method may encourage exploration by using stochastic or randomized search strategies that allow the algorithm to search a larger portion of the search space. For example, genetic algorithms and particle swarm optimization use stochastic search strategies that help in exploring a wide range of solutions. Ant colony optimization and tabu search, on the other hand, use heuristics that encourage exploration by guiding the search towards unexplored areas of the search space.(2)Exploitation: the proposed method may encourage exploitation by using strategies that refine existing solutions. For example, simulated annealing and tabu search use local search strategies that focus on improving the quality of the current solution by making small modifications to it. Greedy search, on the other hand, focuses on exploiting the current best solution by adding the item with the highest value-to-weight ratio to the knapsack.
Table 2 provides a comparison of different optimization methods for the knapsack problem, based on their exploration and exploitation characteristics.
4.2.1. Greedy Search Algorithm
The greedy search algorithm is an iterative process that generates a solution step by step. It tries to add to the partially solved problem from the previous step at each step, starting with a partially solved problem that is empty. This process is repeated until a full solution is found. A greedy search algorithm can be used when the quality of the solution is not a primary factor or the size of the instance is reasonable, in this case to generate an initial solution in a metaheuristic, which is fast and easy to implement [32]. The greedy search algorithm constructs a feasible solution by reducing it to a sequence of decisions that are made each time as best as possible according to a local criterion without questioning the decisions already made. Generally, the solution obtained is approximately.
4.2.2. Simulated Annealing Method
The simulated annealing process originated in metallurgy when a solid is heated to extremely high temperatures and then allowed to cool slowly in order to obtain low energy states. This procedure is known as annealing. The method of simulated annealing was developed simultaneously by Kirk in 1983 [33]. This method is based on the algorithm of metropolis [34]. This algorithm allows us to get out of local minima with a high probability if the temperature is high and to keep the most probable states for very low temperatures. The metropolis algorithm samples the objective function through a Boltzmann distribution of parameters .
To better understand the simulated annealing method, there are several notions to define, such as the Boltzmann probability and the metropolis criterion. The Boltzmann probability, denoted , is the probability of finding a system with an energy at a given temperature in the space of configurations . It is defined by the following expression:where is a stochastic variable that denotes the current state of the solid, is called the Boltzmann constant, and is a function called the distribution function defined by the following expression:where represents all possible energy states. The KT factor demonstrates that when the temperature is extremely high, all states are approximately equiprobable, implying that a large number of configurations are available. On the contrary, when the temperature is low, the high energy states become unlikely compared to the low energy ones. To simulate the evolution of a solid towards thermal equilibrium for a temperature . The Boltzmann probability was used to come up with the metropolis criterion, which was proposed in the movie metropolis.
In the context of optimization by the simulated annealing method, the energy is replaced by the objective function, so obtaining a minimum energy solid is equivalent to the search for the global optimum of the objective function. This search is done by successive explorations of different configurations. is the goal function variant. The transformation is approved based on the probability such that
When the variation is negative or null, the exponential is greater than or equal to 1, and the new configuration is accepted. If is compared to a uniform random number in [0, 1] If , the configuration is accepted If not, it is rejected and another configuration is tried. So, it is less likely that the objective function will get worse at a given temperature and less likely that it will get worse when the temperature is low. The crucial point of the algorithm is therefore the temperature decay law. Many different decay laws have been proposed by Chelouah and Siarry [35].
The simulated annealing method has quickly become popular due to its ease of adaptation to a large number of problems and its efficiency. On the other hand, this method has the disadvantage of containing a large number of parameters (initial temperature, temperature decay rule, duration of temperature steps, etc.) that make the settings of the method rather empirical. However, there are studies that focus on optimal tuning of the parameters of this method [36]. Another major disadvantage of this method is its slowness. To solve this problem, several methods of parallelization of the calculations were introduced by Azencott in 1994 [37]. The simulated annealing method was first made to work with discrete variables, but there are also versions that work with continuous variables.
4.2.3. Tabu Research
The tabu search (TS) approach was created by Glover in 1986 [38] particularly for combinatorial optimization problems and provides for a flexible tradeoff between solution quality and computing time. The idea behind this method is to add a flexible memory to the search process, which will make it possible to search the solution space in a more “intelligent” way.
The tabu search technique, like the simulated annealing approach, operates with a single current configuration that is modified between rounds. To eliminate the chance of returning to a previously visited configuration, a list of disallowed movements known as the tabu list is kept. This list contains movements which are the inverses of the last movements performed. The method thus models a primary form of short-term memory. In its basic form, the tabu search method has the advantage of having fewer parameters than the simulated annealing method. However, since the method is not always efficient, it is often appropriate to add intensification and/or diversification processes to it, which introduce new control parameters [39]. In tabu search with continuous variables, two concepts are involved: the neighborhood of a given point and a random motion in the neighborhood. For a given point and a given step , the neighborhood is defined as follows:where the point is generated at random in the vicinity of of . Moreover, if it satisfies the constraints, it is called “feasible random motion.” represents this neighborhood. The number of points generated in the neighborhood of with a given step is the neighborhood size. The performance of the tabu search depends on the size of the neighborhood and the length of the tabu list. By iteratively exploring the solution space, the search proceeds from any solution belonging to the solution set to a solution located in the neighborhood . At the beginning, the step vector covers the whole search space, and then it decreases at each iteration. The best point in the neighborhood formed by of is retained and becomes the center of the next neighborhood. This point is the one that either enhances or worsens the goal function the greatest. The technique requires a memory to keep track of the last solutions visited within a particular time period. These solutions are designated as tabu, thus the method’s name. They are kept in a list of a set length known as the tabu list. A new solution is only accepted if it is not on the tabu list. The length of the tabu list thus determines the return to previously investigated solutions. The longer the list, the more difficult it will be. Consequently, the search will be directed towards unexplored regions.
4.2.4. Genetic Algorithms
Genetic algorithms (GAs) are search algorithms that are motivated by the mechanics of natural development and genetics. The first work was carried out by Holland in 1992 [40] in the book “Adaptation in Natural and Artificial System,” which formalizes genetic algorithms in the framework of mathematical optimization. The publication of David Goldberg’s book in [41] describing the use of these algorithms for solving concrete problems, has increased their visibility in the scholarly community and sparked renewed interest in this optimization approach. These methods focus on simulating the process of natural selection in an unfavorable environment and are inspired by the theory of evolution proposed by Darwin in the 1859 “Journal of Research in to Geology and Natural History.” According to these concepts, when a population is subjected to the constraints of a natural environment, only the best-adapted individuals survive and generate offspring. Over the course of generations, natural selection allows the appearance of individuals better and better adapted to the natural environment, to the detriment of those who are notoriously maladjusted, thus ensuring the survival of the species. This particularity of natural evolution, the capacity of a population to explore its environment in parallel and to recombine the best individuals between them, is borrowed by genetic algorithms.
By analogy with genetics, these algorithms seek the best individuals from an initial population. To constitute the appropriate parents, giving birth to the best offspring children, among which will be drawn the acceptable solutions to the treated problem. Each optimization problem is characterized by decision variables that condition the decisions to be taken, an objective to be satisfied, and constraints to be respected. Unlike classical optimization methods, variables are not used in genetic algorithms; instead, they are associated with specialized coding. The factors of interest are taken into account by utilizing characters that form a code sequence. Each variable of choice is converted into a gene, which may include one or more codes capable of expressing unique features. The code sequence represents a person. In other words, a chromosome is a possible solution. The goal of the challenge is represented by a function that allows deciding whether or not a person should be picked to produce new solutions. This function is known as the fitness function. The fitness function considers restrictions by penalizing people who disregard the problem’s constraints. The search for feasible solutions is based on two strategies that aim to generate new solutions at random from the starting population. These mechanisms are the genetic operators: crossing and mutation. The decision-making process aims to direct the inquiry by identifying those who have the best possibility of being chosen. We will travel through the steps of a simple genetic algorithm to demonstrate how they function, as shown in Figure 2.

4.2.5. Ant Colony Optimization Algorithm
The ant colony method emerged from a simple observation: social insects, and in particular ants, naturally, solve complex problems. Since ants interact with one another indirectly by depositing chemical molecules called pheromones on the ground, such behavior is conceivable. This is known as stigmergy. Indeed, if a barrier is placed in the path of the ants, the latter will prefer to follow the shortest route between the nest and the obstruction after a period of inquiry. The greater the pheromone level in a specific location, the more likely an ant will be attracted to that area. The ants that arrived to the nest first chose the shortest branch of the path. It follows that the number of pheromones on this path is greater than on the longest path. Therefore, the shortest path has a higher probability of being taken by the ants than the other paths, and it will be taken by all the ants. The first algorithm based on this analogy was proposed in 1996 by Dorigo et al. [42].
Reference [43] advocated using the same solution to deposit pheromones on the specified pairings of objects. The first approach is used for this investigation. This is how the algorithm might be summarized: To build a solution, ants first choose a seed item at random, then add items from a set containing all the things that may be chosen without exceeding the constraint on available resources. Each time, the component of the current solution that will be added is selected with a probability of . Both a pheromonal component and a heuristic factor (also known as an attractiveness factor) contribute to this likelihood, with their relative significance being determined by two parameters ( and ). If you know that the probability of is supplied by, then you can derive the following expression:
The pheromonal factor iswhere
The heuristic factor is expressed as follows:
4.2.6. Particle Swarm Optimization
The particle swarm optimization (PSO) method is a SI-based strategy motivated by the cooperative nature of animal societies like bird flocks and fish schools. Developed in [44] for use in resolving issues of continuous optimization, it has been used in a variety of applications thereafter. Scheduling, traveling salesman, network deployment, task assignment, and neural network training are only some of the optimization problems that the PSO method has been used to solve [8].
To solve the optimization problem at hand, the PSO method takes into account the particles as candidates for optimal solutions. Here, is the total number of particles in the swarm and is the time interval between iterations, and represent the location and velocity of particle in -dimensional space. The problem’s decision variables are represented by the entries in the position vector . A fitness function measures how happy each particle is with its current location. Personal best positions, or , are the best positions discovered by individual particles over several iterations, whereas the best position ever found by the whole swarm, is the greatest position ever found. Particles’ locations and velocities are revised according to the following rules:
The inertia mass is denoted by and the acceleration coefficients by and , and the two random values and are chosen from the interval [0, 1]. Particle location is updated using the velocity vector, as shown by equation (10). The velocity vector update rule, denoted by the equation (11), consists of the following three terms: There are two types of influence at play here: individual influence, which improves the quality of each particle’s position by allowing each particle to return to the previous position if it is better than the current one, and social influence, which causes particles to follow the direction of the best neighbor. To be clear, the inertia weight is not always the same and is instead adjusted according to the formula while the algorithm runs.where and represent the maximum and lowest inertia weights, respectively, and and represent the iteration time and maximum number of iterations, respectively.
4.3. Neural Networks Algorithm
Using the model’s output to obtain the outcome Sometimes, finding the largest output index is sufficient; other times, more complicated techniques are required. Following the execution of the inference, the method might be implemented. However, there are certain advantages to developing a model that can execute such an algorithm on its own. Using neural networks to solve the knapsack problem also lets the model run the knapsack algorithm and trains the model from the beginning to the end.
4.3.1. NNA Algorithm Data
The initial stage is to prepare the data; we utilize random numbers for item weights, values, and knapsack capacity. After generating the problem, brute force is used to identify the best answer. Normalizing the input is an important aspect of any machine learning task since it allows the model to adapt more effectively. To illustrate every knapsack problem, the following points are followed:(1)Subtract the values from the problem’s maximum value(2)Subtract the weights from the capacity(3)Remove the capacity from the inputs as it is now integrated into the weights
The dataset contains 10,000 training sets and 200 evaluation samples.
4.3.2. Description of the Model
This study’s proposed model is a basic model with two inputs and one output. The inputs are chained first, and the result is passed through 2 successive layers triggered by sigmoid nonlinearity, with the output of the last dense layer acting as the model’s output. Figure 3 displays a working implementation of the Keras model.

4.3.3. Performance Metrics
To examine the knapsack problem, measurements besides binary classification efficiency are required. The first statistic presented in this paper is referred to as “overpricing,” which checks the mean difference in the values of the chosen goods and the optimal solution.
4.3.4. Supervised Technique
The supervised technique involves feeding weights and values into the model and predicting the best response as an output. The model trains through the use of a cross-entropy loss function during this process. After training the model with 512 epochs using the supervised method, the obtained results are shown in Table 3.
However, the supervised method has the following two major flaws:(1)To begin training, the best solution is required(2)There is no control over space violations or overpricing
Following that, let us try to solve these issues utilizing an unsupervised technique.
4.3.5. Unsupervised Technique
Training is the model without computing the best answer. As a result, a novel loss function is required. The item weights, values, knapsack capacity, and model output are described as , and , respectively. The objective is to maximize the overall cost of the selected items. It may be computed as follows:
At the same time, it is necessary to ensure that the selected items do not exceed the capacity of the knapsack. This value can be expressed as follows:
Finally, the objective is to increase Total Price while minimizing Space Violation. This might be expressed as follows:
To manage the Space Violation, the coefficient is applied to the second term. The following is the ultimate loss formula:
The results of our 512 epochs of unsupervised training are summarized in Table 4.
4.4. Time Complexity Analysis
In general, the method of choice for addressing an optimization problem is determined not only by its correctness but also by its complexity. Some algorithms are more efficient than others, but their complexity slows down the resolution process. The ideal situation is to find the optimum balance between the quality of the answer and the time complexity faced. Table 5 displays the temporal complexity of the investigated nine methods.
5. Experimental Results and Performance Analysis
In this part, we use a real dataset to put our proposed approaches to solving the KP issue for VMP to the test. Readers are encouraged to view reference [45] for further information on the dataset. The experiments have been performed on an Intel(R) Core(TM) i5-7300U @ 2.60 GHz −2.71 GHz, 16 GB RAM. The MATLAB version employed for the manipulation is R2019a (win64).
In this section, the performance of various accepted methodologies is presented and discussed when applied to the chosen dataset. The convergence rate and the combination of objects (virtual machines) generated by each approach are the first points of comparison. After that, the methods are evaluated based on their execution time and CPU usage. This metric represents the maximum number of concurrently running virtual machines that may be hosted on a single physical server without overloading the hardware.
Table 6 provides a synopsis of the collected data. As a first step, the task is to load 10 virtual machines onto a server with a maximum of of RAM. Based on the collected data, it is clear that using 4 or 5 VMs yields of the permitted capacity, and that all techniques provide the best answer to the issue under investigation. However, the lowest results come from greedy and PSO. In the second run (, 15 VMs), the SA method places the most VMs , but that all of the algorithms produce about identical levels of CPU use by the chosen VMs. Differences in outcomes, measured in terms of CPU usage rate, become more pronounced when the number of to-be-placed VMs climbs from 10 to 20. The answer obtained using any of the two exact methods ensures the most efficient possible use of the server’s computational power. This does not prohibit pointing out that the NNA values are likewise significant. Results mentioned are visually shown in Figure 4 for better understanding.

Figure 5 shows the evolution of the CPU utilization rate as a function of the number of virtual machines. We can see that when the number of virtual machines increases, the variation in the results in terms of the CPU utilization rate increases significantly. In fact, the two exact procedures provide a solution that ensures the best use of the server’s CPU resources. The ACO and NNA values are also important.

In Figure 6, we base our comparison on the pace of convergence. This mostly relates to the number of iterations required to arrive at an ideal solution. When the number of iterations is predetermined, as in the case of the DP algorithm, the best solution is given by 380 iterations to ensure that there is no item remaining to process. The B&B method must converge because it always removes incomplete solutions at each stage. The ideal solution is obtained after approximately 20 iterations in the run shown in Figure 6. When all ants propose almost the same optimal solution, the ACO technique achieves convergence. Figure 6 illustrates that the ACO algorithm converges after 50 iterations. We may minimize the number of extra ants without impacting the ideal solution because the run was carried out with a number of ants equal to 100. For the NNA, TS, PSO, and B&B algorithms, 20 iterations result in the optimal solution. We can see that greedy, PSO, TS, B&B, and NNA require the fewest iterative steps to converge.

Figure 7 shows a comparison of CPU rate utilized for one run of each method for 20 VMs. As a result, there is no discernible difference between the studied techniques; nonetheless, it is clear that the CPU rate utilized rises, with the exception of SA and TS. The distinction between the NNA approach and the other methods is very evident.

By comparing NNA to GA, ACO, SA, TS, greedy, and PSO in terms of analysis of variance (ANOVA) [46], it is easy to observe that NNA is the better algorithm. This is seen in Figures 8 and 9. The simulation is run ten times.


Figure 10 depicts the evolution of the execution time for a number of VMs equal to (10, 15, and 20). We show that all of the methods give the best results except for the NNA method, which takes a long time to run.

The accuracy and difficulty of an optimization problem influence the method used to solve it. The ideal situation is to strike an optimal balance between response quality and time complexity. On the other hand, metaheuristics are well suited to dealing with such an issue. The DP technique has pseudo-polynomial complexity, which implies that the time complexity is proportional to not only the number of components but also to the capacity of the knapsack , which is exponential in the binary computing system [6]. Furthermore, we can demonstrate that the GA, ACO, SA, TS, greedy, and PSO algorithms can deal with the KP in linear time. However, for the NNA, success rates decline as the examples become more complicated (it need more computing processes to get an appropriate solution) [47].
The following conclusions may be drawn from this quick examination of the findings obtained:(1)Both the and DP approaches, which are reflected in this study as the precise strategy for addressing the KP applicable to the VMP problem, provide optimal solutions, one of which is making full use of the server’s CPU resources for such machines that have been allocated to it. As a result, the main purpose of the challenge will be to allocate as many virtual machines as possible to a limited set of servers while powering down the other servers.(2)According to studies of convergence rates, accurate methods converge after a fixed or variable number of iterations, depending on the amount of data being input. However, with the metaheuristics and NNA under discussion, the convergence rate is also linked to the procedure followed by each method. For this inquiry, we may make the educated guess that the convergence rate of neural network algorithm methods is higher than that of exact techniques and metaheuristics.(3)In terms of resource use, it was discovered that, with the exception of NNA, both metaheuristic approaches (mostly ACO) utilized fewer CPU resources to deliver an approximate solution in the shortest amount of time.
To summarize, as the quantity of virtual machines grows, the need to turn to metaheuristic approaches to VMP is unavoidable. In fact, the findings suggest that the precise approaches under study are better suited to a limited number of virtual machines, as they provide the best solution while making the most efficient use of available resources. A similar statement may be made for NNA, which offers a near-optimal solution. Table 7 highlights the comparison made in this research and confirms that metaheuristics (mainly ACO) are suggested for a wide variety of virtual machines placement problems.
6. Conclusion and Perspectives
This article presented research on optimizing server use in the cloud. The worldwide approach of VMP was shown by the established policy, which aimed at concentrating the process on a limited number of servers so that the rest may be turned off. In this research, various methods were employed to study and solve the knapsack problem. Many strategies were compared and contrasted in the process. When combined with GA, ACO, SA, TS, greedy, PSO, and NNA, and DP proved to be effective techniques. The purpose of the research was not to create a cutting-edge solution but to address certain gaps in current research that include learning in combinatorial optimization problems. Certainly, the methods presented in this work have given remarkable and relevant results. Based on the assessment of several optimization strategies applied to the KP problem, the NNA algorithm obtained the highest score. Therefore, the conclusion is that this algorithm is a viable and efficient strategy to address problems related to route optimization. As NNA delivered the biggest advantages, but ACO sped up the process, it is possible that future studies may benefit from integrating two of the competing methodologies (ACO and NNA). As a result, they were able to counterbalance each other and compensate for each other’s shortcomings in the many KP-related optimization difficulties they faced.
Data Availability
No data were used to support the findings of the study.
Conflicts of Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.