Skip to main content
. 2021 Dec 30;22(1):251. doi: 10.3390/s22010251
Algorithm 2: ABC Route Optimization
1.   Input: Final Route from S to D and Mobile Sensor Nodes Properties
2.   Output: Optimized Mobile Sensor Nodes Properties
3.  Start Properties Optimization
4.  To optimized the FR, ABC Algorithm is used
5.  Set up basic parameters of ABC: Population of Bee (Pb)—Number of Sensor Nodes
6.   Final Route (FR)—Route from NS to ND
7.   Fitness Function: F(f)={1; if NPROP<ThresholdPROP0; Otherwise
8.   Where NPROP are the properties of the node such as energy consumption, delay, etc.
9.   In the fitness function, NPROP: are properties of current sensor nodes which are in FR and ThresholdPROP is the threshold properties of all communicating sensor nodes which are defined based on energy and distance
10. Calculate Length of Route in terms of R Length
11. Set, Optimized Nodes Properties, ONPROP= []
12. For i in rang of R Length
13.  EBEE = FR (i) = NPROP // Current Bee from Pb
14.  OBEE = ThresholdPROP // // Mean of all Pb
15.  F(f)= Fit Fun (EBEE, OBEE)
16.  ON PROP = ABC (F(f), FR (i))
17. End—For
18. Returns: ONPROP as an Optimized Mobile Sensor Nodes Properties
19. End—Function