liveBook · Manning

Social constant

As explained in Grokking AI Algorithms, Second Edition

The social constant is a fixed particle-swarm parameter that controls the influence of the swarm's best-known position on particle movement.

The social constant controls how strongly each particle is pulled toward the swarm’s best-known position. It stays fixed while random scaling adds variety to movement. section 7.8

Changing the balance between social and cognitive influence changes the swarm’s personality:

  • A high social constant favors exploitation, pulling particles quickly toward the leader and risking premature convergence. section 7.8
  • A low social constant reduces peer influence, allowing particles to explore more independently. section 7.8
  • The social acceleration multiplies the distance between the particle’s current position and the swarm’s best position. section 7.8

A swarm with peer pressure

Imagine tourists choosing where to go. The social component is the voice saying, “Everyone else is heading toward that hill.” Increasing the social constant makes particles follow the group more strongly; excessive pressure can collapse the swarm around a poor local optimum. section 7.8

Figure 7.22 The intuition of the factors influencing velocity updates
07_22

Use the velocity-update visualization to see how social influence combines with inertia and cognitive influence. section 7.8

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains fixed lifetime, random scaling, position-based acceleration, and exploration-versus-convergence trade-offs without theoretical proof.
Examples
Uses tourist peer pressure, trend-following swarms, particle trajectories, and a Python social-acceleration function.
What it assumes
Assumes particles, swarm best position, inertia, and cognitive influence while defining social influence through a concrete analogy.
What you can do after
Apply it via Python code to calculate social acceleration and update particles toward the swarm’s best position.
How it connects
Links particle-swarm optimization with inertia, cognitive constant, social acceleration, velocity update, and convergence.

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.