The Binary Particle Swarm Optimization algorithm (described in [1]) is an optimization metaheuristic based in population. A set of potential solutions evolves to approach a convenient solution (or set of solutions) for a problem. The search is guided by the value of a real-valued fitness function.

In the standard PSO algorithm, each particle represents a solution to the problem. However, to resolve the ECC problem, we use a different approach (Michigan approach), in which the whole swarm represents the solution, and the social attraction in the standard PSO becomes "social repulsion" in the Repulsive Swarm. This modified version of the Binary PSO will be referred to hereafter as Repulsion Particle Swarm (RPSO).

The RPSO for the ECC problem solving is configured so each particle in the swarm represents one of the code words that will become part of the solution; each of the particles tries to maximize the Hamming distance to the closest particle in the swarm by separating from that particle. That is:

- Each particle is a code word (
*M*particles needed) - The particle dimension is equal to the code word length (
*n*) - Global neighborhood (each particle is neighbor of each other)
- Fitness (to be maximized) is the minimum distance to the rest of the neighbors
- A repulsion force is introduced that tries to separate each particle from its closest neighbor

The following equation rules the particle velocity in RPSO, replacing the standard PSO movement equation:

where,

: | Component in dimension d of the particle velocity in iteration . |

: | Component in dimension d of the particle position in iteration . |

,: | Constant weight factors. |

: | best position achieved so long by particle . |

: | position of the closest neighbor of particle . |

,: | random factors in the [0,1] interval. |

: | random factor in the [0,1] interval. |

: | inertia weight. |

: | adaptive repulsion factor between the particle and the repulsion centre (closest neighbor). |

The velocity equation introduces the function that takes two binary values as parameters. This function returns:

- 0, if both parameters are different;
- 1, if both parameters are equal to 0;
- -1, if both parameters are equal to 1.

After velocity for the particle is determined, its position is calculated using the following equation:

(2) |

The position equation implies that a binary PSO without individual and social influences () would still perform a random search on the space (the position in each dimension would have a chance of 0.5 of being either a zero or one).

The repulsion factor is required to weight the intensity of the repulsion force depending on the Hamming distance to the closest particle. Currently we use a linear expresion for this term, that takes negative values (which are interpreted as the force becoming attractive) in cases where distance to the closer particle is greater than the optimum.

: | Hamming distance between the particle and the repulsion center |

: | Particle dimension |

: | Optimum hamming distance between particles |