CMOPSO: Competitive Mechanism based Multi-objective Particle Swarm Optimizer#
The algorithm is implemented based on [39]. CMOPSO extends the traditional Particle Swarm Optimization (PSO) framework to handle multi-objective optimization problems through a competitive learning mechanism. The key innovation lies in the competitive mechanism that selects leaders for particles through binary tournaments on elite solutions, promoting both convergence and diversity.
Key Features#
Competitive Learning Strategy: Each particle learns from a “winner” selected from the elite archive through binary tournament selection. The winner is chosen based on the smallest angle between the particle’s current position and the elite’s position, promoting diversity.
Elite Archive Management: Uses an external archive to store non-dominated solutions with a crowding distance-based tournament survival strategy to maintain diversity.
Velocity and Position Updates: Standard PSO velocity update with competitive leader selection, followed by polynomial mutation for enhanced exploration.
Algorithm Overview#
Initialization: Initialize population and velocities randomly
Competitive Leader Selection: For each particle, select a leader from elite archive using binary tournament based on angular distance
Velocity Update: Update velocity using competitive learning from selected leader
Position Update: Update particle positions
Mutation: Apply polynomial mutation for diversity
Archive Update: Update elite archive with new solutions
Survival Selection: Use SPEA2 survival strategy to select next generation
Example#
[1]:
from pymoo.algorithms.moo.cmopso import CMOPSO
from pymoo.problems import get_problem
from pymoo.optimize import minimize
from pymoo.visualization.scatter import Scatter
problem = get_problem("zdt1")
algorithm = CMOPSO(
pop_size=100,
max_velocity_rate=0.2,
elite_size=10,
mutation_rate=0.5,
seed=1
)
res = minimize(problem,
algorithm,
('n_gen', 200),
seed=1,
verbose=False)
plot = Scatter()
plot.add(problem.pareto_front(), plot_type="line", color="black", alpha=0.7)
plot.add(res.F, facecolor="none", edgecolor="red")
plot.show()
/Users/blankjul/workspace/pymoo/pymoo/operators/mutation/pm.py:47: RuntimeWarning: invalid value encountered in power
d = np.power(val, mut_pow) - 1.0
/Users/blankjul/workspace/pymoo/pymoo/operators/mutation/pm.py:52: RuntimeWarning: invalid value encountered in power
d = 1.0 - (np.power(val, mut_pow))
[1]:
<pymoo.visualization.scatter.Scatter at 0x106e72770>
Customization#
CMOPSO can be customized with different parameters to suit specific problem characteristics:
[2]:
from pymoo.algorithms.moo.cmopso import CMOPSO
from pymoo.problems import get_problem
from pymoo.optimize import minimize
from pymoo.visualization.scatter import Scatter
problem = get_problem("zdt2")
# Customized CMOPSO with different parameters
algorithm = CMOPSO(
pop_size=150, # Larger population for better diversity
max_velocity_rate=0.3, # Higher velocity for more exploration
elite_size=20, # Larger elite archive
mutation_rate=0.3, # Lower mutation rate for more exploitation
initial_velocity="zero", # Start with zero velocity
seed=1
)
res = minimize(problem,
algorithm,
('n_gen', 300),
seed=1,
verbose=False)
Scatter().add(res.F, facecolor="none", edgecolor="blue").show()
[2]:
<pymoo.visualization.scatter.Scatter at 0x109551f00>
API#
- class pymoo.algorithms.moo.cmopso.CMOPSO(self, pop_size=100, max_velocity_rate=0.2, elite_size=10, initial_velocity="random", # 'random' | 'zero' mutation_rate=0.5, sampling=FloatRandomSampling(), repair=ToBoundOutOfBoundsRepair(), output=MultiObjectiveOutput(), **kwargs)[source]
Competitive mechanism based Multi-objective Particle Swarm Optimizer (CMOPSO).
Particle updates are based on learning from the “winner” of binary tournaments of randomly selected elites. Replacement strategy is based on SPEA2.
Zhang, X., Zheng, X., Cheng, R., Qiu, J., & Jin, Y. (2018). A competitive mechanism based multi-objective particle swarm optimizer with fast convergence. Inf. Sci., 427, 63-76.
- Parameters:
- pop_sizeint, optional
The population size. Defaults to 100.
- max_velocity_ratefloat, optional
The maximum velocity rate. Defaults to 0.2.
- max_elite_sizeint, optional
The maximum size of the elite archive. Defaults to 10.
- initial_velocitystr, optional
Defines how the initial velocity of particles is set. Can be “random” or “zero”. Defaults to “random”.
- mutate_ratefloat, optional
Rate at which to apply polynomial mutation to the offspring. Defaults to 0.5.
- sampling
Sampling, optional Sampling strategy used to generate the initial population. Defaults to
FloatRandomSampling.- repair
Repair, optional Repair method for out-of-bounds variables. Defaults to
ToBoundOutOfBoundsRepair.- output
Output, optional Output object to be used for logging. Defaults to
MultiObjectiveOutput.- **kwargs
Additional keyword arguments to be passed to the Algorithm superclass.
References#
[39]
Implementation#
This algorithm has been implemented by Gideon Oludeyi and is based on the original paper by Zhang et al. (2018). The implementation follows the competitive learning strategy with binary tournament selection on elites to maintain diversity and convergence in multi-objective optimization problems.