1 Introduction

Nowadays, due to the complexity or large number of variables in the problem space, there are many problems and applications that cannot be solved in a reasonable time and at an affordable computational cost with traditional approaches and direct search techniques. In some cases, solving the problem may require applying fundamental changes to the algorithm. Therefore, finding an optimal solution to such problems is usually approached by employing meta-heuristic and evolutionary optimization algorithms. Most of these algorithms provide a convenient solution by simplifying the complex behavior of problems through the modeling of biological processes in nature. The success of these algorithms has motivated researchers to develop novel meta-heuristic and evolutionary algorithms. Accordingly, there are currently a large number of bio-inspired and nature-inspired optimization methods [1, 2].

There are different types of optimization problems that are solved by optimization algorithms: discrete, continuous, combinatorial, and multi-objective problems [3, 4]. The type of problem does not affect how algorithms are inspired by biological or natural processes. In all optimization algorithms, the performance of a process in biology or nature is examined in detail and mapped to the steps of the optimization algorithm. Due to their superior performance, optimization algorithms have been used to solve many real-world problems in various fields. Optimization algorithms can be employed in different applications, such as computer networks [5], intrusion detection [6], data mining [7], face recognition [8], and clustering [9]. Furthermore, these algorithms may be utilized in other scientific contexts like electrical engineering (i.e., power systems [10] and telecommunications [11]) and other industries (i.e., robotics [12] and transportation [13]).

In late 2019, the World Health Organization (WHO) reported cases of a new Corona virus disease in Wuhan, China [14]. The origin of this new disease was an unknown animal virus, most likely from a snake, bat, or anteater. The transmission was reportedly related to interaction among people in the Huanan seafood wholesale market [15]. In addition to its spread throughout China, the new Corona virus was transmitted globally through tourism and business travel and eventually led to a viral pandemic. Since the outbreak of the virus, known as COVID-19 (COrona VIrus Disease-2019), millions of people around the world have become infected and even lost their lives, while others have recovered. To stop the spread of the virus, populations have adopted preventive measures and governments have implemented laws and regulations.

By considering the features and behavior of COVID-19, the current paper introduces an optimization algorithm called Corona virus optimization (CVO), which offers a practical and efficient method for solving application problems. Based on its biological and ecological characteristics, the Corona virus’ epidemic behavior is simulated according to the SIR mathematical model, by which the procedure of the optimization algorithm is proposed. COVID-19 symptoms can be rapidly transmitted from one person to another and so large numbers of people in a community may become infected in very little time. With increasing human interactions over time, large populations will become infected with the virus. In addition, during this transfer, symptoms and the health condition of the person contracting the virus can differ from that of the virus carrier. The combination of the symptoms and the transmission process of the disease inspire the CVO algorithm. The proposed algorithm is applied to both minimization and maximization problems. After the theoretical development of the CVO algorithm, the present research evaluates its performance for continuous and discrete problems. This performance evaluation is conducted using a set of benchmark functions and by comparing results with other well-known optimization algorithms. The results show that the proposed algorithm’s performance is acceptable and, in some cases, produces even better results than those of other existing algorithms.

To the best of our knowledge, no optimization algorithm has been proposed based on the Corona virus disease. The CVO algorithm is an optimization approach that can be of great help to researchers in solving NP-hard problems. The most important advantage of the proposed optimization algorithm is that it leads to superior results compared to most well-known optimization methods and the experimental results approve this claim. The main reason of this advantage is that the proposed method starts with an initial population, which is dynamic and the number of this population changes during repetitions, while other optimization methods consider a fixed population. This dynamic behavior denotes that only people with weak immune systems are infected which leads the population to the global best solution of the problem.

Section 2 of the paper provides the literature review. While categorizing some highly cited optimization algorithms, Sect. 2 also presents comparisons that consider some other features. Section 3 discusses the biology and ecology of the Corona virus, and Sect. 4 simulates the epidemic behavior of the Corona virus and presents the proposed optimization algorithm in detail. In Sect. 5, the performance of the proposed optimization algorithm is evaluated through the implementation of several continuous and discrete application examples. These problems consist of a set of continuous mathematical problems and applications including the optimal placement of resources, bag of tasks (BoT) scheduling, and traveling salesman problem. Finally, Sect. 6 is devoted to the conclusion, discussion, and future directions of study.

2 Related work and literature review

Biology-inspired or nature-inspired optimization algorithms consist of several different classes. Some consider the concept of swarm intelligence to model animal behavior. Algorithms in this category cover various cases, such as the locating of food by ants [16] and bees [17]; the movement of particles, including that of birds [18], bats [19], fireflies [20], grasshoppers [21], and butterflies [22]; moreover, the hunting strategies practiced by dragonflies [23], gray wolves [24], dolphins [25], and whales [26]. Other methods are inspired by the concept of reproduction-based evolution. For instance, this class considers the genetic algorithm [27], asexual reproduction optimization [28], bird mating optimization [29], coral reef optimization [30], differential evolution [31], bacterial proliferation [32], and the krill herd [33]. Other optimization algorithms have been proposed based on human social behavior, such as the imperialist competitive algorithm [34], the brain storm optimization algorithm [35], anarchic society optimization [36], and the ideology algorithm [37].

Some optimization algorithms operate on the basis of plant behavior and, in most of these, there is no interaction between the agents. For instance, this category considers invasive weed optimization [38], the plant propagation algorithm [39], the flower pollination algorithm [40], the artificial plant optimization algorithm [41], the forest optimization algorithm [42], and the tree growth algorithm [43]. Some algorithms are also based on chemical or physical processes, such as simulated annealing [44], the artificial chemical process [45], the artificial reaction algorithm [46], thermal exchange optimization [47], electromagnetism mechanism optimization [48], artificial physics optimization [49], electromagnetic field optimization [50], and the artificial electric field algorithm [51].

Other optimization approaches refer to algorithms that do not belong to any of the aforementioned categories and whose source of inspiration is a specific real-world application. Algorithms in this category include various phenomena, including meteorology, astronomy, art, and sports. Algorithms, such as the rainfall optimization algorithm [52], black hole optimization [53], the galaxy-based search algorithm [54], the pop music algorithm [55], harmony search [56], soccer game optimization [57], the golden ball algorithm [58], and FIFA world cup competitions [59], are considered in this category.

Another group of meta-heuristic algorithms based on swarm intelligence simulate the behavior of microorganisms. The operation of these algorithms is inspired by viruses, bacteria, algae, and the like. These algorithms include the virus optimization algorithm [60], virus colony search [61], bacterial-GA foraging [62], the fast bacterial swarming algorithm [63], the bacterial foraging optimization algorithm [64], bacterial colony optimization [65], and the artificial algae algorithm [66]. In virus-based bio-inspired optimization algorithms, the process of virus transmission to healthy cells is repeated until an optimal solution is obtained. For instance, in the research conducted by Juarez et al. [60], an optimization algorithm has been proposed for continuous problem that is inspired by the behavior of viruses attacking a healthy cell. In similar research by Li et al. [61], the Virus Colony Search (VCS) algorithm is proposed that simulates the virus infection and diffusion strategies. All algorithms in this category mimic the spread of a virus only in the cells of a living organism. Until now, no algorithm has been proposed that is inspired by the transmission of a virus from one individual to another.

In addition to the issues mentioned here, other optimization algorithms have been proposed, all of which are bio-inspired or nature-inspired and beyond the scope of this research. More details about these algorithms can be found in the literature [67,68,69]. Despite the diversity in the characteristics and behavior of all existing optimization algorithms, it can be claimed that most are based on one of the five well-known classic algorithms: ant colony optimization [16], the artificial bee colony [17], particle swarm optimization [18], the genetic algorithm [27], and differential evolution [31]. All of the algorithms mentioned above differ in their details and behavior. Table 1 compares these algorithms based on some features and characteristics.

Table 1 Comparison of optimization algorithms based on some characteristics

In Table 1, the source of inspiration field shows the origin of the algorithm’s concept. The solution classification field, regardless of the source of inspiration, denotes how the members of a population (algorithm solutions) interact with each other to reach the optimal solution. Stigmergy is a mechanism of indirect coordination between the different members of a population, which is performed through an intermediate structure and whose purpose is to produce better solutions [16]. In the representative solution, a number of the members of a population are first selected as the best solutions and then even better solutions are extracted from this small group [18]. In the entire population method, all members of a population are effective in determining the optimal solution. In this approach, according to the difference in fitness function or the distance between solutions, a weight is assigned to each member of the population and, at each stage, this weight is used to determine the optimal solution [20]. The combination method is the crossover of several solutions with each other so as to create a better solution [27]. In a neighborhood, each solution is affected only by the solutions that are locally adjacent [32]. In the subpopulation approach, the whole population is first divided into several subpopulations. Then each solution in a subpopulation is affected only by other solutions in the same subpopulation and this process continues until the final solution is determined [45]. Moreover, the behavior field denotes the functioning procedure of the desired algorithm.

3 Corona virus biology and ecology

Since COVID-19 was first reported on December 31, 2019 in Wuhan, China, it has rapidly spread. The virus has infected people around the world and can, therefore, be considered as a pandemic [70]. As COVID-19 continues its global proliferation, governments have implemented regulations and instructed their citizens to adopt certain measures to combat the virus. Curfews, city quarantines, fines, and business closures have been deemed necessary by governments, while individuals are advised of preventive practices, such as regular hand washing, wearing masks, staying at home, and observing social distancing. Health organizations, including the WHO, have also taken steps to curb and reduce the prevalence of COVID-19. One of the most effective measures for controlling any contagious disease is its mathematical modeling. A well-designed model of an infectious disease can help predict the disease's behavior and so facilitate the planning of defensive strategies [71].

One of the most important parameters in infectious disease modeling is the basic reproductive number (denoted as \({R}_{0}\)), which is a function of the contact rate between individuals, symptom transition probability, and the duration of infectiousness [71]. This number denotes the average number of persons infected by a single individual. If \({R}_{0}<1\), then each infected person can only infect less than one other person; therefore, the growth of the disease is expected to stop. If \({R}_{0}=1\), then each infected person can infect one other person on average, thus resulting in stable disease growth. This condition is called endemic, when the number of infected people does not increase or decrease. However, if \({R}_{0}>1\), then each person can infect more than one other person on average and, as a result, the disease, if left untreated, is expected to grow exponentially and consequently lead to an epidemic or pandemic [72].

Since COVID-19 is pandemic [70], the \({R}_{0}\) rate is certainly greater than 1. According to research, the \({R}_{0}\) rate for COVID-19 depends on a number of factors that include climate, race, population density, age, percentage of public transportation use, and even average income [73]. Accordingly, this number varies among different countries and even in different regions of a country. The average range for the COVID-19 \({R}_{0}\) rate is estimated between 2 and 12 for different parts of the world [73, 74]. Based on \({R}_{0}\), Fig. 1 shows how the COVID-19 virus has been transmitted and spread since its discovery. As seen in Fig. 1, the degree of attention paid to COVID-19 protocols by the public has so far prevented the entire world population from contracting the virus. As a result, only a part of the world’s population has become infected, which is perhaps due to a lack of care in following protocols or a weakened immune system.

Fig. 1
figure 1

How the COVID-19 virus has been transmitted and spread since its discovery, based on the value of \({R}_{0}\)

Mathematical models of the disease can simulate the transmission process at different levels. Some types of models show cell interactions in a single patient, while others present the prevalence of the virus among different communities that are geographically dispersed. All the mathematical models proposed for COVID-19 have been of the latter type. Since the beginning of the COVID-19 outbreak, a number of mathematical models have been introduced [75,76,77]. The basis of most of these models is SIR [71, 78], which is a standard compartmental disease model that consists of three compartments: susceptible, infectious, and recovered/removed. One of these compartments is assigned to each member of the community.

In the SIR model, the compartment term of susceptible refers to those people having no immunity against the disease. Immunity can be acquired through vaccination, prior exposure, or a genetic mutation that leads to body resistance. In the model, if a susceptible individual comes in contact with an infected individual and his/her immune system is weaker than that of the infected individual, he or she becomes ill and is transferred to the infectious compartment. The compartment term of infectious refers to people who have the disease and can spread it to others. If an infected person is cured of the disease or he or she dies, then that person is transferred to the recovered/removed compartment. The compartment term of recovered/removed refers to those who have either not been infected for a long time (for reasons such as vaccination, previous exposure or high body resistance) or those who have died of a previous infection. It should be noted that, in many SIR-based models, it is assumed that a recovered/removed individual can no longer be transferred to the infectious compartment. Figure 2 illustrates the interactions in the simplest SIR model among the three COVID-19 compartments: susceptible, infectious, and recovered/removed.

Fig. 2
figure 2

The interactions in the simplest SIR model among the three COVID-19 compartments: susceptible, infectious, and recovered/removed

If the total population is N, this population can be divided into three compartments: susceptible, infectious, and recovered/removed. Figure 2 assumes that the number of susceptible individuals is S, the number of infectious individuals is I, and the number of recovered/removed individuals is R. Accordingly, the birth rate is the percentage of people who are added to the total population of N. Moreover, the recovered/removed rate refers to the percentage of people who are transferred from the infectious to the recovered/removed compartment. The transmission rate, denoted by \(\tau\), is the rate at which symptoms are transmitted from an infected person to a susceptible person, which is directly related to the individual’s extent of exposure. The dotted line above the transmission rate indicates that contact with infected individuals and the transmission of symptoms is essential for a susceptible individual to become infected. The transmission rate is calculated using Eq. 1 as follows [78]:

$$\tau = \rho \times \varphi$$
(1)

In Eq. 1, \(\rho\) refers to the contact rate and \(\varphi\) denotes the symptom transition probability. The contact rate (which is a number between 0 and 1) indicates the contact required between an infected person and a susceptible person for the transmission of symptoms. The closer this number is to zero, the less likely a person becomes infected; the closer the value is to one, the more likely a person contracts the disease. For example, \(\rho =0.5\) signifies that, for every 100 contacts, symptoms can be transmitted through 50 contacts, which then leads to illness. The symptom transition probability is between 0 and 1 and indicates the chances that an infected person transmits symptoms to a susceptible person following contact. The lower the number, the less likely disease symptoms are transmitted and, as a result, the more likely a susceptible person is not infected. However, the significant factor in Fig. 2 is the force of infection, which represents the number of people being transferred from the susceptible compartment to the infectious compartment. The force of infection, denoted as \(\lambda\), is represented by members of the infectious population and is calculated as follows [78]:

$$\lambda \left( I \right) = \tau \times \frac{I}{N}$$
(2)

Equation 1 shows that, by assuming a constant rate of symptom transmission from an infected individual to a susceptible individual, the force of infection will increase if the number of infected people increases relative to the total population and vice versa. Moreover, if the number of infected people is constant, the force of infection will increase with a rise in the symptom transmission rate and vice versa. In the SIR model, although the symptom transmission rate and the number of infected persons are critical factors in the transmission of COVID-19, the human immune system also impacts the force of infection. Accordingly, studies denote that people with a weak immune system are more susceptible to the virus [79, 80].

4 Simulating the pandemic behavior of the Corona virus infection

Based on the Corona virus’ biological and ecological implications described in the previous section, Sect. 4 focuses on the pandemic behavior simulation of Corona virus transmission and introduces a new optimization method called Corona virus optimization (CVO). As observed during the Corona virus pandemic, an initial population becomes infected and, over time, the number of infected people increases according to the basic reproductive number. During the illness, symptoms can be transferred from an infected person to a susceptible person who can become infected if his or her immune system is weak. In addition, the force of infection has a significant effect on the transmission of the virus. Infected people recover or die after the course of the disease. The disease will continue to spread until either a fundamental solution to treat and stop the virus spread is found (such as a vaccine or a disruption of the transmission chain) or the immune system becomes so strong that the virus cannot be transmitted from currently infected individuals to new susceptible individuals.

The aim of the proposed method is to provide an optimal solution to optimization problems based on the pandemic behavior of COVID-19. In the proposed method, the optimization problem variables are a set of disease symptoms and the fitness function indicates the level of immunity of the susceptible person after the transmission of symptoms from an infected person. The CVO method is a representative solution-based method, meaning that it first considers an initial population infected with the virus and this population increases over time. It is important to note that, in order to achieve the optimal solution, it is better to first consider a small initial population. It is also assumed that the number of infected people in the whole virus transmission process has a maximum value (total population). This assumption is based on the fact that, despite the spread of the virus, measures taken by the public and regulations set by governments have prevented all members of the society from becoming infected with the virus. In the SIR model, although the contact rate may be between 0 and 1 for the transmission of the virus from an infected person to a susceptible person, the contact rate is assumed to be 1 due to the given force of infection of COVID-19 and the possibility of transmission even from the first contact. Moreover, the symptom transmission probability in this approach is calculated based on the type of problem (continuous or discrete) and is determined using a random number, as further explained in Sect. 4.2.

Similar to other optimization algorithms, the proposed CVO approach has a number of iterations, each of which tries to identify individuals with weaker immune systems. In each iteration, an infected person transmits symptoms to susceptible persons, the number of which is determined according to the basic reproductive number. After the transmission of symptoms to a susceptible person, his or her immune level is calculated. If the level of immunity is less than or equal to that of the infected person, then the susceptible person will also become infected. Therefore, in each iteration, an infected person can infect new susceptible individuals up to the basic reproductive number if their immunity level is less than or equal to that of the infected person. This process is also performed on other infected individuals during an iteration, and finally, new infectious populations are identified.

During each iteration, the lowest level of immunity of newly infected individuals is considered as the optimal solution in that iteration. If this value is less than the value specified in the previous iteration, the newly infected individuals will completely replace the previous infectious population. Accordingly, previous infectious populations are considered as recovered/removed populations. However, if this value is the same in two consecutive iterations, the new population is added to the previous population. Due to preventive measures adopted by the public and regulations implemented by governments, a maximum value is assumed for the infectious population in the whole transmission process. At the end of each iteration, if the total infectious population exceeds the maximum population value during the current iteration, only infected individuals with lower immunity levels are isolated and other individuals are removed and considered as recovered/removed.

4.1 The relationship between symptom transmission probability and the type of optimization problem

The transmission of COVID-19 symptoms is achieved in different ways [81]. In one transmission method, all the symptoms are transmitted from the infected individual to the susceptible individual, with the critical issue being any changes in the severity of the symptoms during transmission. For example, suppose an infected person has three symptoms: cough, fever, and the loss of taste and smell. The severity of these symptoms may increase or decrease during the transmission. In other words, all three symptoms are transmitted simultaneously and continuously to the susceptible person. However, although the susceptible person exhibits these symptoms, their intensity may differ from what the infected person experiences. In another transmission mode, the severity of the symptoms of the susceptible person may be equal to that of the infected person, but the order of their occurrence may differ. For example, consider the same infected person with the three symptoms of cough, fever, and the loss of taste and smell. During the transmission of symptoms, the susceptible person may first develop a fever, then a loss of taste and smell, and finally a cough, while the infected person first experiences a cough, then a fever followed by the loss of taste and smell. In other words, the symptoms are transmitted asynchronously and discretely to the susceptible person, who happens to experience the same intensity but a different order of occurrence.

In consideration of the different ways of transmission and the behavior of the CVO method derived from COVID-19, the symptom transmission probability depends on the type of optimization problem. In other words, during transmission, if the problem is continuous, then the severity of the symptoms changes and, if the problem is discrete, then the order of the symptoms alters. If the optimization problem is continuous, the symptom transmission probability follows a normal distribution between 0 and 1 and employs the Box-Muller transformation method. The Box-Muller transformation method, represented as Eq. 3, maps a uniform distribution in the range 0 to 1 to a standard normal distribution. In Eq. 3, variables \({U}_{1}\) and \({U}_{2}\) are two independent random numbers that are selected from a uniform distribution in a unit interval (0, 1).

$$Z = \sqrt { - 2\ln U_{1} } \times {\text{cos}}\left( {2\pi U_{2} } \right)$$
(3)

By considering this policy for symptom transmission, each symptom of the infected person is randomly changed, while all of the symptoms are transmitted to the susceptible person at the same time. In other words, in continuous problems, it is assumed that all symptoms of the disease are transmitted from the infected individual to the susceptible individual with the only difference being a change in the severity of these symptoms. On the other hand, if the optimization problem is discrete, then there is a possibility of transmitting a random permutation of the symptoms from the infected person to the susceptible person. In other words, only the symptom transmission sequence changes and the severity of the symptoms is constant. In discrete problems, it is assumed that all symptoms of a disease are transmitted from the infected person to the susceptible person with the same severity, with the only difference being a change in the order of symptom transmission. However, there is another possible mode not considered by the present research which features differences in both severity and the order of symptom transmission. Consequently, this mode can be used to solve combinatorial optimization problems. If the severity and the order of symptom transmission do not change (COVID-19 symptoms can be transmitted in this way), then the proposed CVO method cannot determine a solution for the optimization problem.

4.2 Corona virus optimization algorithm

Table 2 presents the most important parameters and variables used in the CVO algorithm. The table lists the concepts inspired by COVID-19 and describes the parameters and variables considered in the optimization problem space. For example, the difference between the LocalBest and the GlobalBest is that the LocalBest variable stores the best solution in each iteration of the algorithm, while the GlobalBest variable stores the best solution in all iterations. In general, the CVO approach considers that the disease transmission process begins in a limited population and continues based on pandemic iterations. In each iteration and after the transmission of symptoms from infected to susceptible individuals, the susceptible individuals with weaker immune systems become ill and are added to the infectious population. It is assumed that individuals with stronger immune systems are transferred to the recovered/removed population. At the end of each iteration, if the value of the weakest immune system, which is stored in the LocalBest variable, is less than the GlobalBest, then the GlobalBest variable is updated.

Table 2 Some of the most important parameters and variables for CVO algorithm implementation

Algorithm 1 represents the mechanism of the proposed CVO method. The input parameters of this algorithm are Iters, basePop, nPop, nVar, LB, UB, and \({R}_{0}\). The output of the algorithm is the best solution which is returned by the GlobalBest variable. This variable consists of the symptoms (the optimization problem variables) and the value of the weakest immune system (the optimization problem solution) throughout the whole algorithm's iterations. Lines 1 to 16 initialize the GlobalBest variable and the initial population. In line 3 of the algorithm, according to the force of transmission of COVID-19 and the possibility of its transmission even from the first contact, the value of the contact rate is equal to 1. If the optimization problem is continuous, in lines 5 to 7 for each basePop member of the population, a set of random numbers in the interval [LB,UB] are generated and stored in pop as the initial symptoms of the current patient. However, if the optimization problem is discrete, in lines 8 to 10 for each member of the initial population, a random permutation of the problem variables is assigned as the initial symptoms. In line 11, the value of the fitness function is calculated for each member of the pop population and, if it is less than the GlobalBest value, it is replaced in lines 12 and 13.

The iterations of the CVO algorithm are performed in lines 17 to 53. In each iteration, first a population of new patients is created for the current iteration (line 18) and then the value of the LocalBest variable is initialized (lines 19 and 20). Lines 21 to 40 check the possibility of transmitting the disease from infected to susceptible individuals during a single iteration. Line 22 shows that any infected person can infect \({R}_{0}\) susceptible individuals. If the type of problem is continuous, the new potential symptoms are determined based on Eqs. 1, 2, 3 in lines 23 to 27, the value of which must be in the interval [LB, UB]. In line 25 of the algorithm, \(\left|newPop\right|\) denotes the number of new patient populations in the current iteration. However, if the problem is discrete, lines 28 to 30 produce new susceptible symptoms by randomly replacing a permutation of symptoms of the previous patient. In line 31 of the algorithm, the immunity level of the new susceptible person is determined based on the symptoms and using the optimization fitness function. If the level of immunity for the susceptible person is less than the immunity level of the infected person transmitting the disease, the susceptible person will be added to the new patient population in lines 32–34. Moreover, if the immunity level of the susceptible person is less than the immunity level of the entire patient population during one iteration, the symptoms and immunity level of the susceptible person will replace LocalBest in lines 35 to 38 of the algorithm. It can be assumed that susceptible individuals with a higher immunity level are those who have followed health protocols and are, therefore, not added to the new patient population.

After the new patient population is determined during one iteration, the GlobalBest values and the members of the entire patient population are updated for this iteration in lines 41–52. In lines 41–46, if the value obtained for the LocalBest is less than the GlobalBest, the GlobalBest value is replaced by the LocalBest and all members of the new patient population in this iteration will replace the total population of pop patients. Otherwise, in line 45, new patients will be added to the pop patient set. In line 47 of the algorithm, the number of the initial population’s members is updated for the next iteration which is equal to the number of pop members. If this initial population exceeds the total population (which is one of the algorithm’s input parameters), the pop population is sorted in ascending order by the value of the immune system in lines 48–52. Therefore, the smaller nPop number is selected as the pop population and the value of the initial population variable is updated. The proposed approach reduces the population of infected people as a result of their recovery or death, a policy inspired by COVID-19 behavior.

figure a

5 Performance evaluation

In order to evaluate the efficiency of the proposed method, the present study employs several mathematical functions for continuous problems and several practical examples for continuous and discrete problems. Moreover, for comparing results and evaluating performance, several well-known optimization methods are used, the most important of which are the genetic algorithm (GA), simulated annealing (SA), particle swarm optimization (PSO), and invasive weed optimization (IWO). All of the implementations are conducted in Visual Studio.NET 2010 with the C# programming language. Furthermore, all scenarios are performed on a personal computer with Intel 3.00 GHz Dual Core CPU, RAM 8.00 GB, and 1 TB HDD. The current work utilizes the best solution value criterion to test mathematical functions and evaluate practical examples. In the practical examples, the convergence of the method so as to reach the optimal solution as quickly as possible is also evaluated and discussed using several diagrams. Another reason for considering the optimal solution convergence criterion is the reduction in both the number of iterations required to determine the best solution and in the algorithm’s execution time, which produce faster results. Therefore, the optimization algorithm can be utilized to solve real problems, especially real-time applications. Table 3 presents the parameter values for the CVO algorithm in all the evaluations. Similar to the CVO method, the total population size is 100 and the number of iterations is 200 in all other algorithms.

Table 3 The common parameter values of the CVO algorithm in all experiments

5.1 Continuous mathematical functions

There are many mathematical functions used to evaluate optimization algorithms. Table 4 lists the selected mathematical functions to evaluate the CVO method. These continuous functions are the most common functions for evaluating most optimization algorithms. Due to their specific input range and best global value, these mathematical functions are considered appropriate for evaluating new optimization algorithms. In addition to the function name and its mathematical representation, Table 4 lists other fields, namely the number of dimensions, the input domain, the best solution value, and the 3D schematic of function graph.

Table 4 Continuous mathematical functions selected to evaluate the CVO method

In order to accurately evaluate the proposed optimization method, a comparison with other optimization algorithms is conducted as well as a repeat of all experiments 10 times. Table 5 presents the average results for the best solution criterion. Since the number of variables affects the results of the algorithm, the number of variables in the different experiments varies. Consequently, all of the experiments for each algorithm are performed 30 times. The results in Table 5 indicate that the proposed method is able to determine a suitable solution for most of Table 4’s mathematical functions for different numbers of variables and leads to acceptable solutions for other functions.

Table 5 Average results for 10 executions of benchmark mathematical functions using optimization algorithms and based on the number of different variables

5.2 Optimal placement of resources

The problem of optimal placement of resources is considered a continuous problem that has many applications in everyday life and industries, such as electricity, computers, and mechanics. Assuming that there are a number of devices installed in the environment, the goal of this problem is to find the best resource placement with the shortest distance from all devices. Shorter distances either reduce the cost of connecting devices to the resource or increase the possibility of accessing the resource. It should be noted that, in addition to the distance criterion, there may be other important criteria depending on the type of application. Due to existing geographical constraints, it is generally not possible to use the unique shortest path to calculate the distance in this case and so the Manhattan distance is employed instead [82]. The resource and devices can be located in an n-dimensional geographic space and, due to the fact that the geographical coordinates are continuous, this is considered as a continuous problem. Generally, finding a suitable resource placement is difficult and time consuming, especially when the number of devices and the size of the geographic space increase; as a result, this is considered as an NP-hard problem. Optimization algorithms are, therefore, a good option when finding an optimal solution. Eq. 4 presents the objective function of this problem.

$$\begin{gathered} {\text{min}}\;{\text{Distance}} = \mathop \sum \limits_{j = 1}^{m} \mathop \sum \limits_{i = 1}^{n} \left| {R_{i} - D_{{{\text{ji}}}} } \right| \hfill \\ s.t.: \hfill \\ \forall i,j = 1,2, \ldots ,m \left( {i \ne j} \right): \mathop \sum \limits_{k = 1}^{n} \left| {D_{ik} - D_{{{\text{jk}}}} } \right| \ne 0 \hfill \\ \end{gathered}$$
(4)

In an n-dimensional space, suppose there is a resource that must be connected to m number of devices. The location of this resource should be specified as a place where all devices are at the shortest distance from the resource. In Eq. 4, index i represents each dimension in the coordinate axes, (\(i\in \{\mathrm{1,2},\dots ,n\}\)), and index j represents the device number (\(j\in \{\mathrm{1,2},\dots ,m\}\)). Variables \({R}_{i}\) and \({D}_{ji}\) also denote the coordinates of the i-th dimension of the resource and the i-th dimension of the j-th device, respectively. Moreover, \(\left|{R}_{i}-{D}_{ji}\right|\) represents the absolute distance of the i-th dimension of the resource and the i-th dimension of the j-th device relative to each other. Although Eq. 4 uses the Manhattan distance, other geometric distances, such as the Euclidean distance, can also be considered depending on the problem. The limitation of Eq. 4 states that independent devices are located in separate locations and this deployment independence may be considered in only one dimension. To solve the problem of the optimal placement of resources using the CVO method, each resource placement is assumed to be a patient whose symptoms are the geographical coordinates of the resource.

Figure 3 provides the experimental results, to determine the optimal solution to this problem using the CVO method in comparison with other optimization algorithms. To implement this problem, the number of devices is assumed to be 1,000 and their position is randomly determined in a five-dimensional space. Although this space is unrealistic, these features are considered so as to increase the number of variables and thus augment the complexity of the problem. The comparison criterion is the sum of the minimum distances between the resource and the devices in all five dimensions based on Eq. 4. As shown in Fig. 3, while determining the appropriate solution, the CVO method is able to converge toward this solution with the least possible iterations when compared to other algorithms.

Fig. 3
figure 3

Comparison of the experimental results of the problem of optimal placement of resources using the CVO method with those of other algorithms

5.3 Bag of tasks (BoT) scheduling

Bag of tasks scheduling is one of the well-known problems in the field of high-performance computing (HPC). In the context of BoT scheduling, the main goals are to reduce the makespan and thus increase system utilization [83]. In this discrete problem, there are a number of tasks that must be scheduled and executed on different processing resources. Because of the increase in the number and size of tasks (according to the number of instructions), finding a suitable scheduling solution is difficult and time consuming. Accordingly, the problem of BoT scheduling is an NP-hard problem that can be solved with optimization algorithms. In high-performance computing, namely cloud and grid computing, there are a number of virtual machines that differ in their configurations, such as for processing speed, memory, and storage. Moreover, tasks can have a variety of computational, memory, and storage requirements. Therefore, the cost of executing a task on different virtual machines varies. The goal is to find the best assignment of tasks to the virtual machines so that the makespan is minimized. Equation 5 expresses the objective function of this problem:

$$\begin{gathered} {\text{min Makespan}} = \mathop \sum \limits_{i = 1}^{n} \mathop \sum \limits_{j = 1}^{m} C_{{{\text{ij}}}} \times X_{{{\text{ij}}}} \hfill \\ s.t.: \hfill \\ X_{{{\text{ij}}}} = \left\{ {\begin{array}{*{20}c} 1 \\ 0 \\ \end{array} } \right.\begin{array}{*{20}c} { {\text{ if Task}}_{i} {\text{is executed on VM}}_{j} } \\ {{\text{Otherwise}}} \\ \end{array} \hfill \\ \mathop \sum \limits_{j = 1}^{m} X_{{{\text{ij}}}} = 1 \hfill \\ \end{gathered}$$
(5)

Suppose there are n tasks that must be scheduled on m virtual machines. In this equation, index i represents the number of tasks (\(i\in \{\mathrm{1,2},\dots ,n\}\)) and index j represents the number of virtual machines (\(j\in \{\mathrm{1,2},\dots ,m\}\)); variable \({C}_{ij}\) also represents the cost of executing the i-th task on the j-th virtual machine. The first constraint of this equation shows that if task i is executed on virtual machine j, the value of flag \({X}_{ij}\) will be equal to 1 or otherwise equal to 0. The other limitation of Eq. 5 also states that, during the scheduling and execution of tasks, each task can only be executed on one virtual machine. To solve the BoT scheduling problem with the CVO method, each scheduling sequence is considered as a patient whose symptoms are the cost of executing tasks on virtual machines.

Figure 4 shows the experimental results of determining the optimal solution to the BoT scheduling problem with the CVO method in comparison with other algorithms. To implement this problem, 300 tasks and 50 virtual machines are considered. In addition, the number of instructions for each task and the processing power of each virtual machine are randomly determined. The comparison criterion is the makespan based on Eq. 5. As depicted in Fig. 4, the CVO method is able to determine the appropriate solution in the least possible iterations when compared to other algorithms. Figure 5 also shows the schedule map of the tasks on virtual machines after the implementation of the CVO method in the developed simulator.

Fig. 4
figure 4

Experimental results of the BoT scheduling problem using the CVO method in comparison with those of other algorithms

Fig. 5
figure 5

The schedule map of BoT scheduling after executing the CVO method in the developed simulator

5.4 Traveling salesman problem

One of the famous problems addressed by many optimization algorithms and having numerous applications in the transportation industry is the traveling salesman problem (TSP) [84]. In this discrete problem, a traveling salesman starts marketing from one city of origin and returns to the city where he started after meeting his customers in n other cities. Accordingly, each city is visited only once and traveling from one city to another produces transportation costs. The goal is to find the route with the least cost for the salesman and in which all cities are traversed only once. Since it is assumed that there is a route between all the cities, the number of possible solutions to this problem is a permutation of n. The purpose of the problem is to find the path with the lowest transportation cost between these n! modes. As the number of cities increases, the number of possible solutions grows significantly. Due to this increase in problem space, the TSP is considered as an NP-hard problem. Equation 6 shows the objective function of this problem:

$$\begin{gathered} {\text{min Traveling Cost}} = \mathop \sum \limits_{i = 1}^{n} \mathop \sum \limits_{j = 1}^{n} C_{{{\text{ij}}}} \times X_{{{\text{ij}}}} \hfill \\ s.t.: \hfill \\ X_{ij} = \left\{ {\begin{array}{*{20}c} 1 \\ 0 \\ \end{array} } \right.\begin{array}{*{20}c} { {\text{if}} {\text{Seller}} {\text{moves}} {\text{from}} {\text{City}}_{i} to {\text{City}}_{j} } \\ {{\text{Otherwise}}} \\ \end{array} \hfill \\ \mathop \sum \limits_{i = 1}^{n} X_{{{\text{ij}}}} = 1 \hfill \\ \mathop \sum \limits_{j = 1}^{n} X_{{{\text{ij}}}} = 1 \hfill \\ \end{gathered}$$
(6)

Suppose there are n cities that the salesman must visit. In this equation, indices i and j represent the numbers of origin and destination cities, respectively (\(i,j\in \{\mathrm{1,2},\dots ,n\}\)), and variable \({C}_{ij}\) represents the cost of traveling from city i to city j. The first constraint of this equation denotes that, if the salesman travels from city i to city j along the route, the value of flag \({X}_{ij}\) will be equal to 1 or otherwise equal to 0. The last two constraints of Eq. 6 also state that, along the optimal route, each city can only be visited once as an origin and once as a destination. To solve the traveling salesman problem using the CVO method, each traveled route by the salesman from all cities is considered as one patient whose symptoms are the cost of traveling between pairs of cities.

To implement the traveling salesman problem on different optimization algorithms, three types of datasets are considered. In the first set, 100 cities are produced with random distances between 0.1 and 20. In the second set, the distances between 48 central cities in different US states are used from the ATT48 dataset [85]. In the ATT48 dataset, which is dedicated to evaluating algorithms developed for the traveling salesman problem, the tour has a minimum length of 33,523. The third dataset also considers the data presented in [43] consisting of 15 cities. The minimum tour length in this dataset is 248.03. The comparison criterion is the minimum cost of traveling based on Eq. 6. Figures 6, 7, 8 show the experimental results of determining the optimal solution with the CVO method in comparison with other algorithms for the three datasets. As depicted in these figures, the CVO method, while determining the appropriate solution, is able to converge toward this solution in the least possible iterations when compared to other algorithms.

Fig. 6
figure 6

Experimental results of the traveling salesman problem using a random dataset

Fig. 7
figure 7

Experimental results of the traveling salesman problem using the ATT48 dataset [85]

Fig. 8
figure 8

Experimental results of the traveling salesman problem using the dataset presented in [43]

Figure 9 also presents the optimal route between cities after the implementation of the CVO method in the developed simulator for each of the selected datasets. All the results in Sects. 5.2,5.3, 5.4indicate that the CVO method is able to determine the optimal solution with the least possible iterations. In other words, the algorithm converges to the optimal solution with less iterations and at a higher speed. Accordingly, the execution time of the CVO algorithm is significantly reduced and, as a result, the proposed method can be used for various practical applications.

Fig. 9
figure 9

The optimal route between cities after the implementation of the CVO method for each of the selected datasets: a random dataset; b ATT48 dataset; c dataset in [43]

6 Conclusion, discussion, and future work

The current research simulated the pandemic behavior of Corona virus transmission based on the biological and ecological features of COVID-19 and, as a result, introduced a new optimization method called Corona virus optimization (CVO). Compared to some well-known optimization methods, such as the genetic algorithm, simulated annealing, particle swarm optimization, and invasive weed optimization, the proposed method can solve optimization problems and find appropriate solutions in a timely manner and with minimum iterations. In some cases, the solution obtained by the proposed algorithm is better than the mentioned optimization methods. To evaluate the performance of the proposed CVO method, the present study selects several continuous mathematical functions as well as three continuous and discrete application problems, namely the optimal placement of resources, bag of tasks scheduling, and traveling salesman problem.

The CVO algorithm is developed in such a way that its behavior is well-defined and, depending on the type of problem (discrete or continuous), there is no need to convert discrete problems to continuous problems and vice versa or to convert data for that matter. The transparent behavior of this algorithm is such that it can be utilized to easily develop and solve a discrete or continuous optimization problem. The experimental results indicated that, for both discrete and continuous cases, the proposed method provides a credible, acceptable, and reasonable performance. To solve a problem and find the best answer in most existing optimization methods, the algorithm settings must be determined by trial-and-error and be based on the type of problem. However, the CVO method does not require a continuous change of parameters. All evaluations show that it is possible to solve the optimization problem and find the optimal solution with the same default values for the algorithm, all of which are based on COVID-19 pandemic behavior.

In the standard SIR model, it is assumed that infected individuals will not fall ill again after their transfer to the recovered/removed compartment and so will not be transferred to the susceptible and infectious compartments. This assumption is not the case with COVID-19 since people who have already been infected are still susceptible to the disease and may re-enter the susceptible compartment. Despite this, the proposed method follows the standard SIR model. The reason for this behavior is because, in each iteration of the algorithm, the value of the fitness function for new solutions (susceptible individuals) is less than that of the previous solution (infected individuals). Therefore, in each iteration, there are infectious populations that have the lowest value of the fitness function when compared to all previous infectious populations. In other words, over time, populations are selected that are new and the output value of their fitness function is less than those of all the solutions obtained so far.

Although this research presents the CVO method for solving minimization problems and all experiments are performed accordingly, this approach may also be employed to solve maximization problems. To do so, an incremental precondition, such as the mutated strength of the virus instead of a weak immune system, is considered when selecting the output of the fitness function so that, in each iteration of the algorithm, higher value solutions are selected instead of the previous solutions. On the other hand, the value of the basic reproductive number can affect the performance of the CVO method. If the value of \({R}_{0}\) is considered too low, the problem space is reduced and the final solution may not be the optimal solution. Moreover, if the value of \({R}_{0}\) is considered too large, the pandemic will rapidly spread and the number of infectious populations will increase. This assumption will affect the execution time of the algorithm in achieving the optimal solution. According to the various experiments performed, the value of \({4\le R}_{0}\le 6\) can be a reasonable selection, in which the value of \({R}_{0}\) is assumed to be 5 in the current research.

As for future directions, more focus will be placed on the values of CVO algorithm parameters and their effect on how the algorithm functions. Moreover, the performance of the proposed CVO algorithm can be improved when inspired by various COVID-19 mutations, such as the UK variant. In addition, the CVO method may be utilized for other applications, especially real-time, and its performance evaluated. Another future direction is to modify the CVO algorithm for use in solving combinatorial optimization problems. In this regard, the usage will be for both types of symptom transmissions: a change in the severity of symptoms for continuous problems and a change in the order of symptoms transmitted for discrete problems.