A stopping criterion is the rule that tells an iterative algorithm when to finish and return its best solution. Without one, a search could keep running indefinitely. Choosing the rule is like deciding how long to keep looking: more attempts may help, but they also cost time. section 4.19 section 7.9
Three useful rules answer different questions:
- Fixed limit: Stop after a chosen number of generations or iterations. This makes the amount of searching predictable. section 4.19 section 6.10
- Target fitness: Stop when a solution reaches a known minimum fitness, even if the solution itself was not known beforehand. section 4.19
- Stagnation: Compare the best solution across iterations and stop after too little improvement. A plateau is a reason to consider stopping, not proof that no better solution exists. section 4.19 section 6.10
Counting tours, then checking progress
In ant colony optimization, one iteration is a complete tour by every ant. Set the limit to 10 iterations, and each ant makes 10 tours before the search ends. Alternatively, track the best fitness after each iteration: if it is 100 at iteration 20 and remains 100 through iteration 30, a stagnation rule could stop the search. That plateau does not guarantee the best possible solution has been found. section 6.10 section 6.4
Place the check in the search loop, then return the best solution found when it is met. In particle swarm optimization, stopping ends position updates and returns the swarm’s best position. Give a search enough time to explore, but weigh extra iterations against computation time. If progress stalls, stopping is one option; adjusting parameters to encourage more exploration is another. section 7.5 section 7.9 section 4.20










