The inertia component preserves a particle’s previous movement momentum during particle-swarm optimization. It combines the particle’s current velocity with an inertia value between 0 and 1. section 7.8
Adjusting inertia changes how a particle searches:
- High inertia, near 1.0, maintains momentum and favors exploration of new regions. section 7.8
- Low inertia, near 0, slows movement and favors exploitation around promising solutions. section 7.8
A momentum-based intuition
A heavy speeding freight truck represents high inertia: it keeps moving and turns slowly. A housefly represents low inertia: it slows quickly and changes direction easily. section 7.8
def calculate_inertia(inertia, current_velocity): #A
return current_velocity[0] * inertia, current_velocity[1]
➥* inertia #B
def calculate_acceleration(constant, random_factor): #C
return constant * random_factor #D
The implementation multiplies each current velocity component by the inertia value before combining it with cognitive and social components. section 7.8

