The Wolf Colony Algorithm
I first wrote this review in Turkish in 2015, while studying optimisation techniques. This is an English translation. It summarises the Wolf Colony Algorithm (WCA) as described by Liu Changan, Yan Xiaohu, Liu Chunyang and Wu Hua; the sources are listed at the end.
Optimisation means choosing the best result among all the candidate solutions to a problem under given constraints. General-purpose heuristic optimisation algorithms find near-optimal solutions to large problems in a short time. They are usually grouped into six families by what inspired them: physics, biology, swarms, social behaviour, music and chemistry. This post looks at a swarm-based one, the Wolf Colony Algorithm.
Overview
The Wolf Colony Algorithm is inspired by the tight organisation of wolf packs. Wolves in a pack divide up tasks and move in a coordinated way when they hunt. Some wolves act as scouts; when they find prey, they howl to tell the rest of the pack where it is. The others then close in and surround the prey. Food is shared out by a simple rule: the strongest wolves eat first, the weaker ones afterwards.
Keywords: wolf colony algorithm, swarm-based optimisation.
1. Modelling the behaviour
Let the search space have D dimensions and the colony have n wolves. The position of the i-th artificial wolf is:
Xi = (Xi1, …, Xid, …, XiD), 1 ≤ i ≤ n, 1 ≤ d ≤ D (1)
1.1 Searching
To improve the chance of finding prey, q artificial wolves are sent out to search the hunting area.

When a scout wolf is at position P0, it evaluates h candidate positions around P0 in h directions and picks the best one, P1. If P1 is better than P0, it becomes the wolf’s new position and the wolf moves there.
Assume the q scouts are the wolves closest to the prey, the maximum number of search steps is maxdh, and the position of the i-th scout is XXi. The h candidate positions are generated around XXi, and the j-th one (1 ≤ j ≤ h) is:
Yj = XXi + rand(n) · stepa (2)
Here rand(n) is a uniformly distributed random number in [−1, 1] and stepa is the search step. The search ends when the number of steps exceeds maxdh, or when the current position is better than the best candidate.
1.2 Besieging the prey
When the scouts find prey, they howl to report its position, and the other wolves move in to surround it. Let Gdk be the position of the prey in dimension d at colony iteration k, and Xidk the position of wolf i. The wolves move with:
X(k+1)id = X(k)id + rand · stepb · (G(k)d − X(k)id) (3)
where rand is a random number in [0, 1], stepb is the siege step and k is the iteration number. Position d is limited to the range [Xmin_d, Xmax_d]; if equation (3) produces a value outside that range, it is set to the nearest boundary.
Equation (3) has two parts: the wolf’s current position, and a pull towards the best wolf in the colony. This is how the colony shares information and cooperates. In the same way a pack closes in on its prey, WCA closes in on the global optimum.
1.3 Updating the colony
Food is assigned to the strongest wolves first and the weaker ones later. The strongest wolves get the most food, and the weakest eventually starve. Over time even the strong wolves grow weaker, so the pack keeps adapting. WCA mirrors this: the weakest wolves are removed from the colony and replaced with newly generated ones. This keeps the population diverse and helps the algorithm avoid getting stuck in a local optimum.
1.4 The steps of the algorithm
Step 1: Initialise
Set the parameters:
- Colony size
n - Maximum number of iterations
maxk - Number of scout wolves
q - Number of search directions
h - Maximum number of search steps
maxdh - Search step
stepa - Siege step
stepb - Number of weak wolves to replace
m - Initial positions Xi for every wolf
Step 2: Search
Choose the best wolves as scouts and move each scout according to equation (2).
Step 3: Besiege
- Among the scouts, take the best position as the prey’s position.
- Move every wolf according to equation (3).
- If Xid is smaller than Xmin_d, set it to Xmin_d.
- If Xid is larger than Xmax_d, set it to Xmax_d.
Step 4: Update the colony
Apply the food-sharing rule: remove the m weakest wolves and generate new ones.
Step 5: Check for termination
If the iteration count has reached maxk, stop. The answer is the position of the wolf with the best result. Otherwise go back to step 2.
2. Performance analysis
Choosing the parameters well matters a great deal for any optimisation algorithm. For WCA, the most important ones are:
- the siege step
stepb - the number of weak wolves replaced each iteration,
m
To tune them, the authors use the following continuous test function (the Ackley function):
f1(x) = −20 · exp(−0.2 · √( (1/n) · Σ xi² ))
− exp( (1/n) · Σ cos(2π·xi) ) + 20 + e (4)
S = [−32, 32]ⁿ, fmin = 0
With the function in 30 dimensions and the other parameters fixed at n = 200, q = 5, h = 4, maxdh = 15 and stepa = 1.5, WCA gives these results:
| stepb | m | Mean value | Best value |
|---|---|---|---|
| 0.1 | 5 | 0.9702 | 5.8271e−05 |
| 5 | 5 | 0.0606 | 0.0086 |
| 0.9 | 50 | 0.1090 | 2.5731e−05 |
| 0.9 | 5 | 0.0373 | 9.5163e−07 |
Table 1. Effect of stepb and m on f1.
The best combination is stepb = 0.9 and m = 5: it gives both the lowest mean and the best value. If stepb is too large, the wolves overshoot and hit the boundaries, and the algorithm loses its ability to find the global optimum. m should stay small; otherwise too much of the colony is replaced at random each iteration, which slows convergence and the search.
The number of scouts q and search directions h should not be too large either: large values make search areas overlap and increase the cost of each iteration. The number of scouts is smaller than the colony size. Assuming h · maxdh is smaller than n, the time complexity of WCA is O(n · maxk).
Comparison with PSO and GA
To test convergence and global search ability, the algorithms are compared on four more functions:
Sphere: f2(x) = Σ xi² S = [−100, 100]ⁿ (5)
Schwefel: f3(x) = max( |xi|, 1 ≤ i ≤ n ) S = [−100, 100]ⁿ (6)
Rastrigin: f4(x) = Σ [ xi² − 10·cos(2π·xi) + 10 ] S = [−5.12, 5.12]ⁿ (7)
Griewank: f5(x) = (1/4000)·Σ xi² − Π cos(xi / √i) + 1 S = [−600, 600]ⁿ (8)
fmin = 0 for all four
Note: the original post labelled f4 and f5 as “Rosenbrock” and “Rastrigin”. Their formulas are the Rastrigin and Griewank functions, so they are named accordingly here.
The first two functions have a single optimum; the other two have many local optima. All three algorithms run for 800 iterations:
- WCA: n = 200, q = 5, h = 4, maxdh = 15, stepa = 1.5, stepb = 0.9, m = 5
- PSO: 200 particles, inertia weight 0.729, learning factors 1.496
- GA: crossover rate 0.9, mutation rate 0.1, population 600, maximum individual lifespan 900
| Sphere | Schwefel | Rastrigin | Griewank | ||
|---|---|---|---|---|---|
| Mean value | WCA | 3.0815e−09 | 7.8201e−06 | 2.4866e−06 | 1.7545e−12 |
| PSO | 0.0628 | 6.2732 | 51.6593 | 0.1408 | |
| GA | 0.4125 | 0.3632 | 0.0011 | 14.3940 | |
| Best value | WCA | 2.7055e−11 | 1.8378e−07 | 5.7362e−08 | 1.1102e−16 |
| PSO | 0.0024 | 3.7711 | 17.9819 | 0.0022 | |
| GA | 0.2443 | 0.1673 | 4.2302e−04 | 6.1172 |
Table 2. Test results.
As Table 2 shows, PSO and GA get stuck in local optima, while WCA gets very close to the global optimum on all four functions.
3. Conclusions
WCA is an algorithm built on wolf behaviour: the colony searches for the global optimum through living and hunting together. It has been applied to problems such as path planning for robots and unmanned aerial vehicles. Its main strengths are:
- Global search ability. Scout wolves keep searching around the position closest to the prey, which gives the algorithm a strong global search.
- Simplicity. It uses simple formulas and is easy to implement.
- Generality. With small changes it can be applied to many different problems, which makes it a good fit for optimisation in general.
Sources
- Liu Changan, Yan Xiaohu, Liu Chunyang and Wu Hua, The Wolf Colony Algorithm and Its Application
- Qiang Zhou, Yongquan Zhou and Xin Chen, A Wolf Colony Search Algorithm Based on the Complex Method for Uninhabited Combat Air Vehicle Path Planning
- Sinem Akyol and Bilal Alataş, Güncel Sürü Zekâsı Optimizasyon Algoritmaları (Current swarm intelligence optimisation algorithms)