Heuristic — nature-inspired metaheuristic

Flower Pollination Algorithm

Aliasfpa, flower_pollination
TypeHeuristic — nature-inspired metaheuristic
Auto-seeds fromshuffle (random flowers)

Description

Nature-inspired metaheuristic modelling the pollination process of flowering plants. Maintains a population of flowers (candidate tours). Each epoch, each flower applies either:

The switch probability controls the balance between exploitation (global) and exploration (local).

TSP-specific adaptations (deviations from Yang 2012):

AdaptationReason
Global pollination → Lévy-scaled prefix of swap sequence toward gbestPermutation analogue of the continuous update; preserves tour validity
Local pollination → ε-scaled prefix of swap diff between two random flowersPermutation analogue of local cross-pollination
switch_prob floored at 0.8 when mutation_probability < 0.01Prevents degeneration to 99.9 % local-only search under default CLI options

Auto-expands to pipeline(shuffle, fpa).

Options

FlagDescriptionDefault
--epochsMaximum iterations10 000
--n_nearestNumber of flowers (floored at 25)25
--mutation_probabilitySwitch probability (global vs local pollination)0.8

Usage

teeline solve fpa -i ./data/tsplib/berlin52.tsp
teeline solve flower_pollination -i ./data/tsplib/berlin52.tsp --epochs=500
teeline solve fpa -i ./data/tsplib/berlin52.tsp --n_nearest=50 --mutation_probability=0.8

References