Introduction

Wireless sensor network (WSN)s functionalities mainly depend on the sensor nodes deployed in the environment. Major applications of WSN include battlefield management and surveillance, disaster management, biomedical applications, industrial automation, security systems, weather sensing and monitoring. Retaining the battery life of nodes becomes the primary goal in obtaining higher lifetime for deployed network since battery replacement in some adverse environment may not be feasible. Providing efficient energy savings in the network is the vital role played when concerned with a reliable network [1,2,3]. Hierarchical networks will assist the network by presenting data to sink with lesser energy usage [4, 5]. This includes the formation of clusters by grouping a similar set of nodes and choosing one representative from each cluster for information exchange called CH. Choosing the optimal CH in the cluster will enhance the aggregation of data more efficiently. Optimal CHs present three main advantages: (i) it avoids redundant data communication, (ii) energy savings is achieved by utilizing only CHs for transmission and (iii) network’s scalability is achieved by maintaining the local route set up by the CH node. The proposed hybrid particle swarm optimization with firefly algorithm (HPSOFA) is a hybrid method combining the methods of firefly algorithm and particle swarm optimization algorithm. HPSOFA is the amalgamation of PSO and FA and it uses the most suitable mechanisms in cluster selection. It avoids energy drain out of ineffective CH and uses a static sink for data collection. The energy savings can be further achieved in HPSOFA by avoiding retransmissions of congestion. It helps the routing in the selection of CH for data aggregation by adapting the most optimum election in the network. Fitness evaluation function and iteration carried out by considering the previously obtained solution in HPSOFA renders efficient routing entities. Further, dynamic source routing (DSR) is modified to reduce the overhead that is offered to the network during control packet exchange at the source. Congestion avoidance by window size adaption is used to reduce the congestion occurrence in the network. The proposed HPSOFA offers higher QoS by reducing the overhead in the network.

Related Work

Tabibi et al. [6] proposed particle swarm optimization-based selection (PSBO) by having a mobile sink organized to visit various rendezvous points of the network to increase network lifetime. Optimal rendezvous points are selected by assigning weights to nodes and evaluating them to obtain the optimal routing path for communication. However, local optima problems still exist that can be reduced by considering the iterative solutions to a given problem. Bayrakh et al. [7] proposed genetic algorithm-based energy-efficient clusters (GABEEC) considering a hierarchical cluster to aggregate and transfer the information. Cluster creation and the authority to function as a CH are dynamically changed to execute in two phases of the proposed algorithm. But this algorithm fails in considering the optimized CH selection to render the most efficient CH of the network.

Leung et al. [8] proposed hybrid monitoring selection schemes based on exploitation and exploration for area head selection. Parito dominance along with density estimation functions are used in updating the information. Further, this work should address real-world optimization problems. Rehman et al. [9] propose a fast convergence scheme based on the multi-cluster hop. The main drawback of traditional PSO is slow convergence and getting trapped into many local problems. In this technique, the most suitable position of the cluster is located for communication and jumping methods are adopted to relocate trapped particles. Extensive computation methods with multi-cluster jumping schemes are adopted to achieve fast convergence. Optimization of twelve benchmark functions is achieved in this method.

Wahid et al., [10] proposed a solution for the optimality problem using an enhanced firefly algorithm. Pattern search is employed in this method to solve the optimization problems. Balancing of exploration and exploitation can be achieved when traditional schemes are avoided. The final stage of the firefly algorithm incorporates pattern search and provides the optimality for the problems. The model proposed here offers fast convergence and has given an optimal solution on eight minimization functions and six maximization functions. Comparison of the proposed method is done with various conventional schemes and proposed scheme outperforms the existing method by providing a faster convergence level. Obtaining the optimized result should also address affecting parameters. Prakash et al. [11] propose higher transient stability achieving methods by combining PSO and fire-fly algorithm. Performance indication of the system such as overshoots and settling times presented better results when compared with conventional methods. Stability achievement is obtained by utilizing Eigenvalues, modes, plot and Nyquist plot. Rejina et al. [12] proposed an effective clustering method by addressing a residual node in the network. Here, gravitational search algorithm is adopted for avoiding residual node formation and cluster assistant (CA) is defined to decrease the burden of CH. Fitness function is used to determine the node quality before adopting it for transmission.

Sahoo et al. [13] have proposed particle swarm optimization-based energy efficient clustering and sink mobility (PSO-ECSM) algorithm for energy-efficient clustering schemes. CH selection in the network is based on the five factors such as distance, node degree, average energy, retained energy of nodes and energy consumption rate. Optimum value is chosen of these five metrics in the proposed scheme. The challenging task of CH’s lower energy level is addressed using optimization techniques. Optimality problem considerations are done for choosing the optimum CH that can satisfy the multiple objectives. Particle swarm optimization-based energy efficient clustering and sink mobility choose fitness function in evaluating various parameters of the network. The method of using PSO for CH selection undergoes the possibility of getting trapped into various local optima. This method does not focus on achieving lower control overhead and falls short in forming effective energy utilized routing scheme.

The proposed HPSOFA method exploits the best possible methods of PSO and firefly algorithms.

Problem Definition

In the existing PSO-ECSM algorithm, the network and transmission parameters are evaluated using PSO algorithm to elect the CH. Few of the challenges by adapting PSO include local optima such as some nodes not getting the chance to function as CH. Control packet overhead is high in the existing PSO-ECSM algorithm since the sender nodes will broadcast it to all its neighbor nodes. The proposed HPSOFA method addresses the above challenges and main objectives of this proposed method are as follows:

  1. (i)

    To decrease the transmission overhead involved in the communication.

  2. (ii)

    To establish optimum hierarchical cluster routing in the network and to achieve improved QoS.

  3. (iii)

    To establish congestion avoidance in the routing.

Hybridization of Firefly Algorithm and the Particle Swarm Optimization Algorithm

Firefly and PSO algorithms are bio-inspired techniques. Firefly algorithm proposed by Xin-She Yang is based on the light intensity attraction of fireflies. Here, attractiveness is directly proportional to the brightness of the light. In the firefly technique, the position of the firefly is also considered in obtaining a solution to the problem. PSO is also an optimization technique developed by Eberhart and Kennedy that considers the social behavior of animals, insects and birds. This method tries to achieve the optimized objective function in a given surrounding. In FA, although there exists no exact solution to a given problem, the most optimal solution is selected from the population during each iteration. However, FA falls short by getting trapped into various local optima issues in the network. The main drawback of FA is, it will not retain the iteration results obtained during the execution of the algorithm. PSO also falls into local optima problems more easily and exhibits less convergence rates. To overcome the major drawbacks of both firefly and PSO, the hybridization technique is adopted in the proposed algorithm. Here, the initial population of firefly is obtained from the PSO optimization result. By executing the hybridization technique, the most optimized CH for monitoring the network is selected. All nodes in a network will get a chance to perform as CH based on the optimality solution.

HPSOFA System Flow

HPSOFA is the amalgamation of PSO and FA and it uses the most suitable mechanisms in cluster  selection. It avoids energy drain out of ineffective CH and uses a static sink for data collection. The energy savings can be further achieved in HPSOFA by avoiding retransmissions of congestion. The proposed HPSOFA collaborates existing PSO and FA algorithms in achieving the most appropriate routing entities. Figure 1 shows the HPSOFA flow model where the optimal routing controlling is achieved by combining PSO and FA algorithms. HPSOFA tries to initiate the local search process effectively by checking the previous global best fitness values. Initiated random values are updated in every repetition and this process continues until the last iteration is achieved in the standard FA algorithm. An initial random value determines the final optimized outcome. The proposed HPSOFA is a hybrid method considering the initial random value from FA and optimized result from the PSO algorithm. The DSR refrains from sharing control overhead packets and avoids sharing the information about cluster creation and CH selection. Our proposed HPSOFA modifies the DSR routing protocol and enables the use of Hello packets. Congestion avoidance is achieved in HPSOFA by the mechanism of window size adjustment. The Q size which determines the count of packet transmission is controlled and congestion avoidance in the packet transmission is achieved.

Fig. 1
figure 1

HPSOFA flow model

Optimality Selection of CH

HPSOFA executes the evaluation of the member nodes in a cluster and selects the optimal CH in the network. Node with the highest retained energy is eligible to perform as CH but the optimality in CH selection is achieved in HPSOFA by performing the fitness evaluation of various parameters to attain the Pareto optimality. Pareto optimality is a condition in which optimal CH selection takes place without compromising with the QoS parameters in the network. Here, a number of iterations are carried out with the considerations of previously obtained results to obtain the best selection of CH.

Fitness function evaluation Fitness function represents a single figure of merit that assists the simulations in achieving the optimal solutions. Here, evaluation of the considered solution of the desired problem is done. Fitness parameter evaluation (FPE) is computed in HPSOFA to achieve optimum CH selection. Retained energy, average energy consumption, sink and node distance, surrounding neighbor node number, energy consumption rate are considered for evaluating the fitness function.

  1. (i)

    FPE of retained energy: After each round of transmission, retained energy for further communication is evaluated using FPE parameter. Since CH’s  selection is on a rotational basis based on the retained energy parameter, the contribution of this FPE is major in selecting the optimum CH. Fitness evaluation for residual energy is represented as

    $${\mathrm{FPE}}_{1}=\frac{1}{{\sum }_{j=1 }^{n}\frac{{E}_{r(j)}}{{E}_{\mathrm{Total}}}},$$
    (1)

    where Er(j) is the residual energy of node jth node, ETotal is the total energy of nodes and n is the total number of nodes.

  2. (ii)

    FPE of average energy consumption: The nodes that are deployed are heterogeneous in nature. Average energy of all the nodes is considered and node with the highest energy will function as CH. Ej represents the energy consumption of the jth node. Fitness evaluation for average energy consumption is represented as

    $${\mathrm{FPE}}_{2}=\frac{1}{n}\sum_{j=1}^{n}{E}_{j}.$$
    (2)
  3. (iii)

    FPE of distance from the sink to node: Energy requirement for the communication is more if the distance of separation from the node to sink is more. So the shortest distance path is opted for the communication. Fitness evaluation for distance from the sink to node is represented as

    $${\mathrm{FPE}}_{3}=\sum_{j=1}^{n}\frac{{D}_{(n-s)}}{{D}_{(avg(n-s))}},$$
    (3)

    where D(n − s) is the distance from the node to sink and D(avg(n − s)) represents the average distance from the node to sink.

  4. (iv)

    FPE of surrounding neighbor node count: When more number of nodes lie at a distance which is far away from the CH, consumption of the energy increases due to intracluster communication. Fitness evaluation for surrounding neighbor node count is represented as

    $${\mathrm{FPE}}_{4}=\left(\frac{\sum_{i=1,j=1}^{n}{D}_{(n(j)-n(i))}}{\stackrel{.}{{n}_{\mathrm{CL}}}}\right),$$
    (4)

    where D(n(j) − n(i)) is the distance from node j to node i and nCL is the cluster number count.

  5. (v)

    FPE of energy consumption rate (ECR): ECR represents the node’s depletion of energy during transmission which is measured by considering the initial energy before transmission and energy retained after one round of transmission. This evaluation is made and FPE-ECR is computed. Fitness evaluation for energy consumption rate is represented as

    $${\mathrm{FPE}}_{5}=\sum_{j=1}^{n}\frac{{E}_{P}-{E}_{C}}{{E}_{P}},$$
    (5)

    where EP and EC represent the previous and current round energy level.

    $$\mathrm{FPE}=\frac{1}{\alpha {\mathrm{FPE}}_{1}+\upbeta {\mathrm{FPE}}_{2}+{\delta \mathrm{FPE}}_{3}+\Psi {\mathrm{FPE}}_{4}+\Phi {\mathrm{FPE}}_{5}},$$
    (6)

    where α, β, δ, \(\Psi\) and Φ are the coefficients corresponding to the FPE and sum of all these coefficients are 1. Figure 2 shows the steps of execution of HPSOFA algorithm. Sensor network consists of heterogeneous node deployment which communicates to the sink using monitoring head (CH). The selection and operation of CH become vital for network performance. PSO and firefly (FF) are adopted and the most optimum CH selection is done. It executes FPE to determine appropriate CH by employing the fitness calculation of various network and transmission parameters. FPE parameter with a minimum value will yield the optimum selection. During routing, modification and updating required during the transmission are achieved by enabling beacons in the DSR protocol. Queuing allocates certain bandwidth for transmission that can control the rate of transmission. The average size of the queue considered for transmission is given by

    $${\text{Avg}}_{q} = \, \left( {1 \, - {\text{ Wq}}} \right){\text{avg}}\_q \, + {\text{WqSq}}{.}$$
    (7)

    Here, Sq is the size of the queue, Wq is the smoothing time constant and has to be calculated after each packet arrival. Exponentially weighted average of the queue length determines the congestion. Whenever there is a possibility of congestion to occur, window size adaptation is done to ensure transmission without congestion. The rate of window size adjustment should be within the minimum and maximum threshold levels. Finally, in data transmission phase, data compression is achieved by encoding the data bits.

Fig. 2
figure 2

HPSOFA flowchart

Simulation Model

The simulation of HPSOFA is performed on NS-2 and QoS parameters are compared with existing methods. Simulation parameters of HPSOFA are shown in Table 1.

Table 1 Simulation parameters of HPSOFA

Results

HPSOFA average energy comparison with existing methods is shown in Fig. 3. Since HPSOFA is able to aggregate the data effectively by employing optimum data aggregation schemes, high-throughput attainment is achieved when compared with existing methods and is shown in Fig. 4.

Fig. 3
figure 3

Average energy consumption over the simulation time

Fig. 4
figure 4

Throughput in Kbps over the simulation time

Control overhead is effective in updating the routing status to the member node in HPSOFA. Existing methods offer challenges while routing via CHs. Data transmission window is adjusted by varying the Q size in HPSOFA which again reduces the overhead of congestion occurrences in the network. Overhead comparison of HPSOFA with PSO-ECSM, PSOBS and GABEEC is shown in Fig. 5.

Fig. 5
figure 5

Transmission overhead over the simulation time

Window size adjustment done by changing the Q size will effectively avoid congestion of packets thereby enhancing packet reception at sink–node. The optimum solution is obtained using the fitness evaluation of parameters and HPSOFA is successful in reaching packets to sink–node. PDR comparison is shown in Fig. 6.

Fig. 6
figure 6

Packet delivery ratio over the simulation time

Comparative analysis of HPSOFA with other existing algorithms: The comparative analysis of the proposed HPSOFA method shown in Table 2 is done with reference to the parameters such as network lifetime, network stability, half node death and throughput. By adapting the optimality schemes and congestion window avoidance mechanisms, HPSOFA provides tremendous improvement when compared with existing algorithms such as PSO-ECSM, PSOBS and GABEEC. Graphical representation of the comparative analysis done for the above proposed and existing algorithms is shown in Fig. 7.

Table 2 Comparison of PSO-ECSM, PSOBS, GABEEC and HPSOFA
Fig. 7
figure 7

Comparative analysis of GABEEC, PSOBS, PSO-ECSM and HPSOFA algorithms with reference to the network parameters

Average energy exhaust rate in the network: Average energy depletes as the simulation time progresses in the network. When chosen CH fails to achieve the threshold value required as per the fitness evaluation function, the role of CH is transferred to the next eligible node in the given cluster.

Table 3 represents the energy exhaust level in the network when 10%, 20% and 30% of the nodes have performed the role of CH in the network. Due to an effective routing mechanism, HPSOFA algorithm achieves higher energy retention in the network.

Table 3 Energy exhaust rate in the network

Conclusions

In this paper, we have proposed HPSOFA, an optimum clustering technique to aggregate the sensed data of deployed nodes in a heterogeneous network. PSO and FA are collaborated to obtain the optimal solution to the routing challenges. Further, by employing the optimality technique, successful routing entities are selected. Congestion occurrence causing packet delivery failure is avoided by packet count variation in the window adjustment method. Enabling the beacons in DSR assists the network in updating the status of routing. Thus, HPSOFA reduces the overhead by 9% when compared with existing PSO-ECSM. It presents higher QoS when compared with existing techniques of PSO-ECSM, PSOBS and GABEEC algorithms.