Particle Swarm Optimization is a metaheuristic optimization technique which generates a population of particles which adjusts its particle position and velocity in the search space, according to a set of mathematical formulas, so as to locate the best solution.
PSO belongs to the broad class of Swarm Intelligence Methods for solving Global Optimization problems. It was developed by James Kennedy and Russel.C.Eberhart, inspired by social behavior of bird flocking or fish schooling.
Simulation of Bird Flocking
Consider a flock of birds searching for food in an area. There is only one piece of food in that area and all the birds are searching for it. In each iteration the birds are only aware of how far the food is.
So the best approach to get the food is to follow the bird which is nearest to it.
How it Works
In PSO,
The birds are the solutions which are termed as particles
1
- Each particle has a fitness value. Our aim is to optimize this fitness value as evaluated by the fitness function.
- Each particle has its own position and velocity calculated by the position and velocity function respectively.
- Initially, the PSO is initialized with group of particles whose parameters are altered during each iteration.
- In each iteration, every particle updates its fitness value and its pbest (personal best value)
- Meanwhile during each iteration the PSO reviews the gbest (i.e. the best pbest value obtained by any of the particle to that point.)
Characteristics of PSO
- PSO does not guarantee that an optimal solution is ever found.
- It is a metaheuristic computational method (i.e. it optimizes the problem by trying to improve the candidate solution with regard to a given measure of quality. )
- It’s similar to Genetic Algorithms.
- It’s easier to implement
- There are only a few parameters to be adjusted
General Pseudocode
For each particle
Initialize particle
End
Do
For each particle
Calculate fitness value
If (fitness value is better than the pBest )
set current value as the new pBest
End
gBest = particle with the best fitness value of all the particles
Initialize particle
End
Do
For each particle
Calculate fitness value
If (fitness value is better than the pBest )
set current value as the new pBest
End
gBest = particle with the best fitness value of all the particles
For each particle
Calculate particle velocity according equation (a)
Update particle position according equation (b)
End
End
PSO Example:
Function Optimization (Java Program)
The following is a Sample Code for the Java implementation of a simple PSO for function optimization of one dimensional quadratic equation.
In order to perform function optimization using PSO, some of the classes that we require are:
1. Location - To represent the position of the particle
2. Velocity - To represent the velocity of the particle
3. Particle - To represent the particle
4. PSOController – performs the PSO operation.
Position class
Velocity class:Here the function is evaluated by the calculateFitness() function.
InitializeAbc gets the quadratic equation from the user.
Here’s the code(partial code):
Some of the constants used:
Input: (x2 +6x+9)
Output: (x = -3)Prepared by: Archana Devi
Amrita School of Engineering, Coimbatore
Email id: archana.shiva@gmail.com
Mentored by: Prof T.Senthil.Kumar
Dept of Computer Science & Engineering
Amrita School of Engineering, Coimbatore
Email id: sapne21@yahoo.com
From variable swarm ?
ReplyDeleteAnd fitnessList ?
Hai,
ReplyDeleteI've mailed the code to you. If you have any furthur clarifications feel free to mail me anytime.
Thank you
hi,
Deletepls send the full code of PSO.It will be useful for me a lot.
Hi
DeleteI hope you are doing well.
I am working on a variant of PSO and I need the full working code that you have mentioned above.
Kindly email me the full code on rashid.omer3@gmail.com
Thanks and Best Regards
Hello, I need to do a similar project that optimizes using PSO, can you send me the source.here is my email: mails4morris@gmail.com
DeleteHello, I will do a similar project that optimizes using PSO, can you send me the source.here is my email: djwdjj.520@gmail.com
Deletehi Devi, nice article and very detailed explanation. Would you mind sending full code to softtech88@gmail.com.
ReplyDeleteThank in advance
Hai..
DeleteI hv sent it to your mail.
Please send the code to my email id sachchit.bansal@gmail.com.
DeleteI need it for my study. Please Help.
hi dis s nice and i wana fll code ll u pls send it to me at arivuazhagan001@gmail.com
ReplyDeleteI have sent it to your mail
Delete
DeletePlease send the code to my email id sachchit.bansal@gmail.com.
I need it for my study. Please Help.
This comment has been removed by the author.
DeleteHello, I will do a similar project that optimizes using PSO, can you send me the source.here is my email: djwdjj.520@gmail.com
Deletehi Devi, think you for this very nice article . Would you mind sending full code to landoulsi_marwen@hotmail.com
ReplyDeleteThank in advance
Hai
ReplyDeleteI have send the code to your mail. Hope it would be helpful.
Thanks...
Hi
DeleteI hope you are doing well.
I am working on a variant of PSO and I need the full working code that you have mentioned above.
Kindly email me the full code on a.abdulwahab.a@gmail.com
Thanks and Best Regards
Hi devi can u send me the code ..to my id avinashgujju@gmail.com
ReplyDeletePlease its v urgent ..can u do it today itself...
ReplyDeleteThanks in Advance
Hai I have the send the code. Hope it would be of help to your work...
Deletehi Devi, thank you for this very nice article. It was very helpfull but i still got some questions. Would you mind sending full code to macioss@plusnet.pl ?
ReplyDeleteThank in advance
Hai ... I've sent the code to your mail..Thank you..
DeleteCan you send me the full code
DeleteHi!
ReplyDeleteI'm from Poland and I myself is working on PSO right now.
I think, your work is really great and aprreciable and I want see your source code, because it would be of great help for me.
It's possible to have all your source code?
My e-mail: witek1902@gmail.com
Hai I've sent the code to your mail. Hope it would be helpful..Thank you
DeleteHi devi its a good explanation,can you please send the full source code my email:v.goutham@gmail.com
ReplyDeleteHi Devi,
ReplyDeleteCan you send the the full source code its very urgent,can you please send it today itself
my mail-id: v.goutham@gmail.com
Hi Devi, thank you for the nice article. you mind sending the full code to my email:
ReplyDelete192.16b.0.1@gmail.com
thank you,
Hi devi, nice article.
ReplyDeleteWould you mind sending full code to brkkpt@gmail.com?
Thank you in advance
Hi, Devi. good work.
ReplyDeleteCan u send the source code to fbpost2@gmail.com
Thanking You.
Hi Devi,
ReplyDeletegood work
could you send the source code to uni.group2012@yahoo.com
many thanks
can u send source code?
ReplyDeletemy email sf.shahril@gmail.com
thnkz =)
Hi Devi,
ReplyDeletegreat work
could you send the source code to bendo01@gmail.com
thank you very much
Hi Devi,
ReplyDeleteI´m working in project about PSO
and your code is insteresting for me.
Can you send me the source code at pabloselect@gmail.com
Thank you!
hi.. can you please mail the code to you85arun@gmail.com?
ReplyDeleteThanks in advance.
Hello mam...
ReplyDeleteCan u pls mail me the code to sathyathamizhmani@gmail.com????
Thanks in advance...
hello mam,
ReplyDeleteCould u plz send the complete code to m??
as m working on pso..so plz plz send it as early as possible...or the people who got the complete source code can mail m it on
krishnagkwd11@gmail.com
Hi, Devi.
ReplyDeleteCan u send the source code to suge86@gmail.com.
Thanks You.
plz send me the code at abhigupta1993@rediffmail.com
ReplyDeleteCara, você pode me enviar o código completo? Agradeço
ReplyDeletecavalcante.junior@live.com
This comment has been removed by the author.
ReplyDeleteHello Devi, I will really appreciate if you could please send your code to dextrewinton@gmail.com. Thanks!!...:)
ReplyDeleteHi devi, many thans to You if you could send me Ur full code about PSO to ringorbnsrg@gmail.com
ReplyDeletehi mam now am doing research on data mining so i need to know about PSO concept and example code could u plz send me that java code my mail id is ibrahimias90@gmail.com
ReplyDeleteNice code devi garu.. I am doing Project on PSO. can u give some idea about Travelling Sales person using PSO.. no idea where to start.. Looking for your replay.. Thank you..
ReplyDeleterajashekarcse33@gmail.com... this is my email id..
hi devi this article is verymuch useful can u pls mail ful code to srini169ms@yahoo.com
ReplyDeletethanks in advance
hi sir,
ReplyDeletecan u pls mail me the source code for this article? markgodfrey.torres@gmail.com thank you so much in advance sir.
hello mam , i am doing a project on PSO, can u please send me the code on my id ashagautam021@gmail.com.
ReplyDeletei wiil be greatly obliged thanking u
Could i have source code on ttuannguyenn@gmail.com. Thanks for your share.
ReplyDeleteHello, thank you very much for this help. Can you please send me the full code at enyonamval@gmail.com. Thank you very much, in advance, for this great help.
ReplyDeleteHi,
ReplyDeleteI like to have the full coding, so can you mail me
kandanmani070@gmail.com
HI madam., i am having an objective fucntion with 3 variable and with 3 levels.,
ReplyDeletecan u pl get send code for that to
shunmugesh@gmail.com
waiting for ur reply
thanking you
hi mam, please send me the fulll coding of PSO to me. I am doing research on it and i need it urgently. Could u please send the full coding of PSO to amuldarling22@gmail.com?
ReplyDeleteplz send me the full code my id is: rani_alvin@yahoo.com
ReplyDeleteHello Mr.Devi, would you please send me the source code to jihensalma@gmail.com
ReplyDeletethanks a lot .
Hai mam,
ReplyDeleteIam doing project in Datamining in matlab.. I already implemented PSO.. But i donot have knowledge about Heirarchical clustering... Can u please send me the code for that...
my mail id: rekha.sree88@gmail.com
Hi Devi
ReplyDeletethank you for this very nice article. Would you mind sending full code to train7730@gmail.com.
Thank's a lot :)
i need codin and materials related to this .. devi ji can u help me out..
ReplyDeleteHi archana,
ReplyDeleteWill you send me the full code to ganasundaram@gmail.com
hey,
ReplyDeletecan you send me the full source code at mindajalaj@yahoo.com
nice article, I'm in experiment about datamining especially PSO and hierarchical clustering, Would yo like to send your code to my email? tsabbitaqdami@gmail.com
ReplyDeletethank you
Hello, can you give me the full code ? My email is mtzatzarov@gmail.com Thank you.
ReplyDeletehi Devi, thank you. Your article was very helpfull. Would you mind sending full code to annagomes2012@gmail.com? merci
ReplyDeleteHi Devi,
ReplyDeleteThis is very good Explanation, can u mail me source code of it on kharche.deepali@gmail.com
Deepali
Thanks for the explanation. Kindly email the source code to me on chineduazubuike11@gmail.com
ReplyDeleteplz send me the full code my email:aboudinoura89@gmail.com
ReplyDeleteHi Devi. Thanks for the explanation. Kindly email me the source code at nehaverma.connect@gmail.com
ReplyDeleteH i dave. Congratulations for your work. Would you mind sending me the full source code to my email:dimpant90@gmail.com. Thanks in advance!
ReplyDeletehi devi. this article is really very useful. it make me easy to understand PSO.
ReplyDeletei need ful source code to go ahead in my project. will you please mail me ful soure code to email: mahaveer.sancheti@gmail.com
Thanks
Hi,
ReplyDeleteI'm in need of comparing the PSO algorithm with 3 different algorithms for my MS coursework. It would be really helpful for me to look at your full source code. If possible pls send me your full source code to kayal.alagu@gmail.com.
Your help is highly appreciated.
Thanks,
Kayal.
Hello Devi, would you please send me the source code to jajangjayuz87@gmail.com
ReplyDeletethanks a lot
send me code, devi send to this my email, ekosuhartono01gmail.com
ReplyDelete:-( i very need
Hi Devi,
ReplyDeleteThis is very nice article. It really helped me in understanding PSO algorithm. Could you please send source code at piyush043@gmail.com.
Thanks,
Piyush
hi
ReplyDeletegood work.plz could send me the code at ardh20@yahoo.com
hi Devi, think you for this very nice article . Would you mind sending full code to sangeetakalitajec@gmail.com
ReplyDeleteHi Devi,
ReplyDeleteThis is very nice article. It really helped me in understanding PSO algorithm. Could you please send source code at praveenmandloi2007@gmail.com.
Thanks,
praveenmandloi2007@gmail.com
Hi Devi,
ReplyDeleteYour article is very impressive. Can you send me the Java source code for PSO algorithm at atbhatti@aggies.ncat.edu
Thanks,
Ali Tariq Bhatti
hi Devi,
ReplyDeletenice article and very detailed explanation.
Would you mind sending full code to rima.zarrouk@gmail.com.
send me code at ali_tariq302hotmail.com
ReplyDeleteHiii Devi...
ReplyDeletePlease send the code to my email id sachchit.bansal@gmail.com.
I need it for my study. Please Help.
hi Devi, nice article and very detailed explanation. Would you mind sending full code to nazihhenie@gmail.com
ReplyDeletethanks in advance
hi devi. your article is really very useful for my research work. it make me easy to understand PSO.i need full source code for further study. could you please mail me full soure code to suchipatel258@gmail.com
ReplyDeletethank in advance
Please mail me the code to vaibhavr4@gmail.com.
ReplyDeleteThanks in advance
Hi, Im working on PSO and your article is really helpful to understand PSO. If I get the code it will be easier to understand. Could you please send me the code by email? Here is my email: kaihansen1001@gmail.com
ReplyDeleteThanks in advance
Hello mam i am trying to use PSO into svm so please give me code so i can use it id: komalsedani5@gmail.com
ReplyDeletehi Devi, nice article and very detailed explanation. Would you mind sending full code to robotic301@gmail.com
ReplyDeleteThank in advance
hi Devi, nice article and very detailed explanation. Would you mind sending full code to robotic301@gmail.com
ReplyDeleteThank in advance
This comment has been removed by the author.
ReplyDeleteMadam,
ReplyDeleteI am doing project on matrix optimization using PSO,i have gone through your article i understood some basic errors which i did with my project,if possible can you send your source code,it will be helpful for me at ananth.pm89@gmail.com
Thanks in advance
Ananth
can you mail me the full code
ReplyDeletemail id: bpavithra17@gmail.com
Hi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteHi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteHi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteHi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteHi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteHi, can you send me the full source code to nor.ashikin79@gmail.com. Thanks in advance.
ReplyDeleteWhat is the use of Velocity Class ?
ReplyDeleteIt is not used in any calculation then why we need this ?
It is a good work. Kindly forward the complete code to my mail chimalab@gmail.com
ReplyDeleteHello mam! I'm currently working on PSO! Your work is really great! If you dont mind can you able to send the full code to my mail ID? It s jmjmargretkanimozhi@gmail.com
ReplyDeletePlz do mail me the code asap @ var.prateek@gmail.com
ReplyDeleteThanx in advance
Plz do mail me the code asap @ var.prateek@gmail.com
ReplyDeleteThanx in advance
Plz do mail me the code asap @ var.prateek@gmail.com
ReplyDeleteThanx in advance
can u plzzz send me the code on abhishek.gupta102223cse@gmail.com
ReplyDeleteHi
ReplyDeleteI hope you are doing well.
I am working on a variant of PSO and I need the full working code that you have mentioned above.
Kindly email me the full code on madnesh@gmail.com
Thanks and Best Regards
This comment has been removed by the author.
ReplyDeleteI am working on a variant of PSO and I need the full working code that you have mentioned above on noonzh1@gmail.com
Deletehi Devi
ReplyDeletecan YOU SEND FULL SOURCE CODE TO
noonzh1@gmail.com
hi
ReplyDeleteI need full source code of pso
my email noonzh1@gmail.com
pls i need the full code pls my mail is nouzmech@gmail.com
ReplyDeleteI am doing my project using PSO so Kindly email me the source full code plz at papu00170@gmail.com
ReplyDeleteHi Devi, would you mind, please send full code to didisuruhan@gmail.com ?
ReplyDeletewhen i follow your code, the program can't run maybe i have some problem, but i can't fix it.
Thank you.
Hey can I get the full code for a study? My mail id is rachellt.m@gmail.com
ReplyDeleteWould be very useful. Thanks in advance
Hello,
ReplyDeleteAs part of comparative study of flocking based and pso I need pso code can you please share it in vikrant.udapurkar@gmail.com
Thanks for your kind help !! :)
hi devi , kindly please could you send me the PSO code.
ReplyDeleteKind Regards
my email is :
Deleteshawinkarim@gmail.com
can I get the full code for a study? My mail id is 0228bulldog@gmail.com
ReplyDeleteThank you!
This comment has been removed by the author.
ReplyDeleteI need the Particle Swarm Optimization program code using scala. please send me the code to my id kaarthicknatarajan@gmail.com
ReplyDeleteHi, could you send to my email, please?
ReplyDeletemail is yesbolatov@gmail.com
DeleteHello, I will do a similar project that optimizes using PSO, can you send me the source.here is my email: djwdjj.520@gmail.com. Thank you very much!
ReplyDeleteHi, could you send to my email, please? eurismarpires@gmail.com
ReplyDeleteHi, could you send to my email, please? hamidirifwan@gmail.com
ReplyDeletehi I want to learn about pso ,,,
ReplyDeletecan you send to me source code ,,,
here my email : mkbx01@yahoo.com
This comment has been removed by the author.
ReplyDeleteHi mam
ReplyDeleteI'm a pg student doing a project in pso can you please send me the full code... Shir.keren@gmail.com
Thank you in advance
Hi, could you send to my email, please? sametkeles@hotmail.com
ReplyDeleteHello, please am a pg student and I will love to learn more about this. Kindly help me with your the full code. hizyyusuf@gmail.com
ReplyDelete