# Talk:Particle swarm optimization

WikiProject Systems
This article is within the scope of WikiProject Systems, which collaborates on articles related to systems and systems science.
???  This article has not yet received a rating on the project's quality scale.
???  This article has not yet received a rating on the project's importance scale.
WikiProject Computer science (Rated C-class, Mid-importance)
This article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
C  This article has been rated as C-Class on the project's quality scale.
Mid  This article has been rated as Mid-importance on the project's importance scale.

## Major Changes

Dear All,

I've made a major cleanup and restructuring of the PSO page and hope you all like it - it took several hours to do and is now more in the style of a survey paper.

When you add new information in the future please be sure to properly reference the source (e.g. journal or conference paper, tech report, msc/phd thesis, etc.), and please avoid conjecture. The PSO page on wikipedia is very popular and the readers should have concise and accurate facts, so let us leave the speculation and philosophy to the private communications amongst ourselves as researchers.

Feel free to contact me if you feel I've removed something important (I did read through everything before removal.)

Cheers!

Optimering (talk) 14:52, 19 March 2010 (UTC)

Dear Optimering,

I see that in your clean up and restructuring you have deleted the descriptions as well as the pseudocode, in addition to what may be garbage and self promotions that was accumulating, like the proverbial baby and bath water.

Please reintroduce the description(improve it if you will) and pseudo code, and respect others contributions. The pseudo code and descriptions sections evolve and constantly update itself by numerous contributors over time, meaning readers needed that and tried to correct it (a different activity than form simply adding material and inserting self references to it). Wiki is its originality (not original research but original wording), the research is already cited. The algorithm section that you try to preserve is a bit obfuscated, an makes the PSO look more complicated than it really is to the those outside the field. Mathematical notations are needed only if it conveys preciseness, by themselves do not sufficient to convey insights to everybody. Many others would find the psuedocode easy to follow. I think the judgement about the quality past and present is very unilateral. I do not see any real discussion above, other than the assertion that it has been restructured. and that insistence of conformance to a view of a good document.

Descriptions, insights and pseudocode are very much part of an article on particle swarm. The restructuring assume that people will read the algorithm section and the parameter turning section and understand everything about it. The state it is in is perhaps worse quality (hard to understand information) than it was before (some information with garbage). For instance by reading that obfuscated algorithm section the reader will have no idea what swarm intelligence has got to do with it. and just makes more work for anyone who needs to refer to it and use it. It appears that meta optimization / parameter tuning is the main theme in the PSO article. meta optimization/parameter tuning is a a topic of investigation applicable any optimization algorithm that takes parameters.

This wiki article should present in an encyclopaedic way something useful to wiki users the basic information present in the pre-2001 papers, which have already been cited in the wiki. Variants, parameter tuning, obfuscated algorithm descriptions, tangential and successive research work should not be referred here. Researchers have better places to dig into them

Cheers!

--

Hi,

Wikipedia is supposed to be a summary of key facts. The PSO page apparently invites a lot of non-scientific discussion and it severely detracts from its credibility and usefulness, as well as casting a negative light on the field as a whole. It is therefore imperative that contributors to the PSO page maintain a proper scientific standard, this means unbiased surveys of the body of knowledge with proper references to sources, etc.

A significant portion of the PSO page now deals with parameter selection simply because it is a main topic of the research community, in various guises.

Please feel free to add sections on other interesting aspects of PSO, such as its use in real-world applications, in multi-objective optimization, for discrete search-spaces, its relation to cognitive sociology, etc. Just remember to keep the surveys concise, free of opinions and with proper use of references. In other words, please keep it scientific and notable.

Re. pseudo-code vs. the more mathematical description, it is a matter of taste. There are references to several source-code libraries which provide implementations that are much better at giving algorithm details.

Best regards,

Optimering (talk) 14:15, 28 April 2010 (UTC)

### Changes for non-technical audience

I've reinstated the pseudocode and explanation. Algorithms are difficult to read, typical programmers won't understand the math notation (I know that from experience with some quite talented guys), and including an algorithm without an explanation of its design and goals is plainly inconsiderate - and opposite to an encyclopedia purpose, which is to explain leading-edge knowledge in simple terms.
This and other articles should not just catered to researchers but anyone interested in learning about the technique, and that must include programmers as well. In case that you feel both versions of the algorithm are redundant, the one to go should be the math one. You can look it up in the references anyway; not so with the pseudocode, much easier to understand than reading a whole implementation code, and much more difficult to find as a resource outside Wikipedia. Wikipedia articles should not be peer-reviewed papers. I do agree with including only proper scientific peer-reviewed sources, but the way to present them must NOT be the same as with a survey paper - the audience is entirely different here. Diego Moya (talk) 08:18, 27 September 2010 (UTC)
Hi, Optimering. The pseudocode is not mine, I just restored it from the article's history. It's written in Python, the popular 'executable pseudocode'[1]. This bit of code doesn't include any of the esoteric features of this language (list comprehensions, array splices) that would it make it difficult to read other than the 'range' function, which is quite self-explanatory in a for loop. A C or Java version would be less concise.
As for the introduction, the current form is inadequate for all but the most technical readers. The wp:lead section in Wikipedia's manual of style advises providing context on the topic, avoiding or explaining jargon in site (the 'gradient' explanation is thus required with the special rules applying to the lead), and targeting a general audience - as well as providing a summarized, stand-alone version of the whole article.
The very first sentence has special rules to make it crystal-clear to every potential reader, so there's no problem in having redundant information for the various audiences with different levels of technicality. You are trying to avoid redundancy, but redundancy is good for comprehension so a moderate level should be welcome; again, this article is not a research paper so it must try to explain the topic, not only reference it. Please read the lead guideline and see how my edits make sense in that context. Diego Moya (talk) 10:47, 27 September 2010 (UTC)
Hi,
My view on the pseudo-code remains exactly what I posted above on 28 April 2010. I was just trying to be polite to avoid an 'edit war'. Since it is not yours I have deleted it because it needs significant improvements to be of adequate quality to justify inclusion here. (I hardly understand it, it uses undefined terms, and the reader needs to study the mathematical algorithm to understand its details anyway ...) It is also very common for numerical algorithms to use mathematical description as it is the most universal language we have for such descriptions. If you need a more detailed description on how to actually implement PSO you should consult actual implementations.
Re. the introduction I have changed it around a bit from what it was before. I believe it matches Wikipedia's guidelines well. Redundancy should be kept to a minimum because of Wikipedia's internal-linking facilities which makes it easy for anyone to do a background study simply by following links. Please see WP:Lead#Introductory text.
I particularly admire the Wikipedia articles on medical topics which are extraordinarily well written. Since I'm a computer scientist myself I naturally only understand a small part of the medical terms and will have to look up the others. Again, such background study is easily facilitated by Wikipedia's internal linking system. See for example Lyme disease and its introduction.
It is important to remember that Wikipedia is used worldwide. The PSO page has some 250-300 visitors each day. So when we add or change something we should ask ourselves if this is valuable to those readers and if it is presented in a form they can be expected to be familiar with. I believe the introduction now is actually better than it was before your change, so this merging of contributions has indeed improved the PSO article. I hope you agree so we can settle this.
Optimering (talk) 11:33, 27 September 2010 (UTC)
The need to keep redundancy low does specifically not apply to the introduction section, which must be essentially all redundant with respect to the article's content. Precisely because there are many people using the page, a 'pristine' pure article is not the best approach; an article with several levels of detail will be best for both researchers and non-technical people, and everyone in between.
Only because YOU don't understand some part of the article it doesn't make it less useful; those very parts not targeted to you may be invaluable to someone with a different background. Again, this article must not be targeted exclusively to computer scientists; I'd dare to say we are the ones to need it the least as we should be able to understand the topic directly from the research sources.
I agree with leaving out the pseudocode part if you find it's of low quality. Not so for the opening paragraph (the sentence 'A method for performing numerical optimization without usage of the gradient' is particularly bad) nor the algorithm explanation. I feel they are needed for that general audience which will have problems reading the math notation and understanding the workings of the algorithm. As it seems there's a basic disagreement here, I think we should ask for a third opinion or some other dispute resolution.
To end on a high note, would you mind if I ask you how to find the number of visitors in an article? I didn't know Wikipedia had that function, I might put it to some use myself. Thanks. Diego Moya (talk) 12:12, 27 September 2010 (UTC)
Hi, You will find a link to the visitor count on the history-page. I'm fine with adding 'In computer science' to the introduction. I do not intend to be rude but you are forcing the question; I found the other additions to the introduction either redundant to the description already there or very difficult to comprehend (and I'm supposed to be an expert on the subject). Same as the 'discussion' section which was either redundant to the introduction or pure conjecture (I would never have let that pass even in a BSc exam, so it most certainly does not belong in an encyclopedia either). The medical articles on Wikipedia are of the quality that other articles, including PSO, should aspire to. Thanks for your contributions though, I agree the introduction is better now. Please feel free to add other sections (e.g. on applications, multi-objective optimization, criticism, etc.) as long as they are concise, well-referenced and devoid of conjecture. Optimering (talk) 13:16, 27 September 2010 (UTC)
Thanks for the bit about the history page. I'm trying to have an introduction paragraph that complies with the guidelines for good articles, which clearly state that it should be targeted to the general public and not depend on the reader knowing the terms at hand. The current introduction does not provide that. As you're an expert in the subject, please admit that you're not in the best position to assess what may be understood by laymen. If it helps, I can summarize what I find problematic in your version of the lead.
The last version of the 'discussion' section was not speculative (I removed those bits), it was a mere high-level description of the algorithm in natural language based on the physics metaphor that inspired the technique. The 'Wikipedia is not a scientific journal' policy requires you to provide such content 'in the lead and initial sections of the article'; someone who can't read an algorithm at all should still get the essence of how the method works by reading this article. Also note that being redundant with the introduction is a requirement of the guidelines: a good article must expand on what is found in the introduction. So by deleting it you're a) making the article harder to understand to novices and b) editing against the consensus of what a good article is. In the medical article you cite as an example, see how the history and symptoms described in the lead are later given a whole section each in the article's body.
So please provide a better explanation in terms that someone who doesn't know algorithms can understand, or leave some of the content I introduced into the article. Every new edit I made has tried to address your stated concerns, but you keep deleting them instead of improving them. Diego Moya (talk) 14:15, 27 September 2010 (UTC)

Diego,

First, you are completely wrong that PSO is inspired by physics and that it simulates particles. PSO was inspired by social behaviour as James Kennedy, one of the authors of PSO, is a research psychologist.

Second, the word gradient is common in the English language as well in mathematics, particularly numerical analysis. Your explanation of gradient as 'direction of improvement' is technically incomplete / incorrect and really is more confusing than have the reader just study the gradient page. Further, PSO is a specialized topic within numerical optimization and the reader can be assumed to be familiar with basic concepts and terminology from the field in general. You cannot explain to the layman what an optimization problem is and what a gradient is on every single Wikipedia page that describes an optimization method, the internal links serve this purpose very well.

Third, in the discussion section that you reinstated/wrote relating to the inner workings of PSO you were basically just repeating what the introduction already says, that is: "PSO optimizes a problem by having a population of candidate solutions, here called particles, and moving these particles around in the search-space according to simple formulae. The movements of the particles are guided by the best found positions in the search-space which are updated as better positions are found by the particles."

Fourth, your discussion section also contained several speculative remarks and ideas for future research, e.g. regarding convergence behaviour of the swarm, use of vectorized computers, etc. You had provided no references at all. Conjecture and ideas are not suitable in an encyclopedic article.

Fifth, the pseudo-code you reinserted had already been removed long ago which was accepted by the community because it was of very low quality and the more mathematical algorithm description is more concise and accurate, and in line with how numerical algorithms are often described. If you need a more detailed or more programming-oriented description you should consult actual implementations.

Sixth, your altering of the section-headings is also inappropriate. Parameter tuning is not a 'latest research' topic, it is in fact one of the oldest topics relating to PSO, as are the algorithm variants.

Please don't get me wrong. I agree 100% that the Wikipedia page on PSO should be understandable to as broad an audience as possible. That is the entire reason that I'm spending time editing the page. But the edits you made significantly worsened the page. I'm supposedly an expert in the field and I had problems understanding some of your edits.

I do not wish to be rude but the real problem here seems to be that your native tongue is not English and that you do not want to familiarize yourself with even the most basic terms from the broader field.

Furthermore it seems that you have now turned this issue into some kind of crusade and vendetta so I ask that the wikipedia editors decide on this issue.

Please note that I will not participate in this discussion with you any further, but I may elaborate and comment in the dispute resolution.

Regards,

Optimering (talk) 06:32, 28 September 2010 (UTC)

Wow! Slow down cowboy, there's no need to make this personal. You think the common procedure of "bold edit-revert-discussion-more edits" is a vendetta on you? I was trying to introduce you to the criteria that Wikipedia editors use to assess what is a good article and the processes encouraged to achieve them, because in my opinion your approach is far from that process and is hurting the article more than helping it. Sadly your responses have included calls for me to stop editing and instant reverts that lose interesting contents that some of us desire to keep. Your subsequent changes to the article fall short to address the raised concerns.
It's a shame that you won't further discuss the need for article improvements. I still have concerns with the current introduction and article structure, but I will keep them to myself until discussion with more people occurs. I just will make a quick comment to your points so as to 'save my honor'.
1) The seminal Kennedy article cites as precursors simulations of movement of various agents. The 'social behavior' being simulated was the movement of birds and fish in flocks. The algorithm keeps track of 'particles' 'position' and 'speed' in a 'space'. If that's not enough physical inspiration to you, let's call that an opinion or a matter of personal taste.
2) Note that the medical article you provided as inspiration to write WP articles is not rated more than B-class. Contrasting that, in featured articles you can learn that myeloid refers to a line of blood cells, or that dialysis is a treatment, without the need to ever read the linked article. So I claim your quality criteria as misguided.
3) Repeating in the body information available the introduction is not a problem. Quite opposite, the wp:lead guideline encourages you to expand that information to provide further detail: 'The lead section should briefly summarize the most important points covered in an article in such a way that it can stand on its own as a concise version of the article.'
4) My attempt was to cover in the article the points introduced in the lead section, and I did address your stated reasons to keep it out. What remained was a mere description of the algorithm in natural language (so no need for further references). Even when I removed every sentence that you deemed speculative or a conjecture, you still reverted it.
5) The community did not 'accept' removing the pseudo-code. The only other comment by an editor was a request to keep that content and for you to improve it.
6) I stated the reason to group those sections under a common header as to keep due weight, i.e. to separate what's a description of the technique to what is the ongoing research on it, although I was not sure which words to place in the title. This concern was stated by another editor, and your 'fix' does not address it.
Last, it's true that my mother tongue is not English, but it's not true that I don't know the technical terms. I'm trying to defend the article so that people who don't know those will still get a rough understanding of the topic. This won't happen if you try to keep the article to what in your opinion is a perfect state - articles in Wikipedia are supposed to evolve by contributions from several editors in order to keep balance, not by an expert as the only source for edits. I ask forgiveness that I sounded rude at times, as I said there's nothing personal and English is not my first language. Diego Moya (talk) 13:54, 28 September 2010 (UTC)
 Response to third opinion request: My opinion, in short, is that the lead is too technical for non-programmers to understand. I am a somewhat technical person and I've done a fair bit of programming (although I was never formally trained), and I kind of explain what PSO is from the lead, but not completely. More context is required for a layperson to understand what PSO is, and the lead needs to read more like you're explaining the concept to your mother (obviously that's an exaggeration, but it illustrates my point). So, with my opinion out of the way, let's focus on how to fix it. I think the bulk of the problem lies in the first sentence. The first sentence needs to be as general as possible with a bare minimum of technical jargon. I shouldn't have to read 4 other articles to understand the first sentence of this article. In particular, the use of the terms "optimization" and "gradient" are the most confusing. I'm not saying that this version is perfect, but here's how I'd rewrite it: In computer science and operations research, particle swarm optimization (PSO) is a method for finding ideal solutions to numerical problems without knowing which changes to a known solution will result in an improvement. PSO optimizes a problem by having a population of candidate solutions, here called particles, and moving these particles around in the search-space without usage of the gradient of the problem to be optimized. That simplifies the first sentence a bit and moves the jargon down to the second sentence. Like I said, it might not be a perfect version, but you might be able to use it as a starting point for discussion.—SnottyWong comment 20:00, 27 September 2010 (UTC)

SnottyWong comment 20:00, 27 September 2010 (UTC)

How can I respond to this without being rude? 1) This text is technically incorrect. You cannot find 'ideal solutions' to an optimization problem. The only way to do that is by exhaustive search of the search-space and that is almost always impossible, hence the need for optimization methods in the first place. 2) The entire first sentence barely makes any sense to me and I'm supposedly an expert in the field. 3) The last sentence ("PSO optimizes a problem ...") is a contraction of the existing introductory text but removes essential parts, such as the attraction to best known positions and that these are being updated in the course of optimization. 4) The problem here seems to be that you are not familiar with the words 'numerical optimization' and 'gradient'. Neither was I when I first started out, but our own ignorance is no reason to explain common terms on every single Wikipedia page dealing with these issues. That is precisely what the internal links are for. Optimering (talk) 06:47, 28 September 2010 (UTC)
I won't enter into the technicalities of the article for now, because there's a more basic issue going on here. You have stated a bold vision of what you want the article to be like. The large cleanup you made may or may not be beneficial to the article, but the problem is that such personal preferences on the final article's form are discouraged by the Wikipedia editing process. Your contributions are welcome, but you must be prepared to have them evolve in the wild to something you didn't want them to be by people with different opinions.
Wikipedia guidelines and policies (which you admitted you don't know well) are intended to facilitate this collaborative editing process. You're not required to know them to the letter, specially for minor edits. But for major changes like the one you did, it's logical that other editors will refer you to the guidelines. You will be asked to explain how your edits relate to them, least other people will revert or remake your work.
In particular, two editors have pointed you to the 'write for the layman' guideline. You're simply wrong with respect to the use of internal links (your point #4): the introductory paragraph is explicitly required to be written for people without expert knowledge, and technical terms *must* be explained in place. This is not necessary for the article's body, but it is for the lead. Your latest version is better in that regard, although it still irks me that the provided description would be applicable to any other metaheuristic.

Reading the dispute resolution process in detail, it strongly encourages to keep up negotiation and find compromises before asking for arbitration. Are you final in your decision to not discuss any mor? If you reconsider it, I will explain my current worries and we can work to solve them a step each time. I promise not to make bold major changes to the article until we have an initial draft (though some minor changes can be expected). Diego Moya (talk) 14:26, 28 September 2010 (UTC)

Well,
What baffled me was that you made very large changes to the article even though you admittedly had no knowledge on the subject. The proper action would have been to tag the sections you found confusing and elaborate on your opinion on the discussion page. That would have been much more constructive.
Wikipedia is a fantastic website and I have strongly encouraged several established researchers and practitioners to contribute to various articles, but they have all declined precisely because they do not want to waste valuable time and effort making contributions which they fear may later be 'sabotaged' by non-experts and novices. Scholarpedia serves the purpose of protecting the pages from such edits, but it is my impression that noone cares to update scholarpedia and hardly anyone uses it. Wikipedia is the main-pedia.
Now then, after the initial commotion had settled I could see that perhaps the article could in fact be clarified. My entire purpose in editing this article is indeed to make PSO as accessible as possible to as many people as possible. As you have seen, I have expanded the introduction and the algorithm section. What is written now gives more context and is technically correct (as opposed to the edits made by laymen/non-experts which made no sense to neither laymen or experts.)
I also still contend that the reader must be assumed to have some background knowledge. This IS a technical article and there is no way to make it non-technical without making it excessively large, trivial and worthless. Technical articles are very common on Wikipedia within mathematics, economics, computer science, medicine, etc. They make heavy use of internal links to keep the articles concise. How can you write an article like LU decomposition and not assume the reader has knowledge of linear algebra? Or make an article on oxygen without assuming the reader knows basic chemistry?
On the PSO page, for instance, the term gradient seemed to give rise to some confusion. This is hard for me to understand because in most of the western world the concept is taught extensively in the freshman college year if you study mathematics, physics, engineering, computer science, economics, etc. It is taught in the basic calculus course, see e.g. partial differential. So it is still my opinion that such a basic term should only be 'explained' in the form of an internal link and certainly not by a short and incorrect description. (Also, I would very much like to see someone explain to the layman in 5-10 words what quasi-newton methods are - I doubt that can even be done, but having an internal link works very well and does not draw attention from the main point of the article in question.)
Let us now see if wikipedia users will provide any more input as to what they find confusing. (I think our opinions are pretty clear by now and we are just rehashing ourselves.) Then the proper action is to either tag the sections so that future expert visitors can elaborate upon the subject, or you can try and directly recruit established experts to write the content. (I had actually made a few sections some time back which were tagged for elaboration, but after a few months nobody had come forward and the sections remained empty, so I deleted them.) I don't think anyone should take it upon themselves to edit an article on a subject they are not well-versed in; except for minor edits such as spelling errors, fixing internal links, etc.
As 250-300 people visit the PSO page on an average day I think a week or so should be sufficient to gather commentary. If no requests for changes have been posted within a week or so then please consider removing the tag on the introduction.
I regret that we got off on the wrong foot here and that so much time and effort has been wasted.
Cheers,
Optimering (talk) 06:25, 29 September 2010 (UTC)
I've posted a request for comments to solicit more opinions from people in the Math/Sci project and elicit that needed input from community.
You misunderstand what I ask for the technical jargon used. You certainly can assume a technical background and use wikilinks to define complex terms, but you should do it in the article's body, not in the opening sentence. The lead section must be targeted to the general public, according to good article criteria and relevant recommendations (see Make technical articles understandable). In short, the article may be technical while the introduction is not. Your assumptions on who the target audience should be are holding the article back IMHO.
Of course you can write articles on oxygen and LU decomposition that are useful for people beyond a technical, western audience. But you must be willing to step off your preconceptions of what an article should be, and willing to make the additional effort and accommodate a wider vision. You don't have to do all that work alone. But you must compromise even if the final result is not what you expected.
Imagine next week newspapers announce that Particle Swarm Optimization is used to cure cancer; then millions of readers from all backgrounds would use Wikipedia to try to understand what this technique is about. A good article should be written to past that test. This is a somewhat contrived scenario, but by falling short of that goal, you're hurting the evolution of this article. What you call 'sabotage' by editing one man's work I call enhancement to support the needs of more than one target. There's a reason few people care to edit Scholarpedia or Citicendium - they serve the needs of few people.
Examples on how to do that are found in the oxygen article ("All major classes of structural molecules in living organisms ... contain oxygen", "The name oxygen was coined in 1777 by Antoine Lavoisier" - see, you didn't need chemistry) and in the guidelines ('establish if it has any practical applications', or 'people who have studied related subjects...may be lacking some prerequisite knowledge, in which case they will only read "prerequisite" articles if they have a serious interest'). The introduction should be written to stand on its own and highlight the major points on the topic, and not depend heavily on the knowledge spread among the whole discipline.
Also don't be afraid to let tags stay for a long time. They are informative on their own, they let the interested reader understand in what ways someone thinks the article is lacking. They can even prompt someone to dive in and fix the problem. The article won't be better for not having a tag if the problem that it described is still real. Wikipedia is a work in progress, and tags let people be avare of the current state of the article. Maybe they will be used two years from now, maybe in forty years. No need to delete them only because you didn't get instant feedback.
Last, please don't be so quick to judge other people's motivations or skills. I haven't used PSO technique myself and don't know it in detail, but I work with metaheuristics for a living (though no longer from a research institution), so I know the terms in the field. I never admitted otherwise, that was an assumption of your own. If you don't want to explain how a gradient affects an optimization search, don't use the word in the lead section, create an Overview or Introduction and place it there. Diego Moya (talk) 09:13, 29 September 2010 (UTC)

I didn't have the slightest idea why someone might want to implement this until I looked at the videos at the bottom of the article, and I'm fairly accustomed to wading through relatively technical Wikipedia articles. After I watched the video, it took me no time at all to hack a totally generalized version together in Haskell, but the article itself provided little assistance in this. Now that I know what its meant to say, yes, I can see that the description does *fit* the concept, but it really doesn't *specify* it very well. Is it really so hard to just say that the particles drift back and forth between their own best-so-far location and the global best-so-far location? Or make it even more plain, and just state that in the simplest version particles drift toward the best known location, and that there are various improvements depending on the problem to be optimized. Saying that they move around due to 'simple mathematical formulae' is not only almost completely meaningless in this context, it's also redundant. WarDaft (talk) 22:39, 28 March 2011 (UTC)

I agree the lead section should be improved. I'll try to rework it and include your description of particles behavior. Diego Moya (talk) 16:00, 2 April 2011 (UTC)
I've reworked the lead section. I'd appreciate if some native English speaker would copy-edit the new text and review the high-level explanation of the behavior of the swarm. Diego Moya (talk)

## Changes

Hi,

I made some fairly major changes to the page with respect to how the algorithm is described and what notation is used; it's more in harmony with what's used in the literature and the books available on PSO, as far as I know.

Hi,

Page looks great, very readable! Good work. I'm wondering if these formulas are backwards though:

• If ${\displaystyle f(\mathbf {x} _{i}), ${\displaystyle {\hat {\mathbf {x} }}_{i}\leftarrow \mathbf {x} _{i}}$.
• If ${\displaystyle f(\mathbf {x} _{i}), ${\displaystyle {\hat {\mathbf {g} }}\leftarrow \mathbf {x} _{i}}$.

Shouldn't it be:

• If ${\displaystyle f(\mathbf {x} _{i})>f({\hat {\mathbf {x} }}_{i})}$, ${\displaystyle {\hat {\mathbf {x} }}_{i}\leftarrow \mathbf {x} _{i}}$.
• If ${\displaystyle f(\mathbf {x} _{i})>f({\hat {\mathbf {g} }})}$, ${\displaystyle {\hat {\mathbf {g} }}\leftarrow \mathbf {x} _{i}}$.
The formulas on the page are correct; in its standard form PSO is a minimizing optimizer. Of course it only takes minor changes to convert the algorithm to a maximizer. Dbratton 11:58, 15 November 2006 (UTC)

Well, I'm glad to see some other people on Wikipedia are interested in this exciting new optimisation architecture.

How much should be added on variants from research literature? The more recent versions and stuff are simply far more effective and usually not much more complex than the canonical algorithm that's currently up - it's the difference between success and failure.

## Pseudocode typo

how is it that J is being referenced outside the dimensions loop on the second to last line?

 for I = 1 to number of particles n do
for J=1 to number of dimensions m do
R1=uniform random number
R2=uniform random number
V[I][J]=w*V[I][J]
+C1*R1*(P[I][J]-X[I][J])
+C2*R2*(G[I][J]-X[I][J])
enddo
X[I][J] = X[I][J]+V[I][J]
enddo


i know where this pseudocode comes from, it is from Daniel Wilke's paper. the problem is that i am not %100 sure that i have spotted an error because i have never actually seen a clear & typo-less listing of this algorithm. it's such a shame because it should be so simple and i am sure that the lack of clarity hinders adoption.

Fixed. It was just a misplaced line. DanielC/T+ 10:47, 25 March 2007 (UTC)

## Benchmarks

Some benchmarks to verify that implementations written by readers are correct. Say, the number of generations required to solve some test problems on average with the parameters used. I could use this kind of information right now. Maybe I'll post it after I get my implementation working.

## NFL and other issues of comparison with other optimisation methods

"Movements through the search space are guided by these successes, with the population usually converging, by the end of a trial, on a problem solution better than that of non-swarm approach using the same methods."

What exactly does the last phrase mean? Is it a comparison to hill climbing or simulated annealing, or what? What does "better" mean in this context? Fewer evaluations of the fitness function? What is the reference for this claim? dvunkannon 01:22, 2 March 2009 (UTC) —Preceding unsigned comment added by Dvunkannon (talkcontribs)

"A single particle by itself is unable to accomplish anything. The power is in interactive collaboration."

I'm pretty sure that is false. Obviously, you could choose parameters such that a single particle system was just doing a random walk through parameter space. Wolpert's No Free Lunch theorems say that's as good as PSO across all possible fitness functions (yes, simplifying). Other Evolutionary Computation paradigms don't use a population. As in simulated annealing, there is only one particle at a time.

The statement is, at best, hyperbole, and not appropriate for an encyclopedia. dvunkannon 01:36, 2 March 2009 (UTC) —Preceding unsigned comment added by Dvunkannon (talkcontribs)

Simplifying, indeed. :) Seriously though, 'no free lunch' doesn't really belong in any metaheuristic articles, as a general statement that, "everything equally sucks" simply doesn't accomplish anything. More on-point, one of the foundations of swarm intelligence is, well, the swarm. In this case, with only a single particle, there's no social component in the velocity update rule. There's no neighbourhood. Nada. It isn't just that simulated annealing and hillclimbers don't require a population. The point is that the PSO would degrade into a hill-climber (or simulated annealing, depending on how momentum is handled) without a swarm size greater than 1.
So, yes, it's technically hyperbole. I suppose a more accurate statement would be to the effect of, "a single particle defeats the purpose of using PSO", or, "a single particle lacks the contribution of swarm intelligence". 209.90.133.250 (talk) 04:29, 17 July 2009 (UTC)

"The considerable adaptability of PSO to variations and hybrids is seen as a strength over other robust evolutionary optimization mechanisms, such as genetic algorithms. For example, one common, reasonable modification is to add a probabilistic bit-flipping local search heuristic to the loop."

Again, there is a real need to cite references to back up this claim. Given the flexibility of GA implementations with respect to adding operators, choice of selection functions, etc., the statement cannot be accepted at face value. If PSO is improved by incorporating ideas from GA and SA, what does that say about the core theory behind PSO?

dvunkannon 01:46, 2 March 2009 (UTC) —Preceding unsigned comment added by Dvunkannon (talkcontribs)

Actually, I'm inclined to agree. Personally, I'm not convinced that it's even true, and it certainly needs to be cited at the very least.
(Keep in mind, though, that "is seen as a strength over other...mechanisms" isn't the same as saying, "is a strength over other...mechanisms". It merely means that some people believe it)
As for that last part, well, you're basically right. In general, flexibility is a good thing, however the method by which people tend to "improve" PSO is by mutilating it to the point of being closer to GA than PSO. (Look up things like 'job shop' in google scholar to see what I mean. Right down to mutation and crossover) 209.90.133.250 (talk) 04:29, 17 July 2009 (UTC)

## External Links to Source-Code

Request for comment: Should the external links section should contain a list of source-code libraries? For this article, should such links be considered "necessary"? If not "necessarily necessary", sufficiently relevant to be appropriate here? Or is an list of external links to libraries "unencyclopaedic" as in "Wikipedia is not a directory"? --A. B. (talkcontribs) 15:16, 7 October 2010 (UTC)

Dear All,

There is some disagreement as to whether or not the external links section should contain a list of source-code libraries.

My personal opinion is that these links are highly useful to the user of Wikipedia who avoids having to spend time and effort doing an internet search using e.g. Google or Bing. The source-code is available free of charge under various Open Source licenses and should therefore not be considered advertisements of commercial products.

If Wikipedia prefers linking in a different format, for example on a separate page, then someone knowledgeable of the Wikipedia standards please make such a change instead of just deleting the links.

Cheers,

Optimering (talk) 14:05, 24 September 2010 (UTC)

The external links guideline says that we should not have lists of external links to suppliers. There is no exception for open source projects - indeed one could easily argue that including open source but shutting out proprietary systems isn't neutral. - MrOllie (talk) 14:12, 24 September 2010 (UTC)

Dear MrOllie,

You are more of an expert on Wikipedia than I am so forgive me if I'm being ignorant. You seem to be referring to WP:ELNO#Links normally to be avoided article 14, which reads: "(avoid ...) Lists of links to manufacturers, suppliers or customers."

I can understand this rule as it could easily turn Wikipedia into another dmoz.org

But under WP:ELNO#Links to be considered article 3 it says to link "Sites that contain neutral and accurate material that is relevant to an encyclopedic understanding of the subject and cannot be integrated into the Wikipedia article due to copyright issues, amount of detail (...), or other reasons."

On WP:ELNO#Official links it also says: "More than one official link should be provided only when the additional links provide the reader with unique content and are not prominently linked from other official websites."

I believe source-code libraries for PSO in various programming languages fall within these rules as source-code provides unique and highly useful content to the user of Wikipedia which is not linked from any other 'official' website. There really is no 'official' website on PSO apart from the Wikipedia page, as the research is carried out by a diverse group of people. The last remaining external link on the PSO page is not 'official' as it is maintained by a researcher who is focused on one area of research.

The PSO page on Wikipedia is visited by thousands of people each month, of which many will presumably be interested in getting source-code for their particular programming language, if only to understand the actual implementation better. These links save the Wikipedia user substantial time and effort as they do not have to search the internet using Google or Bing.

There is no need to worry that the list of PSO source-code libraries grows too large as not that many exist.

Please consider restoring the links or give a suggestion how this highly useful information can be provided to the Wikipedia reader.

Cheers,

Optimering (talk) 06:49, 25 September 2010 (UTC)

Dear MrOllie,

Since you have not replied to my note above I have taken the liberty of reinstating the external links as per my arguments above. I believe these external links are highly valuable to the Wikipedia user, that they are well within the Wikipedia content rules, as argued above, and furthermore, it is actually quite common that Wikipedia pages for computer algorithms have external links to source-code (and sometimes also multimedia illustrations when those exist). This is simply because it adds value for the user and for Wikipedia. I believe it is a misunderstanding of the Wikipedia rules to disallow such external links, as argued above.

The question is which external links to allow and which to disallow, and how to avoid a bloated list of external links. This is a difficult question but not presently a problem on the PSO page.

If you insist that the external links be provided in some other format, for instance as a separate Wikipedia page with a list of notable source-code libraries for PSO, then please make such a page yourself instead of just deleting the list here. It may be perceived as destructive and offensive behaviour to simply remove valuable contributions of others instead of re-formatting according to Wikipedia guidelines.

Cheers,

Optimering (talk) 07:04, 27 September 2010 (UTC)

There is no consensus to include these links, kindly do not reinsert them. - MrOllie (talk) 12:02, 27 September 2010 (UTC)
I disagree in your interpretation of Wikipedia guidelines and hope you provide an alternative formatting option for these external links. Optimering (talk) 13:02, 27 September 2010 (UTC)
The formatting is not the issue, they simply should not be included. I've removed them, Ronz has removed them. per WP:ELBURDEN they need to remain out of the article unless a consensus emerges in favor of inclusion. - MrOllie (talk) 13:09, 27 September 2010 (UTC)
Sorry I haven't commented earlier. I thought this would be easily settled. There's an extremely detailed algorithm in the article. Other code is redundent and shouldn't be linked per ELNO#1. --Ronz (talk) 14:46, 27 September 2010 (UTC)
Sorry lads, I didn't realize that by 'consensus' you meant a specific Wikipedia procedure, viz. Wikipedia:ELN. I'm a researcher not a professional wikipedia editor. Optimering (talk) 05:37, 28 September 2010 (UTC)
Since you identify as a researcher, I should probably ask: Do you have any connection with any of the source code projects that were linked? - MrOllie (talk) 14:07, 28 September 2010 (UTC)
Glad we're coming to an understanding.
MrOllie is referring to WP:COI. Optimering has no obligation to answer, but he/she should follow WP:COI regardless. --Ronz (talk) 17:44, 28 September 2010 (UTC)
I do my utmost to be neutral and rational in all my edits on wikipedia, as I do in my academic journal reviews, etc. I know researchers of all persuasions in this field. There are also many edits and articles on wikipedia I disagree with but which I do not revert/modify. As long as they are notable, neutrally written and have proper citations I think the wiki reader will eventually benefit from a multi-faceted coverage of the body of knowledge. Regarding the 'edit war' above, the edits did not live up to this standard of quality and they were made by a non-expert. Hopefully it is getting settled now. Regarding the external links I really feel they benefit the wiki user and many other pages have these, see e.g. LU decomposition. But I ask that someone else start the official concensus process at Wikipedia:ELN because this is starting to sound like 'Optimering versus Ronz and MrOllie'. Perhaps one of you lads will start the consensus process for the external links? Optimering (talk) 06:43, 29 September 2010 (UTC)
The external links noticeboard is not 'the official consensus process', it is just a place to get more input. You might want to read Wikipedia:Dispute resolution. - MrOllie (talk) 16:20, 29 September 2010 (UTC)
As someone who somewhat familiar with both Wikipedia policy and the subject matter, it is very appropriate for an article on an algorithm to include (a small number) of links to (notable and preferably academic) libraries which implement the algorithm. For example, on any article about a computational geometry algorithm I would, as a reader, expect to see a link to the implementation in CGAL.
Clearly some caution is order, we do not want the External links section to turn into a long list of low quality implementation of the algorithm in every programming language under the sun, but an outright ban of any such link is not an acceptable solution to this problem and not what the WP:ELNEVER policy states. —Ruud 16:36, 29 September 2010 (UTC)

Dear All,

A notice has been posted on Wikipedia:ELN to get more input so we can reach a consensus either for or against having external links to source-code libraries. To briefly summarize my own point of view: I believe such links would benefit the Wikipedia reader because 1) source-code clarifies how to actually implement PSO to readers of varying backgrounds in a manner that no pseudo-code ever can, 2) a significant portion of the article's readers can be assumed to want to use PSO and they are then saved the trouble of either implementing it themselves or by searching the internet for source-code using e.g. Google or Bing, 3) it is common for algorithm-related Wikipedia articles to have links to actual implementations in various programming languages, 4) I believe this is in line with Wikipedia guidelines, see e.g. Wikipedia:ELNO#What_should_be_linked no. 3.

The links compiled over time by multiple wikipedians are:

Please give your input whether you believe external links like these should be permitted, and whether you think some of those listed here should be removed and perhaps others added, so we can reach a consensus on the issue.

Cheers,

Optimering (talk) 05:16, 1 October 2010 (UTC)

The only external link we currently list, http://www.particleswarm.info/, has its own list of implementations. That should be more than satisfactory. --Ronz (talk) 05:41, 1 October 2010 (UTC)
http://www.particleswarm.info/ is maintained by one researcher who has exclusive right to include and exclude whatever he wishes. WP:ELNO#Official links states: "More than one official link should be provided only when the additional links provide the reader with unique content and are not prominently linked from other official websites." Optimering (talk) 06:07, 1 October 2010 (UTC)
That's a bit of a red herring, though. None of these links are official websites - this is an article about a computational method, not some person or company that would have an official site. - MrOllie (talk) 10:53, 1 October 2010 (UTC)
Forgive me if I seem daft but please explain how the suggested links to PSO source-code differ from those found in other articles, e.g. LU decomposition, Kruskal's algorithm, Dijkstra's algorithm, Mergesort, Fft, to name a few offhandedly. Why is there consensus to include such links there and not here? Optimering (talk) 12:06, 1 October 2010 (UTC)
Take a look at this essay, Spam event horizon. Note that it's not a binding guideline -- just the opinion of some experienced editors. Nevertheless, it does a good job of describing the problems that arise with larger external links sections. I've seen this syndrome over and over. I'll take it on faith that the individual links proposed above are each OK on their own merits but collectively I see real problems for this article's quality in the long term.
We have also have a good description of what we don't do here on Wikipedia because it interferes with our core goal of producing a good encylopaedia -- see "What Wikipedia is not", in particular the sections, Wikipedia is not a mirror or a repository of links, images, or media files and Wikipedia is not a directory
For these reasons, I strongly recommend we not add all these links to an External Links section. --A. B. (talkcontribs) 12:24, 1 October 2010 (UTC)
Optimering, as to those other articles, we have yet another page on that sort of thing: Other stuff exists (you must be getting pretty sick of our rules, opinions and inconsistency by now, but that's Wikipedia).
I've left notes at the two WikiProjects for this sort of article asking for their input on these links and your question.
Hopefully we'll get some useful comments on what's typically done with other articles like this one. --A. B. (talkcontribs) 12:38, 1 October 2010 (UTC)
I'm somewhat shocked to see what is going on here. On what grounds do some of the people involved judge whether a certain external link is appropriate or not? Clearly, no computer scientist would have to think twice to label a link to INRIA as appropriate. The policies being thrown around here are meant to be applied to with common sense and good judgement, I see very little of that. Only rules being rigidly applied or bend in one's favour to win an argument that shouldn't even be taking place. —Ruud 00:19, 2 October 2010 (UTC)
It seems the editors who are opposed to having external links to source-code are not computer scientists themselves, e.g. when they refer to source-code libaries as 'suppliers' and deeming source-code for a few programming languages 'sufficient'. To a computer scientist it is almost sacrilege to censor links to source-code because they are of such high value. In fact, Wikipedia would probably not even exist if it wasn't for public sharing of source-code libraries. Could the editors who remain opposed please explain their point of view in more detail, please see Wikipedia:Don't revert due to "no consensus", and explain what it will take to gain consensus in favour of having external links to source-code? As mentioned above there is consensus to include such links on many other Wikipedia articles on computer algorithms, so why is it being so strongly opposed here? Thanks. Optimering (talk) 06:49, 5 October 2010 (UTC)
Please focus on the issues that actually matter to building consensus, rather than on assumptions about other editors.
One language is good enough for tAoCP.
See WP:ELBURDEN. --Ronz (talk) 16:09, 5 October 2010 (UTC)
I had to google 'taocp' before I understood it was an acronym for Knuth's famous book series The art of computer programming. Of course, the equally famous book Numerical Recipes#References exists for C, C++, Fortran, Fortran 90 and Pascal, so that is not a good argument for excluding links to source-code for major programming languages.
What we are basically arguing here is whether source-code links is a major convenience to the wikipedian or not. I clearly believe it is, as does User:Ruud Koot, as do the editors of many other wikipedia articles on algorithms where there is apparently consensus to have such links.
It seems, however, we have become stuck in a discussion with opposing editors who are determined to hold their ground. As I am unfamiliar with the consensus building process on Wikipedia and feeling this is not really going anywhere I will desist and hope for further input from other wikipedians.
Optimering (talk) 13:57, 6 October 2010 (UTC)

At this point I think a good way to achieve consensus would follow the advice given at wp:Spam_event_horizon#Remedies and convert into references the external links that are deemed more useful. I'm thinking of a new section among the lines of "Notable implementations", with a short coverage comparing their different strengths and what makes them notable. This would allow to keep the links without the danger of the list becoming a spam farm. (Though I believe this risk is fairly low in a topic like this). Diego Moya (talk) 15:28, 6 October 2010 (UTC)

I have no objection to that, provided notable in this case is the same notable as in Wikipedia parlance, that means that some independent party has written about them in a reliable source. - MrOllie (talk) 15:33, 6 October 2010 (UTC)
external links to source code should definitely be included. esp, where possible, to [[2]] and the like. Kevin Baastalk 15:48, 6 October 2010 (UTC)
Your knowledge of Wikipedia guidelines played you a trick, MrOllie ;-) Notability established by the Wikipedia rules is not required for the particular contents of an article, only for the existence of the article itself. I vote for keeping the external links in a way that does not detract from the quality of this article. Diego Moya (talk) 16:07, 6 October 2010 (UTC)
Right, I didn't say it was required. I did say what standards would be required to gain my support, though: independently written sources attesting to why these particular implementations are important. - MrOllie (talk) 16:21, 6 October 2010 (UTC)
While WP:N doesn't apply, WP:SOAP, WP:OR, and WP:NPOV do apply. We need to find independent, reliable sources that demonstrate the implementations are worthy of mention or inclusion. --Ronz (talk) 16:25, 6 October 2010 (UTC)
I fail to see how WP:OR and WP:NPOV apply to the inclusion of links to code; they don't assert facts about what's likned. WP:OR could apply only in the case of an new extended section with descriptions of the implementations - those would indeed require verifiability. WP:SOAP would apply for cases of advertising and self-promotion, which is not the case here.
And again, having sources to demonstrate being 'worthy of inclusion' is by definition the wp:Notability guideline which doesn't apply here - thus we don't need it. If you want to require those to build consensus then ask for them as a personal preference, as MrOllie did. Diego Moya (talk) 17:46, 6 October 2010 (UTC)
I'm discussing how we could include "Notable implementations" as proposed above.
WP:OR mostly because of WP:PSTS.
WP:NPOV mostly because of WP:UNDUE, though NPOV applies as a whole as well.
WP:SOAP#1 - Without independent, reliable sources, it appears this would just advocate certain implementations over others.
"Worthy of inclusion" applies to all content, and is supported by the policies given. --Ronz (talk) 18:30, 6 October 2010 (UTC)
Clearly you do not have the necessary expertise make a good judgement on this issue (yes, this requires more knowledge and intelligence than being able to cite a number of acronyms starting with "WP:"). Have you even bothered trying to find out whether some of the frameworks mentioned here could be considered notable by the computer science community? At least this and this one have been mentioned in a large number of published papers. If you don't have the expertise to make a good judgement here, and do not want to make the effort to acquire any, then don't waste the time of those who do by arguing with them pointlessly and endlessly. —Ruud 09:30, 7 October 2010 (UTC)
This process might get us (slowly) through the issue for this article. Look a little more widely at the technical articles. In my experience, this is typical use of EL for a computing article. If there is a problem here, then there is a larger problem. The nut of it for me is that Wikipedia:Spam event horizon does not describe how these technical articles evolve. In my experience, they go through the earlier stages, get revamped but end up with larger EL sections which are useful, balanced and stable. If this needs to be fixed, there will be a lot of work to be done and this work will upset a lot of readers who have come to rely on external links like these. --Kvng (talk) 14:37, 15 December 2010 (UTC)
There may be some cases where referencing links within the article (rather than in the external list) would be appropriate. However, I think that if readers of the articles will find the listed external links very useful, they should be retained. For articles encompassed by specialist WikiProjects, members of those projects are probably best placed to judge the suitability of the listed external links. --trevj (talk) 09:35, 10 February 2011 (UTC)