Implementation of Intelligent Algorithms for Localization of Wireless Sensor Network for Secure Wireless Communication Applications

— Sensorsareimportantdevicetocollecttheinformation for many applications. The present era is usinginternet of things (IOT) which is basically working on sensors.Theinputsorstatusofthesystemismonitoredusingthesensorsembeddedinthesystemunderconsideration.Thesensors need to be small in size, has to consume less power,more reliable and consistence. (WSN)isacollectionofsensorswhichworkstogethertodoaparticular task. This cluster of sensors are called nodes and hasits own power and ability to communicate to other nodes in thecluster. The location of sensors in the cluster is required to beidentified for proper data analysis. When the data is receivedfrom the sensor the location is also mapped with it then onlyproper action can be taken based on signal and location. InWSN few sensor locations are known which are called anchors,fromtheseanchors,thelocationofunknownsensorsareestimated.Inthispaper,intelligentalgorithmsfireflyandflower pollination algorithm (FPA) are used to find the locationof the sensors. The performance of the algorithms is comparedwiththeiraccuracytofindthelocation,andconvergencespeed.


INTRODUCTION
Smart city, smart home, and many other smart controlsare the intelligent operation of the system, which operatesindependently without human supervision. These intelligentcontrol techniques require monitoring of the environmentandchangeinthestate.Themonitoringispossibleby sensors, and most of the time its wireless. For the smart andbetter control, many inputs at different locations either withsame time or at particular time slot is essential. This formsthe network of wireless sensors [1]. A sensor is a node inWSN, which is tiny and has sensing elements, power backupforitsfunctionality,analogtodigital(ADC)converterreq uired to convert the sensed analog quantity into digitalformat as required by the WSN. It also has a small memoryunit, a transmitter, a receiver and a processing unit. Theanchor nodes positions are known and other nodes positionsarenotknownintheWSN.Localizationorfindingthelo cation of these unknown nodes depends on terrain, signalstrength,hardwarefunctionsandirregularitiesofWSNspa ce [2].Thesesensorsmaybewearableandhelpfulforthehumans in need. Patients in need of external support andsufferingfrommemorylossmayusethesesensors.Themonit oring of such sensors from the hospital or in centralcontrol unit requires to find the locations of the sensors. In apredefinedsearchspace,artificialneuralnetwork(ANN)maytr ainbasedonthepasthistorytofindthepresentlocationofthesenso rs.ANNisanintelligentalgorithmand is used to find the locations of the sensors with maximum of6% error [3]. In practical applications, hundreds of sensornodes are deployed to form a WSN and they communicateamong them in wireless medium. Accurate location of thesensor nodes is important to make proper control scheme.GPS is the best method but it is expensive and made thesensor nodes bulky and not suitable for many applications.The location may be in 2 dimensional or 3 dimensions basedontheapplicationsforwhichtheWSNisdesigned [4].Opti mization algorithms are widely used for the followingapplicationsinWSNnamelysensorlocalization,energ yefficient clustering, optimal coverage and data aggregation.Bio inspired optimization techniques are commonly used tofor this optimization in WSN [5]. Localization is the processof finding the location of the unknown sensor node from thereference of anchor or base station nodes. A cluster consistsof few anchor nodes and many unknown nodes. The processoflocalizationistofindthepositionofunknownnodesbas ed on the position of anchor nodes [6]. WSN applicationsare extended to healthcare, military, autonomous vehicle andmanymore.Mostoftheseapplicationsrequireselflocalizatio noftheunknownnodeintheWSN.Itisachallenging task for the WSN of low cost and low powerapplicationascomparedtohighpowerGPS [7].Manyintell igent and bio inspired algorithms are used for the WSNforlocalization,energyefficientclusteringandoptimalcov erage. One among them is the firefly algorithm. It usesthe intelligence of the firefly insects for the optimizationtechnique. The firefly is the insect which emits light on itsstomach. This light is flashing at some frequency based onthe need of the insect [8]. The firefly emits it light and itobserve the light of brightest firefly then the firefly movestowards the brighter one. This makes the faster convergenceof the firefly insect with its groups. The same technique isused in the optimization to get the faster convergence for thelocalization of the unknown nodes [9]. Firefly is a randomsearch which has attraction between the two light emittinginsects,thebrightergivesmoreattractionandfastmove menttowardsthebestresults.Thelessattractionamong the firefly makes premature in convergence and hencecare to be taken for the implementation of this algorithm [10]. Constraint firefly algorithm finds the solution inthespace bounded by the boundary conditions is helpful for thereal time application [11]. Flowering plants survives in theuniverse for many billions of years and its characteristic isusedtodevelopthealgorithmcalledflowerpollinationalgorith m (FPA) [12].The steps involving in the FPA issimple and has only two steps, they are local pollination andglobalpollination.Inglobalpollinationtheinsectsoranimals or birds are involved [13]. The insects' behavior ismodeled with levy flight constant and included in theglobalpollination [14].Theswitchingconstantdecides x x 2 est a y y 2 est a 0 the pollination of the flower to be local or global pollination.The global pollination pollinates the flowers with the globalflower, and in the local pollination, the global flower is notinvolved in the pollination process [15]. The section 2 givestheproblemformulation,section3explainsthefireflyalgori thm, section 4 explains flower pollination algorithm,section5explainsresultsanddiscussion,andsection6 concludesthepaper.

II. PROBLEMFORMULATION
The unknown sensor node location is estimated using theknown location of anchor node. Minimum of three anchornodes are required to identify the correct location of thesensor node. The distance between the sensor node and theanchorsarecalculatedand basedonthis,thelocationisfixed. The root mean square error is estimated for the sensornode from all the anchor nodes. When the root mean squareerroris zero,thenthecorrectlocationisarrivedforthesensor node.
which is away from the swarm has to observe the brightnessof the light and it has to move towards the brighter spot togetfood andtoget matting partner.Figure2 showsthefireflymovingtowardsthebrighterfireflyinthegroup.

Fig.2.Fireflymovestowardsthebrighterfirfly
Forthedevelopment ofthe intelligentalgorithm, fewidealizations are added into the algorithm. They are, fireflymoves towards the brighter firefly irrespective of the sex oftheinsects.Theattractivenessbetweenthefireflydependsonth e brightness of the emitted light intensity and inverselyproportional to the distance between them. Distance is thedestructive factor of attractiveness. When a firefly finds nobrighter firefly, then it moves randomly to explore the bettersolutionfortheconsideredproblem.Thebrightnessiscalcu lated using the objective function of the problem. Forthemaximizationproblem,brighterindicatesthebetterresult. Forminimizationproblem,theobjective functionisinversely considered asthefitnessfunction ofthe firefly.
In the above equation (3), β is the attractiveness, β0 is theinitial attractiveness, x is the distance between the fireflies, γisabsorptioncoefficientandmisthedimensionofthesolutionsp ace.Mostoftheproblemuses2dimensionalspacesasasearchspac eandconsidered inthispaper. (4) calculates the square root of the distance error. When thiserror is zero then the actual position of the unknown sensornodelocationisarrived.

D.Algorithm
The firefly algorithm for the localization of the unknownsensor nodesisgivenbelow.
Step 9: If the iteration count is less than maximum thenjumptostep3elsestoptheiterationandprinttheresults.

IV. FLOWERPOLLINATIONALGORITHM
It is a nature inspired algorithm. The flowering plantsgeneration and survival are implemented in this algorithm.This algorithm has two simple steps, one is selfpollinationand another one is cross or global pollination. Floweringplants are aimed to produce the seeds of the plant to extendits generation. To produce the seeds the pollen is transferredto ovary of the flower. About 10 percent of flower does notneedhelpfromtheinsects.Honeybeeisoneoftheimportantins ectwhichhelpstheflowerstoproduceseeds.

A.Localpollination
The pollen of the flower in the same plant is transferredtotheovaryoftheflowers.Thisprocessiscalledlocalp ollination and the mathematical equation for the process isgivenintheequation (6). Intheaboveequation (7),Fistheflower, i-istheflowerunder going for the pollination, subscript G is the globalflowerhavingbestresultsinit,andpistheiterationcount.
Step 2: Localization error is considered as the fitness of theflowers.
Step 5: For every flower, generate a random number, if therandom number is less than the switching constant thenexecutestep7.
Step 8: Increment flower count, and if it is less than numberofflowerpopulationthengotostep5.

V. RESULTSANDDISCUSSION
Fortheimplementationofthefireflyandflowerpollination algorithm a test case consisting of 40 nodes areconsidered.Inthis40sensornodes,8sensornodesareconsider ed as anchor nodes and those locations are known.Restofthe32sensornodeslocationsareunknown,theinte lligent algorithm has to estimate the correct location ofthese 32 sensor nodes [1]. The boundary of 0 to 100 units isconsidered for the search space for the 40 sensor nodes. The40 nodes locations are randomly generated by the MATLABsoftware. Among them 8 anchor nodes are identified andfixed to estimate the location of other 32 sensor nodes. Thesearchspaceistwodimensional.Thelocationisx,ypositionin thesearchspaceof(0,0)to(100,100)units.Theunknown sensor nodes locations are estimated one by one.Themaximumnumberofiterationsistakenas100iterations.I fthelocationofthesensornodeisnotidentifiedthen the best near location is considered. Then next sensornode F p1 F p (F p F p ) (6) locationissearchedinthesolutionspace.Samestepsare   Figure 5 shows the convergence curve for one of theidentifiedsensornodes.Thelocationisestimatedcorrectlyata round8 th iterationofthealgorithm.

B. Flowerpollination algorithm
Same localization system is considered for the flowerpollination algorithm for the comparison. In this algorithmalso 40 nodes are created in the solution space of (0, 0) and(100, 100) two dimensional space. Figure 6 shows 40 nodesin the solution space. In that 8 anchor nodes are given as redtriangle. Based on this position, rest of 32 sensor nodes areestimated. Actual node locations are shown as square boxandestimatednodesareshownasbluecolourstars.

VI. CONCLUSION
Wireless sensor networks are common and are increasingtheir use day by day. Due to cost efficiency and miniaturesize,GPSisnotincludedinthesesensornodes.Thelocali zation of these sensor nodes is important to take validandbettermonitoringandcontrolofthesystem.Natureinspir ed algorithms firefly algorithm and flower pollinationalgorithm are used to identify the location of the unknownsensor nodes. For this, a case study with 40 sensor nodes areconsidered. To identify unknown sensor nodes, anchor nodesare used. The intelligent algorithm finds the location of thesensornodes.Inthecomparisonstudy,flowerpollinationalgori thm performs better and identifies all the nodes in thesolutionspace.
Thisinvestigationfindsitsapplicationinoptimizingmechanic alengineeringdesignsuchasdesignofsprings,pressurevessels,spe edreducers,robotics.Wirelesssessornetworks on the whole finds its application in the mechanicalengineeringstreammainlyinthesecurityaspectinthee nvironmentalsensing,instructuralhealthandEquipmentmonitori ng in the aspect of condition monitoring and in theevaluation and improvementin processautomation.

Conflicts of interest/Competing interests
There is no conflict of interest from all the authors in the manuscript.

*Availability of data and material
Not Applicable 4. *Code availability (software application or custom code) Not Applicable 5. *Authors' contributions T Ashok -Overall concepts, literature survey, Working and ideology, Results development R Prabhakaran -Supervising, Proof editing