1 Introduction

The cloud is an emerging computing technology that operates at large scales. It is the development of grid and service-oriented computing [1]. It supports virtualization technology and enables to lease on computing resources as a service. These resources are deployed in the form of different Virtual Machines (VMs). The VMs are dynamically allocated to the user based on their Service Level Agreement (SLA) [2,3,4]. The SLA is established through negotiation between user and service provider in terms of the deadline, consistency, security, network congestion and performance limit [5, 6]. The main goal of any service providers is to gain maximum profit and efficient usage of resources. There are many issues in cloud computing such as limited bandwidth, poor resource allocation, security concerns, data integration problem, migration concerns etc. Lack of optimized resource allocation is one of the key issues of the cloud computing [7]. The primary objective of resource allocation process is that the Quality of Service (QoS) [2] constraints must be satisfied so that service provider profit should be maximized. The SLA violations affect the QoS guarantees and may be a profit loss of a service provider due to certain penalty cost. This manuscript is confined only two approaches of QoS: Cloud Service Provider(CSP) and Cloud Service Consumer(CSC). The CSP and CSC mutually support the SLA in three aspects: services, profits and resources. Each service provider has many service consumers and it is necessary to ensure that the QoS requirements of all customers are achieved. Generally, the cloud provider applied a conventional auction mechanism periodically to allocate the instances of VMs [8, 9]. The existing schemes of resource allocation are not much more effective to reduce the SLA penalty costs. The allocation of resources in cloud environment is an NP-hard problem. There are several meta-heuristic optimization algorithms proposed to solve an optimal resource allocation in cloud computing.

This paper propose a hybridization of SACO [10] and GCO [11, 12] known as Generalized Ant Colony Optimizer (GACO), which is based on distance matrix, new colony creation, foraging behavior and continuous efforts of ants. The performance of GACO algorithm is measured on 17 benchmark test functions and compared with Particle Swarm Optimization (PSO), Genetic Algorithm (GA), and Artificial Bee Colony (ABC) algorithms.

The rest of the research article is organized as follow: Sect. 2 explores the comprehensive literature review on meta-heuristic optimization and ant algorithms. The proposed GACO algorithm has been explained in Sect. 3. An experiment, results and discussion are presented in Sect. 4. In Sect. 5, we apply GACO to optimization of resource allocation in cloud computing environment and Sect. 6 followed by conclusion and future scopes.

2 Literature review

This section explores a systematic review of meta-heuristic optimization algorithms, the emergence and recent applications of ant algorithms.

2.1 Meta-heuristics optimization algorithms

In the last three decades, the meta-heuristic optimization algorithms became popular. These algorithms have been used for getting optimal possible results for large-scale scientific compute-intensive problems. Meta-heuristic techniques are more relevant as compare to tradition optimization techniques to solve the optimization problem in large search spaces:

  1. (i)

    Reduced complexity

  2. (ii)

    In general faster

  3. (iii)

    Global searching ability

  4. (iv)

    Enhance performance and efficiency

  5. (v)

    No fixed iteration

  6. (vi)

    Simplicity and flexibility

Mostly, these algorithms are inspired by nature, physical phenomena, animal behavior, insect behavior, swarm intelligence and evolutionary concepts [13]. Meta-heuristic techniques are divided into five categories: Swarm-based, Nature-inspired, Biogeographic-stimulated, Evolutionary, and Physics-based. This classification is not unique; it may also happen that some algorithms have been included in another category. It depends on what the emphasis is and what the perspective may be. Figure 1 shows the taxonomy of meta-heuristic algorithms.

Fig. 1
figure 1

Taxonomy of meta-heuristic algorithms

The first meta-heuristic technique is a swarm-based which is inspired by the mutual behavior of particles, insects and social creatures. The most popular swarm-based algorithms are Fish Swarm Algorithm (FSA) [14], Particle Swarm Optimization (PSO) [15] Artificial Bee Colony (ABC) [16] and Ant Colony Optimization (ACO) [17]. A comprehensive literature survey of ant algorithms is provided in Sects. 2.2 and 2.3. Following are the advantages of swarm-based algorithms:

  1. (i)

    Swarm-based algorithms have very less number of parameters to amend.

  2. (ii)

    A swarm-based algorithm does not have a significant number of operators as compared to other approaches.

  3. (iii)

    Swarm-based algorithms collect facts about search space over the number of iterations.

  4. (iv)

    Very easy to implement.

Nature-inspired is the second category of meta-heuristic technique. It is based on guided search procedure. Population always adapts from environment. In some cases nature-inspired algorithm can be chemical and biological system depending on source of inspiration. Such meta-heuristic algorithms include Cuckoo Search Algorithm (CSA) [18], Bat Algorithm (BA) [19], Flower Pollination Algorithm (FPA) [20], Invasive Weed Optimization (IWO) [21], and Firefly Algorithm (FA) [22].

The third subclass of meta-heuristic is biogeographic-stimulated algorithms based on hunting and foraging behavior of some animals and sea creatures. The well-known algorithm of bio-inspired is Spotted Henya Optimizer (SHO) [23], Grey Wolf Optimizer (GWO) [24], Emperor Penguin Optimizer (EPO) [25] and Krill Herd Algorithm (KHA) [26]. These algorithms have their substantial ability to impersonate the best efforts.

The fourth subclass of meta-heuristic is evolutionary algorithms. These are based on the natural selection theory. The population tries to continue constructed on the fitness measure in the environment. It performs well and gives a nearest optimal solution. This method does not yield any hypothesis about adaptive nature and fitness. The most popular evolutionary algorithms are Deferential Evolution (DE) [27], Genetic Algorithm (GA) [28], Evolutionary Strategy (ES) [29], Evolutionary Programming (EP) [30], and Genetic Programming [31].

The last one is physics-based algorithms. These algorithms are typically based on physical rules. Some popular algorithms are Black Hole Algorithm (BHA) [32], Harmony Search (HS) [33], Simulated Annealing (SA) [34], and Central Force Optimization (CFO) [35], Gravitational Search Algorithm (GSA) [35]. These algorithms are different from swarm-based and nature-inspired algorithms. There are undefined usual of search agents are communicating and moving from one place to another due to physical rules. This communication and movement can be easily implemented by BH,CFO, GSA

2.2 Emergence of ant algorithm

This section provides an overview of various ant colony optimization meta-heuristic basic principles such as Ant Q, Max Min ant system, Ant-tabu, Continuous colony optimization, Fast ant system etc. Ants are social insects and living collectively in the colony. The collective behaviors of ants are more important to the survival of colony as well as the individual. Many researchers are working on it and many research on ant colonies intended at a better indulgent of ants behaviors. Many algorithms have been developed include the division of worker, foraging behavior, brood care, cemetery organization and colony construction. Table 1 shows the comprehensive review on emergence of different ant algorithms developed by many researchers.

Table 1 Emergence of ant algorithms

2.3 Recent applications using ant algorithms

Over the last three decades, ACO algorithms have developed as a dominant meta-heuristic technique to solve the various optimization problems [44,45,46]. The ACO meta-heuristic algorithms [17, 45] have applied in different domains such as supply chain management [47], a dynamic scheduling problem [48, 49], communication network design [50], multi-objective problem [51, 52], clustering problem [53], optimal truss design [54] etc. Table 2 shows the detailed review of recent applications solved by different authors.

Table 2 Recent applications of ACO

Dorigo et al. [10] has explained the recent trends of ant algorithms theoretically. The paper highlights how biological and nature insects inspiration can be transferred into an algorithm for distinct optimizations and also outlined the ACO in more precise regarding discrete optimization. Authors have summarized theoretical concepts and real optimization problems such as data mining, load balancing, graph coloring, etc.

Zeng et al. [75] have given some direction about the usage of ACO algorithm in the cloud storage system. The user can select a cloud storage resource randomly at the initial stage, and preserve the experiences and satisfactory information in service path as a pheromone. After over time the next user will be referred the past user experience and related value (pheromone deposit) from current cloud storage service. All these information are controlled by some protocols according to the situation.

An optimal solution of load balancing problem in cloud environments using ACO algorithm has explained in [76]. This article described how ACO algorithm maximizes and minimizes the different performance parameters like load, capacity, CPU, memory for the cloud. It has proposed a heuristic based ACO to initiate the service load distribution in the cloud environments. It also proved the efficiency and effectiveness of load balancing by their pheromone updating mechanism. The fault tolerance mechanism not considered in this article.

In [77] authors have studied two different approaches: MAX–MIN Ant System (MMAS) and Graph-Based Ant System (GBAS). They resolve the limitation pheromone updating of both approaches. In this article, authors have used two alternative methods to update pheromone (i) GBAS with lower pheromone bound and (ii) GBAS with evaporation factor.

3 Proposed Generalized Ant Colony Optimizer (GACO) algorithm

This section explains proposed GACO algorithm and technical specification the same. In GACO algorithm ants forging behavior plays an important role. The next section describing the same.

3.1 Ants foraging behavior

The existence of ants appeared on the earth around 10\(^{7}\) years back and current population density is projected 10\(^{6}\) individuals. Many entomologists studied about foraging behavior of ant and their ability to select the optimal path, without any coordination, advice, corporation and central approach. These emergent behaviors of ants located a food origin and influenced other ants also towards food. Ants are trailing pheromone on the path during food search. These pheromone deposits reinforce the ants to decide the better path. The higher pheromone deposited path attracts more ants to use that path. Here, the indirect communication modifies their path to affects the behavior of the other ants also. Dorigo and Blum [1] have studied about ants foraging behavior and explained a formal model of binary path selection process. This model assumed each ant deposits the same amount of pheromone. The mathematical formulation of the binary path selection had defined as follows:

Let \(n_{e1}(k)\) and \(n_{e2}(k)\) indicate the number of ants moving on path \(e_1\) and \(e_2\) respectively at time k. After time\(\ (k+1)\), the probability of the upcoming ants to select \(e_1\) path as follow:

$$\begin{aligned} P_{e1}\left( k+1\right)= & {} \frac{{(n_{e1}\left( k\right) +c)}^{\alpha }}{{(n_{e1}\left( k\right) +c)}^{\alpha }+{(n_{e2}\left( k\right) +c)}^{\alpha }} \nonumber \\= & {} 1-P_{e2}\left( k+1\right) \end{aligned}$$
(1)

where c is the quantifier that shows the degree of the attraction of path, and \(\alpha \) indicates the pheromone deposit. If the value of \(\alpha \) is increased, then probability may also be increased and reinforced to follow this path.

When ants move from nest to food source, an amount of pheromone deposited by each ant. Over time nearest path will have deposited more pheromone, and other ants move quickly on this path. The finding capability of binary path by ant’s colony is illustrated in Fig. 2.

Fig. 2
figure 2

The capability of binary path finding by ants. The pheromone deposits are shown as a dotted lines whose thickness denotes the pheromone strength, a all ants are in the nest. At initial stage there is no pheromone deposit on the path, b all ants move towards food. There may be probability 50% ants select shorter path and 50% ants take longer path. All ants trail same amount of pheromone on there respective path, c the ants have selected the shorter path, have arrived earlier. In case of returning, the probability of selecting shorter path again is higher, d the shorter path has got more pheromone deposited as compare to longer path. The shorter path has reinforced, and the probability to select this path increases. As the time increases the whole colony will use shorter path

3.2 Working model of GACO algorithm

The simple ACO algorithm was explained by Marco Dorigo et al. in the early 1990s. The SACO is an algorithmic implementation of binary path model illustrated in Equation 1. Artificial ants will find the nearest node randomly first time and the ants who have successfully reached the destination will update the total path length (L) as a pheromone trail of the link visited in pheromone table. Here, actually routing table is known as pheromone table that contains for each destination with real valued information, on for each known adjacency node. This information is a remedy of goodness of traversing over that adjacency node on the way to the destination. This table is continuously updated conferring to the quality of solution by the artificial ants. The next ant’s group will explore the pheromone trails with the help of pheromone table to reach the destination. The working model of proposed algorithm graphically exhibited in Fig. 3.

Fig. 3
figure 3

Working model of GACO algorithm

Let, number of artificial ant sets \(m=\left\{ 1,2,\ldots ,\ n_m\right\} \) are located in the colony. We assume ant m is currently situated at node i then the transitive probability of the ants to choose next node \(j\epsilon v^m_i\) is as follows:

$$\begin{aligned} P^m_{ij}\left( t\right) =\left\{ \begin{array}{ll} \frac{z^{\alpha }_{ij}\left( t\right) }{\sum _{j\epsilon v^m_i}{z^{\alpha }_{ij}\left( t\right) }} &{}\quad if\ j\in v^m_i \\ 0 &{}\quad if\ j\notin v^m_i \end{array} \right. \end{aligned}$$
(2)

where \(v^m_i\) is the set of feasible path linked with \(v_i\) with respect to m number of ants. Each ant has their own decision policy to choose the next node. The \(z_{ij}\) indicates the pheromone concentration on corresponding edge (i, j). If any \(v_i\) and ant m does not has any adjacent\({\ v}^m_i=\emptyset \), then the predecessor to \(v_i\) is included in\({\ v}^m_i\). There is always a probability of getting a cyclic path. In this case we can remove the cycle once the destination node has been selected. The \(\alpha \) denoted as a constant (positive) value to increase the impact of pheromone deposit. Once ants have built a complete path between source to destination nodes then entire cycle has been removed and individual path can be retraced to their source and retain a pheromone amount on each edge (ij) of their respective path. The total deposited pheromone by ant m is \(\delta z^m_{ij}(t)\) on path length \(L^m(t)\). The inverse if the path length \(L^m(t)\) consider as quality path as follows:

$$\begin{aligned}&\delta z^m_{ij}\left( t\right) \propto \frac{1}{L^m\left( t\right) } \end{aligned}$$
(3)
$$\begin{aligned}&therefore,\qquad z_{ij}\left( t+1\right) =z_{ij}\left( t\right) +\sum ^{n_m}_{m=1}{\delta z^m_{ij}(t)} \end{aligned}$$
(4)

where \(n_m\) denotes the population. We assume if \(O^m(t)\) denotes the optimal solution during time t then \(f(O^m\left( t\right) )\) depicts the quality solution. It is more important to emphasize on the optimal path selection process as a result of coordination which are evaluated from the modest behaviors of individual ants. In multiple global colony optimization [4, 11, 36, 73] for artificial ants \(n_m\), we consider both local as well as global search spaces. We assume \(n_l\) and \(n_g\) ants perform local and global search respectively. Let \(r_i\) denotes the province and \(f(r_i)\) is the fitness of province\({\ r}_i\). All provinces must be assigned with quality solution dynamically and \(z_i\) initializes the pheromone amount for each province. At starting point global search space is considered as weak because \(\forall n_m\) unknown about global province to explore new path. Here, 95% of the \(n_{g\ }\) perform crossover to struggle for new province and remaining 5% involved in pheromone trail distribution. The probability of each m of the local ants \(n_l\ \)selects \(r_i\) province which partially towards the good province as follow:

$$\begin{aligned} p^m_i\left( t\right) =\frac{z^{\alpha }_i(t){\mu }^{\beta }_i(t)}{\sum _{j\epsilon N^m_i}{z^{\alpha }_j(t){\mu }^{\beta }_j(t)}} \end{aligned}$$
(5)

where \({\mu }^{\beta }_i(t)\) denotes the a priori attractiveness of the move from source to destination, \(N^m_i\) indicate the feasible nodes. If province find better fitness then ant moves in the same direction otherwise increase the age of province and choose new direction randomly. The age of province denotes the weakness of the particular solution. The pheromone is modified by adding the amount of each \(z_i\) proportionate to the fitness of relative province. Some of other techniques to solve continuous optimization are mentioned in [11, 37, 73]. The technical specification of GACO algorithm is explained in Algorithm 1.

figure a

4 Experimental evaluation and discussions

This section explains seventeen well-known benchmark functions that are used to evaluate the efficiency and performance of GACO algorithm. The suggested benchmark test functions are exhibited in Sects. 4.1. Section 4.2 evaluates the performance metrics such as average and standard deviation compare with PSO, GA and ABC meta-heuristic algorithms.

4.1 Test benchmark functions and competitor algorithms

There are seventeen benchmark test functions have been applied on GACO algorithm and evaluate the performance. These test functions are categorized into two classes: (a) uni-modal, (b) multi-model. The modality of benchmark function defines the number of local minima and global minima locations. Table 3 shows the complete details of test functions along with search space range. These benchmark test functions evaluate the behavior of an algorithm in difficult situation and sometime diverse [78]. The seven functions (T1 – T7) are uni-modal and ten functions (T8 – T17) are included in multi-modal test benchmark. The first group of uni-model benchmark functions is more relevant for evaluating the utilization capability and convergence rapidness of an algorithm. There is no local optima and having single global optimum. Another group of multi-domain benchmark functions provide multiple local solutions and test the finding ability of an algorithm.

Table 3 Test benchmark functions [79, 80]

The population size/search agent of each competitive algorithm is set to 20. We observed that 20 is an equitable value of population size for several optimization problems. Generally, large size is not suitable for determining the global optima because it reflects the higher probability.

Table 4 Test parameters setting of algorithms
Table 5 Results of uni-model test benchmark functions
Table 6 Results of multi-model test benchmark functions

4.2 Performance evaluation

The parameters description of proposed algorithm and competitive algorithms are mentioned in Table 4. These parameters are fixed on the basis of reported literature review. The algorithms illustrated in this paper are implemented in MATLAB R2017b-9.3.0713579 version and then executed on MS Windows 7 Professional N with 64 bits. It is deployed on hardware configuration such as Intel Xeon e5 2650 2.6 GHz and 8 GB memory. The performance metrics are computed as average (AVG) and standard deviation (STDEV) of best solution till last iteration. Tables 5 and 6 show the evaluation results of test benchmark functions (T1–T7) and (T8–T17) respectively. As per reported results, the GACO is more efficient algorithm for test functions T1, T2, T5–T8, T10–T14 and T16. Remaining functions produce competitive results. We have generated and reported the result of each benchmark separately. These reports are mentioned in Figs. 4 and 5 of uni-modal and multi-model test functions respectively.

Fig. 4
figure 4

Results of uni-model test benchmark functions, a T1, b T2, c T3, d T4, e T5, f T6, g T7

Fig. 5
figure 5

Results of multi-model test benchmark functions, a T8, b T9, c T10, d T11, e T12, f T13, g T14, h T15, i T16, j T17

5 Optimization of cloud resource allocation using GACO

In this section proposed GACO has been applied to optimize the cloud resource allocation problem. The main motivation of doing this is that GACO provides best solution in larger search space as compare to competitors. The cloud resource allocation problem has been mathematically formulated which is based on biding concepts [8]. The main objective of this resource allocation process is the Quality of Service (QoS) constraints must be satisfied and maximized the service provider profit. The sole motivation behind this formulation is to reduced the unnecessary SLA violations penalty cost.

We assume cloud provider offers \(\mathrm {VM=}\left\{ {\mathrm {vm}}_{\mathrm {1}},{\mathrm {vm}}_{\mathrm {2}}\ldots {\mathrm {vm}}_{\mathrm {t}}\right\} \) computing services to user on t different types of Virtual Machines (VMs). The number of existing identical service capacity of a type \({\mathrm {vm}}_{\mathrm {k}=\{1, 2, 3,\ldots {\mathrm {t}}\}}\) is \({\mathrm {W}}_{\mathrm {k}}\). We consider that \({\mathrm {W}}_{\mathrm {t}}\) is maximum number of VM instances provisioned by cloud-bid provider. Let, \({\mathrm {Z}=\{\mathrm {z}}_{\mathrm {1}}, {\mathrm {z}}_{\mathrm {2}}, \mathrm {\ldots } \,{\mathrm {z}}_{\mathrm {i}}\}\) be the set of cloud-bid providers. \({\mathrm {A}_{i}=\{\mathrm {a}}_{\mathrm {1}}, {\mathrm {a}}_{2}, \mathrm {\ldots }\, {\mathrm {a}}_{\mathrm {i}}\}\) is a set of bids submitted by cloud-bid provider \({\mathrm {z}}_{\mathrm {i}}\). So \(\hbox {A}_{1}\) is the set of bids submitted by cloud-bid provider \(\hbox {z}_{1}\). Each bid define in pairs as \({\mathrm {a}}_{\mathrm {i}}=\left( {\mathrm {R}}_{\mathrm {i}},{\mathrm {c}}_{\mathrm {i}}\right) \), where, R is the requested VM resources set and c is the cost of respective bid. The requested VM set further divided in different pairs of individual resource (r) and their unit (u) as shown in Fig. 6. It is defined as:

$$\begin{aligned} {\mathrm {R}}^{\mathrm {i}}_{\left\{ \mathrm {1,\ 2,\ldots n}\right\} }\mathrm {=}\left\{ \left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {1}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {1}}\right) \mathrm {,\ }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {2}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {2}}\right) ,\mathrm {\ldots }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \right\} \end{aligned}$$

The satisfaction levels conditionally define as:

$$\begin{aligned} {\mathrm {R}}^{\mathrm {i}}_{\left\{ \mathrm {1,\ 2,\ldots ,n}\right\} }=\left\{ \begin{array}{l} \left\{ \left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {1}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {1}}\right) \mathrm {\cap }\mathrm {\ }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {2}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {2}}\right) \mathrm {\cap }\mathrm {\ldots }\mathrm {\cap }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \right\} \mathrm {\ne }\,\mathrm {\emptyset }\mathrm {,\ \ \ \ \ satisfiable\ for\ \forall } {\mathrm {R}}_{\mathrm {i}} \\ \left\{ \left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {1}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {1}}\right) \mathrm {\cup }\mathrm {\ }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {2}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {2}}\right) \mathrm {\cup }\mathrm {\ldots }\mathrm {\cup }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \right\} \mathrm {\ne }\,\mathrm {\emptyset }\mathrm {,\ \ \ \ \ \ satisfiable\ for\ any\ }{\mathrm {R}}_{\mathrm {i\ }}\end{array} \right. \end{aligned}$$
Fig. 6
figure 6

Sample bid format

The set \({\mathrm {P}=\{\mathrm {p}}_{\mathrm {1}}\mathrm {,\ \ }{\mathrm {p}}_{\mathrm {2}}\mathrm {,\ \ \ldots .}\,{\mathrm {p}}_{\mathrm {t}}\}\) specify the SLA violation penalty cost to be determined for each VM. The problem is formulated using linear programming with the help of three optimization variables. For description of variable refer Table 7.

The problem formulation as follows:

$$\begin{aligned} \mathrm {MAX}\sum _{{\mathrm {a}}_{\mathrm {i}}\mathrm {\in }\mathrm {A}}{{\mathrm {c}}_{\mathrm {i}}{\alpha }_{\mathrm {i}}}\mathrm {-}\sum _{{\mathrm {a}}_{\mathrm {j}}\mathrm {\in }\mathrm {A}}{{\mathrm {p}}_{\mathrm {j}}{\mathrm {\gamma }}_{\mathrm {j}}} \end{aligned}$$
(6)

Subject to

$$\begin{aligned}&\sum _{{\mathrm {a}}_{\mathrm {i}}\mathrm {\in }\mathrm {A\ }\mathrm {\wedge }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \mathrm {\in }{\mathrm {R}}^{\mathrm {i}}_{\left\{ \mathrm {1,\ 2,\ldots n}\right\} }}{{\beta }^{\mathrm {j}}_{\mathrm {i,n}}\mathrm {+\ }{\mathrm {\gamma }}_{\mathrm {j}} = {\mathrm {W}}_{\mathrm {j}}\mathrm {\ \ \ \ }\left( {\mathrm {vm}}_{\mathrm {j}}\mathrm {\in }\mathrm {VM}\right) } \end{aligned}$$
(7)
$$\begin{aligned}&\sum _{{\mathrm {vm}}_{\mathrm {j}}\mathrm {\in }\mathrm {VM}}{{\beta }^{\mathrm {j}}_{\mathrm {i,n}}\mathrm {-}{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}{\alpha }_{\mathrm {i}}=\mathrm {0\ \ \ \ \ \ \ }\left( {\mathrm {a}}_{\mathrm {i}}\mathrm {\in }\mathrm {A\ }\mathrm {\wedge }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \mathrm {\in }{\mathrm {R}}^{\mathrm {i}}_{\left\{ \mathrm {1,\ 2,\ldots n}\right\} }\right) } \end{aligned}$$
(8)
$$\begin{aligned}&{\beta }^{\mathrm {j}}_{\mathrm {i}\mathrm {,n}}=\mathrm {0\ \ \ \ }\left( \left[ {\mathrm {a}}_{\mathrm {i}}\mathrm {\in }\mathrm {A\ }\mathrm {\wedge }\left( {\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}},{\mathrm {u}}^{\mathrm {i}}_{\mathrm {n}}\right) \mathrm {\in }{\mathrm {R}}^{\mathrm {i}}_{\left\{ \mathrm {1,\ 2, \ldots n}\right\} }\right] \mathrm {\wedge }{\mathrm {\ [vm}}_{\mathrm {j}}\mathrm {\in }\mathrm {VM]\ }\mathrm {\wedge }{\mathrm {\ [vm}}_{\mathrm {j}}\mathrm {\notin }{\mathrm {r}}^{\mathrm {i}}_{\mathrm {n}}\mathrm {]}\right) \mathrm {\ \ } \end{aligned}$$
(9)
$$\begin{aligned}&{\alpha }_{\mathrm {i}}=\left\{ \mathrm {0,\ 1}\right\} \end{aligned}$$
(10)
$$\begin{aligned}&{\beta }^{\mathrm {j}}_{\mathrm {i,n}},{\mathrm {\gamma }}_{\mathrm {j}}\mathrm {\in }{\mathbb {Z}}^{\mathrm {+}}\mathrm {\ } \end{aligned}$$
(11)

The objective of above formulation maximizes the profit if we are considering SLA violation cost along with unallocated resources. The Eq. 6 is an objective line that maximizes the total profit if it is considering the cost of SLA violation along with underutilized resources. Equation 7 identifies the total number of allocated VM instances of each \(vm_{j}\) type which never exceed the number of available instances. Equation 8 recognizes the successful bids for each pair of resource type. Equation 9 inhibits all underutilized resources to be assigned to particular bid.

We have considered all constraints and implemented above resource allocation optimization problem using MATLAB. Here, we have defined set of all the possible bids orderings as search spaces that will be used by all meta-heuristic algorithms. Each bid will be converted to a solution and checked it will feasible or not. As per bid policy there must be at least one ordering that reflects the optimal solution. The proposed GACO algorithm has been executed 100 times and the comparative statistics of proposed GACO for resource allocation in unidentified search spaces are reported in Table 8. Figure 7 shows the comparative best solution with other algorithms. Moreover, the results of the resource allocation problems in cloud computing showed the better performance in unidentified search spaces. The results of this problem are improved as compared to existing techniques.

Table 7 Description of optimization variables
Table 8 Comparison of proposed GACO statistical for resource allocation
Fig. 7
figure 7

Comparative best solutions with other algorithms

6 Conclusion

In this paper a swarm-based optimization algorithm inspired by ants forging behavior has been proposed. The algorithm is named as Generalized Ant Colony Optimizer (GACO). The algorithms demonstrated in this paper are implemented in MATLAB R2017b version and executed on MS Windows 7. The performance of GACO algorithm is measured on 17 benchmark test functions and compared with three well-known algorithms naming PSO, GA, and ABC. The test results of the proposed GACO algorithm are better as compared to other algorithms. Future scopes of GACO algorithm in the cloud computing include efficient resource allocation and load balancing. This algorithm can also be extended for multi-objective optimization problems.