Research Article

Firefly Optimization-Based Cooperative Localization Algorithm for Intelligent IoT

Algorithm 1

Traditional firefly algorithm. Specific flow of the traditional firefly algorithm.
Input:
the measured distance from the k-th anchor node
to the unknown node
Output:
the estimated position of the unknown node
(1)Randomly initialize the fireflies;
(2)While maximum iteration is not reached do
(3)Calculate the objective value of the firefly using formula (2)
(4) Calculate the relative brightness of fireflies;
(5) Calculate the attraction of fireflies;
(6) Update the position
(7)end