An Improved Ant Colony Optimization Algorithm: A Technique for Extending Wireless Sensor Networks Lifetime Utilization

Wireless sensor networks (WSNs) are one of the most essential technologies in the 21st century due to their increase in various application areas and can be deployed in areas where cable and power supply are difficult to use. However, sensor nodes that form these networks are energyconstrained because they are powered by non-rechargeable small batteries. Thus, it is imperative to design a routing protocol that is energy efficient and reliable to extend network lifetime utilization. In this article, we propose an improved ant colony optimization algorithm: a technique for extending wireless sensor networks lifetime utilization called AMACO. We present a new clustering method to avoid the overhead that is usually involved during the election of cluster heads in the previous approaches and energy holes within the network. Moreover, fog computing is integrated into the scheme due to its ability to optimize the limited power source of WSNs and to scale up to the requirements of the Internet of Things applications. All the data packets received by the fog nodes are transmitted to the cloud for further analysis and storage. An improved ant colony optimization (ACO) algorithm is used to construct optimal paths between the cluster heads and fog nodes for a reliable end-to-end data packets delivery. The simulation results show that the network lifetime in AMACO increased by 22.0%, 30.7%, and 32.0% in comparison with EBAR, IACO-MS, and RRDLA before the first node dies (FND) respectively. It increased by 15.2%, 18.4%, and 33.5% in comparison with EBAR, IACO-MS, and RRDLA before half nodes die (HND) respectively. Finally, it increased by 28.2%, 24.9%, and 58.9% in comparison with EBAR, IACO-MS, and RRDLA before the last node dies (LND) respectively. Keywords—Sensor nodes; advanced nodes; fog nodes; data centre; cloud computing; ant colony optimization; visual sensor networks


I. INTRODUCTION
Wireless sensor networks (WSNs) are one of the new technologies of the 21st century. A WSN is a group of spatially dispersed sensor nodes, which are interconnected through wireless communication. Sensor nodes jointly measure environmental conditions in an area of interest [1]. Recent improvements in wireless communication and camera sensors technologies have brought about the design of a new kind of sensor networks called "visual sensor networks VSNs". These networks can provide multi-perspective visual data which may be highly valuable for many types of monitoring applications. Although, VSNs developed from WSNs; they have extended the range of WSNs applications in health assistance, vehicular networks, Internet of Things, detection and prediction of natural calamities, smart cities, industrial, video surveillance for security systems such as pipeline monitoring, home automation, immersive entertainment oil, gas exploration, and real-time crop monitoring [2][3]. Conversely, in contrast to conventional WSNs, VSNs require more energy consumption, high bandwidth, high packet loss rate, and more processing capability to process sensed data and deliver them to a base station. Sensor nodes are usually deployed on large-scale in the area of interest and generate large volumes of data. However, they have many challenges in terms of data reliability and communication due to the limited capabilities of the individual nodes. It is expected that sensed data generated by the nodes are reliably delivered at the destination node for processing and storage. Sensor nodes are expected to remain functional for a longer period while providing a continuous stream of image data. These nodes are powered by small batteries and their life is dependent on the amount of initial power loaded onto the batteries and to the way they are dissipated during network operation. A sensor node dissipates energy during data acquisition, formatting, pre-processing, and data forwarding [4]. Thus, data transmission is the main energy consumption of a sensor node [5]. Therefore, there is a need to minimize sensor nodes' energy consumption to extend the network lifetime.

A. The Significance of the Routing Protocol for Wireless Sensor Networks
The nodes relay their sensed data towards the base station through their neighbouring nodes [6]. Data routing in WSNs is very important unlike transitional networks based on the following features [7][8]: • The ability of the WSNs to quickly adjust itself to change in the topology is considered its responsiveness.
• Each sensor node transmits data to its neighbouring node.
Designing an efficient, trustworthy routing protocol, and provisioning quality of service (QoS) for data routing in WSNs is a challenging task due to resource-constraints of sensor nodes, dynamic nature of the networks, and mode of the transmission medium. Several approaches have been proposed in the literature based on data routing to meet the QoS requirements [9][10]. Most of the proposed routing protocols for WSNs are based on the single-path routing algorithm, where each source node transmits its sensed data to the base station through a single path. Although, single-path routing approach is simple because it can be implemented with minimum computational complexity and scalability but there is no adequate consideration of traffic load-balance or reliability along the selected paths [11][12]. It is simple because paths between source nodes and the base station can be constructed in a short time. Similarly, it is scalable because as the number of sensor nodes becomes large, the method and complexity to create paths between the source nodes and the base station do not change [13].
Conversely, a multi-path routing protocol transmits copies of the sensed data to the base station through different paths. This addresses the throughput, load balancing, reliability, and security challenges of the single-path routing protocol [11,14]. In the event of the main path being unavailable due to the low energy of individual sensor nodes or congestion, other less congested paths of the network will be used for data transmission. This increases the throughput of a network by transmitting sensed data in parallel through many paths and delivering the entire data at the destination with the expectation of achieving high throughput, reliability, and low data packets loss rate [10]. Many multipath routing protocols have been developed in the literature to ensure load balancing, congestion avoidance, fault-tolerance, and QoS [11,[15][16].
Braided multipath routing techniques have been proposed to relax the requirement for node disjointedness with the expectation of addressing the energy issues of node disjoint paths [17]. This scheme creates a backup node for every sensor node on the primary path. If a node in the main route fails, the backup node is used to connect other nodes. However, this routing protocol still builds around reliability requirements only, disregarding the throughput maximization and energy efficiency. Therefore, to achieve reliable wireless communications in WSNs, there is a need to have a reliable routing protocol.
Continuous developments in wireless communication and the Internet of Things (IoT) technologies have enabled WSNs to transmit raw sensed data to the cloud for processing, analysis, and storage. Cloud computing is considered as a promising solution to provide applications with elastic resources and deliver services to end-users at a low cost. However, cloud computing has its drawbacks and cannot solve all WSNs routing challenges [18].
Moreover, if sensor nodes are to transmit directly to the cloud, the process will need a high bandwidth network and quickly dissipates sensor nodes' energy [19]. Some applications such as real-time streaming, health care data, realtime gaming, and augmented reality are too latency-sensitive to be deployed directly to the cloud. Similarly, in large scale sensor networks, sensor nodes have to constantly sense and transmit a huge amount of data. The processing of such data needs extra efforts and time, which dissipates more energy from the sensor nodes. In addition, sensor nodes are resourceconstrained, they can neither perform complex analytical computations nor machine learning tasks. Therefore, instead of sensor nodes to transmit directly to the cloud, a new technology called fog computing can be deployed at the edge of the network to provide cloud services closer in a sense [20][21]. The main aim of integrating fog into the WSNs is to improve their reliability and minimize the redundancies associated with data transmission to the cloud for processing.
Fog computing is composed of networking devices such as gateways, routers, proxy servers, set-top boxes. These devices store frequently used the information to provide the services to edge users [22]. They have higher processing capability and storage than typical sensor nodes. The devices can be placed between WSNs and cloud computing to receive, process, and temporarily store the sensed data. This technique will greatly conserve sensor nodes' energy consumption because the nodes will only need to transmit through a short distance. It can efficiently reduce the amount of bandwidth that is required due to its ability to minimize the needed back and forth communication with the cloud and the various sensors [23]. The term "fog computing" was developed by Cisco to overcome limitations in cloud computing [24][25]. It consists of fog nodes (FNs) which provide resources at the edge of the network. They play an important role in the overall working of fog computing as they aggregate the data from source nodes for processing. They act as decentralized local access, thus reducing the dependency on the cloud platform for analyzing the sensed data. This new technology offers several benefits to end users including efficient network bandwidth usage, data security, fewer bottlenecks, the solving of high latency on the network, increased reliability of transmitted sensed data, and a higher speed of analysis [26]. Fogging can effectively string everything together without reducing the overall performance of the processes or devices. Leveraging the advantages of this new technology, we integrate fog computing into the proposed scheme to address some of the constraints of WSNs.
Sensor nodes are resource-constrained in terms of power and communication bandwidth [27]. As a consequence, reducing the energy dissipation of an individual sensor node is a critical issue for WSNs. Ant colony optimization (ACO) algorithm has been applied in WSNs to find optimal paths to save energy consumption during transmission. However, the algorithm is prone to converge at local optima. Therefore, we propose an improved ACO algorithm that can be applied to construct the optimal paths between layer 1 and layer 2 of the proposed scheme architecture in Fig. 1 for efficient and reliable data transfer. ACO is developed by Dorigo [28]. The idea is based on the natural behaviour of real ants in their colonies and to emulate the cooperative behaviour of an ant colony, which discovers the shortest path to a food source. The behaviour of real ants and sensor nodes share similar attributes. Thus, the algorithm has been applied to solve many routing problems in WSNs [29][30][31].

B. Contributions
This research investigates existing routing protocols for WSNs in terms of their reliable performance and proposes a new routing protocol. In this paper, we present an energyefficient routing scheme combined with clustering and fog nodes technology. We develop a model to partition the network into different clusters. An algorithm is designed to distribute evenly advanced nodes within the network and assign only one advanced node (cluster head) to each cluster. We developed a model based on the distance and the residual energy of a node to associate it to a cluster head, this enables the nodes to communicate with their associated cluster head using a single or multi-hop communication following the optimal energy consumption. An improved ACO algorithm is designed to construct optimal and efficient paths between the cluster heads and the fog nodes to minimize the total number of broadcast transmission between layer 1 and layer 2 of the proposed architecture. Thus extending the life cycle of the WSNs, and effectively improving network congestion and minimizing the average delay. Finally, through numerous performance comparisons, we show the effectiveness of our approach for the proposed routing in WSNs.
The rest of the paper is organized as follows: Section II presents some related work. Section III presents the assumptions and system models. The proposed scheme is presented in Section IV. Section V presents the analysis and simulation results for different scenarios. Lastly, the conclusion and our future research directions are presented in Section VI.

II. RELATED WORK
In recent years, many routing techniques have been proposed to minimize energy consumption in WSNs. Multipath routing techniques are one of the most prominent and efficient routing schemes developed for WSNs. By leveraging the many routing paths, multipath routing can improve the reliability for end-to-end data transmission, minimize energy consumption and transmission delay. The following are some of the multipath routing protocols that have been proposed for WSNs.
Radi et al. [32] proposed an interference-minimized multipath routing protocol for WSNs. The scheme aims to discover a sufficient number of minimum interfering paths with high QoS between source nodes and base stations. The approach consists of three phases: i) initialization phase; ii) path establishment phase; iii) data packet transmission phase. These phases control the traffic rate of each constructed path. Performance evaluations of the proposed method show improvements in terms of packet reception ratio, packet delivery latency, and energy consumption.
However, the authors did not explain in detail how the clusters are formed. They only use an assumption for the formation of the clusters.
Deepa and Suguna [33] proposed Optimized QoS-based Clustering with Multipath Routing Protocol (OQoS-CMRP) for WSNs. The authors applied improved particle swarm optimization (PSO)-based clustering algorithm to form clusters within the network. Also, they used the Single Sink-All Destination algorithm to determine near-optimal multi-hop routing path from the sink to sensor nodes in order to choose the next-hop neighbour nodes and Round-robin Paths Selection algorithm is used for sending sensed data to the sink. Performance evaluations of the proposed scheme show that it performs better in terms of energy conservation, transmission delay, and communication overhead than selected related algorithms.
But, in this approach, a lot of energy get consumed because re-clustering and re-routing happen every time, when residual energy of a node goes below a particular threshold.
Sharma and Jena [34] suggested a cluster-based multipath routing protocol for WSNs (CMRP), which uses both the multipath and clustering methods to decrease the energy consumption of the sensor nodes and increase data packets reliability. The idea centres on the reduction of individual sensor nodes load by assigning more responsibility to the destination node. The performance evaluations show that CMRP is more energy-efficient and reliable compared to existing protocols.
However, the clustering scheme in the approach is not scalable enough to facilitate cluster maintenance, therefore it can result in domino effects.
Gupta and Jha [35] proposed integrated clustering and routing protocol for WSNs using an improved cuckoo and harmony search based metaheuristic techniques. The approach uses a novel multi-objective function for uniform distribution of cluster head nodes and a modified harmony search based routing protocol is used for routing of a data packet from cluster heads to the sink node. The performance of the proposed protocol is evaluated using metrics such as average energy consumption, number of dead nodes, number of alive nodes, and network lifetime. The evaluation results show significant improvement over the state-of-art protocols.
However, the authors failed to explain how the clusters are formed and cluster heads selected. There is a high possibility 427 | P a g e www.ijacsa.thesai.org that cluster heads are selected from one side of the network and thus results in energy holes.
An energy-efficient algorithm for reliable routing of WSNs based on distributed learning automaton (RRDLA) algorithm is proposed in [11]. The author models the scheme as a multi-constrained optimal path problem. The scheme exploits the features of distributed learning automaton (DLA) to determine the smallest number of sensor nodes to maintain the desired QoS requirements. The scheme considered many QoS routing metrics which include end-to-end reliability, throughput, and delay to select an optimal path in the network. The evaluation results show that the proposed scheme performs better than related proposed algorithms in terms of energy efficiency, throughput, and end-to-end delay.
An improved ant colony optimization-based approach with a mobile sink (IACO-MS) is proposed to solve the energy hole problem in WSNs [36]. The approach divided the network into different clusters and each cluster has only one cluster head (CH). The conventional ACO algorithms construct paths between the CHs while the mobile sink node finds an optimal mobility path to communicate with CHs under the improved ACO algorithm. The authors claimed that the sink mobility approach can be used to solve many routing problems in WSNs such as hot spots problem, reduction in energy consumption of the whole network, and improve the network in terms of transmission latency and network throughput compared to conventional routing algorithms.
However, the approach is compared with only one approach and it may not be efficient if it is compared with two or three existing approaches.
Krishnan et al. [37] stated that existing clustering with static sink approaches for WSNs creates an energy hole problem and untimely death of sensor nodes leads to data packets loss. The authors proposed a novel dynamic clustering approach with PSO-based mobile data collectors for information gathering to solve these problems. The performance evaluations show that the proposed scheme performs better in terms of reducing energy consumption for sensor nodes, improving throughput, and extending the network lifetime compared with the existing schemes.
However, this approach is only implemented on a small number of sensor nodes. It may not be energy-efficient if the network size is large.
Arjunan and Sujatha [38] proposed a lifetime maximization of WSNs using fuzzy-based unequal clustering and ACO based routing hybrid protocol. The protocol consists of three phases: CH phase, inter-cluster routing phase, and cluster maintenance phase, and it aims to eliminate hot spot problems and prolong the network lifetime. The Fuzzy logic part of the approach chooses CHs efficiently and splits the network into different clusters based on the distance to its neighbouring nodes, residual energy, node degree, node centrality, and distance to the base station (BS). Thereafter, it uses the ACO algorithm based on a hybrid routing protocol to construct optimal paths between the CHs and BS. The authors employed a threshold concept to transmit or intimate sudden changes in the environment in addition to periodic data transmission. Finally, the cluster maintenance phase is used to uniformly distribute the traffic load. The performance evaluation results show that the scheme solves hot spot problems, efficiently balances the energy consumption among all sensor nodes, and prolongs network lifetime.
However, this approach requires a significant amount of overhead energy.
Li et al. [39] proposed an energy-efficient load balancing ant-based routing algorithm (EBAR) for WSNs. The approach adopted the following methods -a pseudo-random path discovery algorithm and an improved pheromone trail algorithm. The pseudo-random path discovery algorithm based on a greedy algorithm is used to optimize the route establishment and the pheromone trail is used to balance the energy consumption of the sensor nodes. The proposed scheme exploits an energy-based opportunistic broadcast scheme to minimize the energy consumption of sensor nodes caused by the control overhead. The authors used metrics such as energy efficiency, energy consumption, and predicted network lifetime to evaluate the proposed scheme. The performance results show that EBAR performs better compared to selected related work.
However, the approach is based on static network and cannot be applied in a scenario with multiple base stations.

III. ASSUMPTIONS AND SYSTEM MODELS
In this section, we present the assumptions and system models for the proposed scheme in detail.

A. Assumptions
• The initial energy of all sensor nodes is equal.
• Each sensor node in the network is both a transmitting node and a source node.
• Data centres in cloud computing are final destinations for sensed data.
• The network topology is static after the nodes have been deployed in the network area.
• Data centres power sources are unlimited.
• The coordinates of the sensor nodes are known.
• The medium access control (MAC) layer provides the facility to determine link quality such as the packet reception ratio (PRR).
• Every node knows the PRR of its neighbouring nodes.

B. Network Model
In this paper, N sensor nodes are randomly distributed in a M x M network area as shown in Fig. 2. All sensor nodes deployed in a target area can be represented as a set of nodes { 1 , … , }, where denotes node for all = 1,2, … . . , . Every node has a sensing range ( ) that allows it to monitor the events in the area of deployment and a transmission range ( ) which allows it to communicate with other nodes within the network such that the nodes , ∊ , and ≠ . MAC sub-layer is part of the Data Link layer in WSN's protocol stack. The energy consumption of sensor nodes is greatly affected by the MAC protocol which controls the node radio functionalities [40]. The reliability of links quality is obtained using the PRR.
We model the routing problem a s an undirected graph = ( , ), where is a set of sensor nodes and denotes the set of two-way edges that link two sensor nodes such that each link is contained in for all , ∊ .
We assume that nodes a n d can communicate with each other if and only if the distance between them is less than or equal to the sensor node transmission range. The Euclidean distance , = between two nodes is expressed as follows.
Node is a neighbour of node if it can be expressed as follows = � such that ( , ) ∈ , ≤ � (2)

C. Energy Model
Each sensor node in a WSN has a radio communication subsystem consisting of transmitter/receiver electronics, antennae, and an amplifier [40]. We adopt the radio energy model presented in [41]. The energy of the transmitter can be determined by these equations based on their transmission distance with a neighbouring node or a cluster head. We assumed two models as shown in Equation (3) for data packets transmission. A free space model is used if the distance between two communicating nodes is less than a threshold distance value 0 , otherwise, a multi-path fading model is used to compute the energy consumption of the node. The models are presented as follows.
and the energy consumed by a node to receive a − of sensed data from a node is expressed as follows.
where is the electronic energy that depends on factors such as the spreading of the signal, modulation, and digital coding. Friss free space is denoted as and denotes multi-path fading which depends on the transmitter amplifier model, is the distance between the nodes.
The threshold distance value 0 is determined as follows.

D. Sensor Node Coverage Area
A sensor node can only sense the environment and perceive the event if and only if the event is within its transmission range as shown in Fig. 3. A target node is said to be covered if it is contained in the sensing area ( ) of a sensor node. The network area is partitioned into 25 grids and is an area of a circle = ᴨ 2 . The probability of target ( ) detection in a grid of the network area is expressed as = 2 . Thus, the probability ( ) for detecting a target by at least a sensor node in the network area is expressed as follows.
where denotes an average transmission range of a sensor node, denotes maximum transmission range of a sensor node, and is a small increment in .
The probability that a sensor node senses an event within its transmission range can be expressed as: where connotes a zero-mean, Gaussian random variable (measured in decibels) with standard deviation σ (in decibels), is a random variable that connotes Rayleigh fading to model the multiple path effects in propagation path and denotes path loss exponent [42]. Thus, ( ) can be expressed as follows.
Applying the numerical integration of the Gauss-Laguerre ∫ − ∞ 0 ( ) , the detection probability can be expressed as: Thus, the probability that a sensor node detects a target node placed at a particular point of the network area 2 denoted as can be expressed as: Substituting (10) into (11), the probability that a sensor node sensed a target in the specified area of the network can be expressed as follows.

E. Coverage Rate Computation
A target node B at point � , � is within the transmission radius of the node , if its sensing rate ( , B) is within the coverage of as: where ( , B) denotes the distance between the target node and node . The probability that the target node can be covered by nodes in is presented as follows.
Thus, the coverage rate ( ) of the target area can be computed as follows.
IV. OUR PROPOSED AMACO SCHEME The architecture of the proposed scheme is composed of three layers: Layer 1-WSNs, layer 2-fog nodes, and layer 3remote cloud storage as shown in Fig. 1.

Layer 1-WSNs:
This layer consists of various types of sensor nodes connected through wireless technologies and are randomly distributed in the network area. The layer consists of two types of nodes: normal sensor nodes (N S ) and advanced nodes (N A ). These nodes are given specific responsibility to perform within the network. Each sensor node monitors its area, obtain sensed data, and transmits it to a neighbouring node so as to achieve a global detection objective.
Advanced nodes are included in the architecture to avoid overhead during cluster formation and support various types of nodes for improving routing capability. The advanced nodes are responsible to receive, aggregate, and retransmit sensed data received from the normal sensor nodes. They have more processing power and energy source than normal sensor nodes.
Layer 2-Fog computing: Layer 2 consists of fog nodes with high computing, storage, and network connectivity. They receive data from advanced nodes, aggregate, analyse the data so that only the essential data gets forwarded further to the cloud, and decreases the bandwidth used [43]. Besides, sensitive data can be processed at these fog nodes.

Layer 3-Cloud computing:
This is the uppermost part of our architecture. Pre-processed data is transmitted from fog nodes to the cloud for extensive processing and analysis using cloud computing platforms and storage is done in data centres. The cloud can process and store a large amount of data being transmitted from the lower layers. Many security issues such as data integrity, data authentication, privacy are addressed at this layer [44].

A. Clustering
Wireless sensors networks are usually composed of a large number of low-cost sensor nodes connected through a wireless network that sense data to be relayed to the data centres through multi-hop wireless transmission. Many methods have been proposed in the literature to reduce the traffic into the network. Clustering algorithms have been used to minimize communication distance among the nodes to conserve their limited energy. It involves dividing the network into different groups (clusters) and select a node as the group leader (cluster head) for each cluster in the network.
Our main aim for clustering is to minimize each sensor node transmission distance to save its energy. In addition, it eliminates energy holes problems within the network.

B. Setup Phase
During the setup phase, sensor nodes are randomly distributed into the network area as shown in Fig. 2. Each node exchanges its information with neighbouring nodes. Unlike in previous approaches, in which normal nodes are selected as CHs using various algorithms. In our scheme, advanced nodes (NA) are added to the network and they automatically become cluster heads (CHs) due to their higher specifications in terms of energy source, transmission range, and computational power than normal nodes. Algorithm 1 is used to evenly distribute the NA and the desired number A_N represented as K of NA in the network is determined as follows.
430 | P a g e www.ijacsa.thesai.org where is the percentage of N A and is the number of sensor nodes.

C. Intra-Cluster Communication
Now the advanced nodes (CHs) have been distributed evenly within the network, next we divide the network into different clusters. We assume that the number of advanced nodes is equal to the number of clusters. Long-distance transmission usually dissipates the energy of a sensor node and shortens the network lifetime. Thus, a node determines the cluster it is to join by selecting a CH that is within its radio transmission range in which the received signal strength (RSS) is strongest. A Boolean variable is used to denote whether a node is belongs to to form a cluster as follows.
where N denotes the number of nodes and is the number of advanced nodes. In the proposed scheme, energy consumption for a sensor node to transmit to its associated advanced node N A j is calculated as follows.
Moreover, if a node is far from its leader, it will transmit to the CH through a neighbouring node . The energy consumption for data transmission can be expressed as follows.

D. Average Packet Delay
The average packet delay ( ) is the average interval between data packets transmitted at the source node and delivered at the destination node o r N A j for a given period of data transmission and expressed as follows.
where is the time it takes data packets to arrive at the next node media access control (MAC) layer and . is the time it takes the data packets to be delivered at the next node MAC sublayer.

E. Data Packets End-to-End Reliability
In the proposed scheme, medium access control (MAC) layer is used to estimate the routing paths quality, that is, the packet reception ratio (PRR), every node knows the PRR of its neighbouring nodes. In a multi-path transmission, the probability of successful data packets delivery (DPD) to the CH through m-hop of a path between two neighbouring nodes can be expressed as follows.
where denotes the data packets delivery ratio. Based on the value of PDR and the number of data packets transmitted , we can compute the number of data packets successfully delivered to the CH as follows.

F. Improved ACO Algorithm
In this section, we use an improved ACO algorithm to construct an efficient and reliable path for inter-cluster communication between the advanced nodes in layer 1 and fog nodes in layer 2 of the proposed architecture.
Both advanced nodes and fog communicate through wireless medium and many routing paths exist between these nodes but not all are efficient and reliable for data packet transmission. Therefore, it is necessary to construct efficient and reliable paths through which the advanced nodes would transmit their aggregated data to the fog nodes for processing and temporary storage. Algorithm 2 is developed to construct optimal and reliable paths for data transmission between the advanced node and fog node . ACO algorithm has been used in WSNs to construct shortest paths, thus save energy consumption in the network. However, this algorithm converges slowly and leads to local optima.
ACO is a branch of optimization modelled algorithms based on the behaviour of real ants in a colony and is a subclass of computational intelligence (IC) paradigms that aid in determining optimal solutions to optimization problems [30]. 431 | P a g e www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 8, 2020 The idea comes from the foraging behaviour of ants in their colony when searching for food. They first randomly explore the surrounding area and deposit a chemical substance called pheromone on their paths as they search for food, forming pheromone trails. The pheromone trails can be sensed by other ants in the colony and enhance the pheromone deposited on the paths. They tend to choose a path marked by strong concentrations of pheromone. This traditional ACO algorithm does not distinguish between the different types of data packets transmitted over the network. All data packets are sent in the same way to a destination; this algorithm is mainly designed to find the shortest path between the source nodes and destination node. On the other hand, WSNs in the IoT environment has to support multimedia data transmission, requiring a different level of quality of service (QoS). This work provides three different QoSs.
Guaranteed service ( _1 ): _1 provides safe end-to-end delay guarantees. It guarantees that data packets will reach the destination node at the right time with zero data packets loss.

Control load-balance service ( 2 ) :
_2 service is applied where there is a possibility that delay will happen and when there is congestion in the network, the _2 can provide a service just as if there was no congestion in the network.
Best-effort service ( _3 ): This an Internet delivery service where the network does not provide any guarantees on the time delay limit the data packets will be delivered in the network.

If a link
∈ denotes a single hop between a source (an advanced) node and destination (fog) node, then the multihop, ℎ , is the sum of the hops the nodes and expressed as follows.
Equation (23) shows that the fewer ℎ , the nearer it is to the fog node. ( , ) is used to represent the relationship between a node ( ) and receiver node ( ) as shown in equation (24).
where ( ) and ( ) denote forward link and reverse link respectively of the node .
It is assumed that the success transmission rates of all the links between the advanced nodes and fog nodes are all 100%. If the data packets transmission success rate is less than 10%, then the advanced node has low communication performance. However, if the data packets transmission rate is more than 90%, then it has high communication performance.

G. Local Pheromone update
Pheromone is very important in the performance of the ACO algorithm. It is used for updating both local and global trails in traditional ACO. It makes the paths visited by ants to depend on the objective value. Modification made to the traditional ACO algorithm is presented as follows. The choice of constructing an optimal path between the source node and the receiver node is made based on the probability decision rule in equation (25).
, ∈ allowed 0, ∉ allowed where _ is the amount of pheromone deposited on the path, _ represents the local heuristic value of the path between the sender node and the receiver node, denotes the QoS type, α and β are control parameters used to regulate the concentration of the pheromone trail and the heuristic value respectively. The ⍴ is a random variable range between 0 and 1 (i.e [0, 1]) and ⍴ (0 ≤ ≤ 1 ) is a given parameter. ∈ allowed for all = 1,2,3, … . , are paths that can be selected by node in the next step.

H. Global Pheromone updating Rule
Once the communication paths between nodes have been constructed by the search ants, equation (22) is used to choose an optimal path.
where � ℎ _ � is the path utility value.
_ is the pheromone increment on the path between the advanced node and fog node . Pheromone is updated between the nodes as follows.
where is an adjustment coefficient, ℎ denotes path length. Equation (24) is a pheromone update rule for the forward ants used to create the paths between the advanced nodes and the fog nodes.

I. Pheromone Deterioration
Advanced nodes will use the optimal paths constructed to transmit their data packets to the fog nodes. However, continuous data packets transmission along the optimal paths will lead to (a) congestion along the paths (b) inability to discover other paths. These two points cannot be overlooked in a dynamic network because (i) an optimal path may become non-optimal if it is congested; (ii) It may also lead to loss of data packets due to network failure or energy holes problem. To overcome these challenges, pheromone control is used as a measure to reduce the impact of earlier experience and encourages the search for alternative paths that were nonoptimal through evaporation. For a constant ⍴ of pheromone deterioration (decay), the pheromone concentration on the path usually varies with time and expressed as follows: where 0 _ denotes the initial pheromone concentration. If ⍴ is much less than 1 (i.e ⍴ ≪ 1) then.
If the time increment is 1, then the evaporation can be approximated as follows.
Thus, the general pheromone update formula can be expressed as: where ⍴ denotes the rate of pheromone evaporation; its value ranges between 0 and 1. The increment To evaluate the performance of the proposed scheme, the AMACO algorithm is compared with three related algorithms namely RRDLA, IACO-MS, and EBAR. The following metrics are used to measure the performance of these algorithms: network lifetime, the sum of energy consumption, the average number of hops, packet delivery ratio, and success rate. Network Simulator-2 (NS-2) is used to perform the experiment and 200 sensor nodes are randomly distributed in a 100 * 100 m 2 network area. We set the initial energy of each sensor node to 0.5J and other relevant parameters are presented in Table I.

A. Network Lifetime
The network lifetime can be defined as: = sum of the initial energy of all the sensor nodes total energy dissipated in one round The proposed scheme is implemented to determine the network lifetime as shown in Fig. 4. The network consists of 200 nodes randomly distributed and 5 advanced nodes are uniformly distributed within the network. The proposed and three other selected schemes were implemented and run for 1200 rounds. All the schemes dissipate their energy slowly as the simulation time increases. The result shows that the proposed, AMACO, has more number of alive nodes than EBAR, IACO-MS, and RRDLA. The first node dies (FND) at 263rd round in RRDLA, at 268th round in IACO-MS, at 302nd round in EBAR, and 387th round in AMACO. Similarly, the last node dies (LND) at 391th, 714 th , 683 th , and 951 th in RRDLA, IACO-MS, EBAR, and AMACO respectively. In all the scenarios, AMACO had the highest number of alive nodes and better performance in the network lifetime compared to RRDLA, IACO-MS, and EBAR. The reason is that during intra-cluster communication, sensor nodes are only responsible for sensing and short distance transmission which conserve their limited energy. Additionally, inter-cluster communication in AMACO only CHs (advanced nodes) communication with fog nodes and transmit through optimal paths.

B. Comparison of the Network Lifetime
The network lifetime is one of the important metrics of WSNs. The energy of a sensor node is mostly consumed on data transmission during network operation. If the limited energy of these nodes is completely exhausted, energy holes will be created and some nodes will not be able to communicate with the destination nodes. This will affect the normal operation of the entire network. We performed various simulations to compare the network lifetime of the four schemes. We varied the number of nodes in the network area from 40, 80, 120, 160, and 200 for each of the algorithms and present the simulation results in Fig. 5. We can see that the AMACO scheme has the longest network lifetime among all the four schemes. The reason is that the AMACO algorithm only chooses nodes in which their energy is above the energy threshold as neighbouring nodes and avoids the low energy nodes in the process of data transmission to the CHs. Thus, the proposed algorithm selects the optimal and efficient paths in the energy-abundant nodes.

C. Sum of Energy Consumption
The sum energy consumption of the sensor network is defined as the total energy consumed by each sensor node of the whole network. The lesser the sum energy consumption of the network, the lesser the routing cost, thus the longer the network lifetime. Fig. 6 presents the sum of the energy consumption against the number of rounds for all the algorithms; the energy of the network increases, with the number of rounds. RRDLA consumes more energy than the other algorithms. The reason is that the scheme adopts a multipath for data transmission and did not consider the residual energy of nodes that are selected as relay nodes. There is a high possibility for the nodes to transmit their data through long-distance either to their neighbouring nodes or CHs and hence more energy will be consumed. Conversely, the sum of energy consumption in AMACO is less than the other three schemes the reason is that the improved ACO algorithm considers the dynamic optimization of the ants while taking into account the load balance characteristics, thus it prevents the intermittent ant diffusion, and conserves the energy consumption of the network, therefore achieving the purpose of prolonging the network lifetime.

D. The Average Number of Hops
We define the average number of hops as the number of links traversed by a data packet in the network. The longer the average number of hops is, the heavier the data packet traffic along the path is. So, there is a positive association between the end-to-end delay and the average number of hops. In Fig. 7, we can see that the performance of RRDLA algorithm is worst, the reason is that the algorithm uses single-hop communication for data packet transmission to the base station. Our proposed AMACO dynamically considers both single-hop and multi-hop communication to transmit data to the fog nodes. Each sensor node uses the energy model presented in Section 3 to transmit data to its associated cluster head.

E. Packet Delivery Ratio
A Packet delivery ratio PDR: It can be measured as the ratio of the total number of data packets delivered to the total number of data packets transmitted from the sender node to the receiver node in the network. PDR of various algorithms is presented in Table II and Fig. 8. We observed that as the number of rounds increases, the PDR decrease linearly, the reason is that sensor nodes dissipate energy slowly as the number of rounds increases. There is a high likelihood of energy holes to be created among the nodes. RRDLA has the least PDR because its approach is similar to LEACH protocol. The method used for CH selection incurs high overhead. Similarly, IACO-MS algorithm is developed in a way that if a sensor node transmits a data packet to the base station, the data pass through all the sensor nodes as it is moving to the base station. Therefore, the overhead in the delivery of the data packet to the base station increase for every sensor node present in the network. AMACO has the highest PDR compared to the three algorithms. The reason is that it avoids overhead that is usually involved during cluster formation and selection of cluster heads in the previous approaches.

F. Success Rate
The average time per iteration of all the schemes and the success rate of searching for the optimal solution in 75 iterations of the four schemes are presented in Table II. AMACO algorithm has a higher data packet delivery rate compared to the other three schemes in computing time. The simulation runs for 75 random topologies to ensure consistency of the results to assess the success rate of searching for the optimal solution of all the schemes. We observe that AMACO has great potential to search for the global optimal solution. Its success rate is more than compared of algorithms. It can reliably and efficiently improve the routing computation and high success rate of searching for the global optimal solution. Thus, it shows that the AMACO algorithm is effective and reliable.

VI. CONCLUSION
Clustering and fog nodes integration technologies are effective techniques to improve the performance of WSNs. In this paper, we presented an improved ant colony optimization routing algorithm to prolong the network lifetime of WSNs. We first partition the entire network area into different clusters. An algorithm is designed to ensure that advanced nodes which are automatically selected as CHs are evenly distributed within the network and assign a CH to a cluster. Each node belongs to a cluster based on its residual energy and distance from the CHs. An improved ACO algorithm is developed to construct an optimal path between the CHs and fog nodes for efficient and reliable data transmission. NS-2 Simulator is used to measure the performance against three related algorithms namely RRDLA, IACO-MS, and EBAR using the following metrics: network lifetime, the sum of energy consumption, the average number of hops, packet delivery ratio, and success rate. The simulation results show that AMACO performs better in terms of energy consumption and data packet delivery than the other three algorithms.  Vol. 11, No. 8, 2020 VII. FUTURE WORK In the future, we intend to implement all the algorithms in a real test-bed using the above metrics.