Severity: Medium (performance)
Clearing-GA's diversity-based survival step recomputes distances from scratch on every farthest-point selection iteration instead of maintaining a running minimum, making it O(count × overflow × anchors) metric calls per generation.
Location — src/variopt/algorithms/population/clearing_ga/optimizer.py:528-582
_clearing_occupancy performs O(pool × selected) Python-level diversity_metric.distance calls, and _build_diverse_backfill recomputes _minimum_distance_to_population against the full anchor set from scratch on every farthest-point iteration — even though the anchor set only grows by exactly one member per backfill iteration.
Scenario
population_size=200 → pool of 400; a single generation triggers on the order of 10^5-10^6 metric calls, even though classic incremental farthest-point selection would need far fewer.
Fix direction
Cache each overflow member's running minimum distance and update it only against the newly chosen anchor each iteration (classic incremental farthest-point selection), rather than recomputing against the full anchor set. Optionally cache pairwise distances computed during clearing for reuse in backfill.
Severity: Medium (performance)
Clearing-GA's diversity-based survival step recomputes distances from scratch on every farthest-point selection iteration instead of maintaining a running minimum, making it O(count × overflow × anchors) metric calls per generation.
Location —
src/variopt/algorithms/population/clearing_ga/optimizer.py:528-582_clearing_occupancyperforms O(pool × selected) Python-leveldiversity_metric.distancecalls, and_build_diverse_backfillrecomputes_minimum_distance_to_populationagainst the full anchor set from scratch on every farthest-point iteration — even though the anchor set only grows by exactly one member per backfill iteration.Scenario
population_size=200→ pool of 400; a single generation triggers on the order of 10^5-10^6 metric calls, even though classic incremental farthest-point selection would need far fewer.Fix direction
Cache each overflow member's running minimum distance and update it only against the newly chosen anchor each iteration (classic incremental farthest-point selection), rather than recomputing against the full anchor set. Optionally cache pairwise distances computed during clearing for reuse in backfill.