While experimenting with constrained configurations (e.g., small routing steps), I observed that crossover is skipped when route length is small:
if p1.shape[0] <= 5 or p2.shape[0] <= 5:
return p1, p2
This effectively disables crossover, reducing genetic diversity and potentially increasing the likelihood of no feasible solution being found.
This behavior may impact GA performance in constrained scenarios.
Possible considerations:
- Alternative crossover strategy for small routes
- Fallback mutation or diversification mechanisms
- Validation or warnings for such configurations
I have added tests to validate this behavior in a separate PR.
While experimenting with constrained configurations (e.g., small routing steps), I observed that crossover is skipped when route length is small:
This effectively disables crossover, reducing genetic diversity and potentially increasing the likelihood of no feasible solution being found.
This behavior may impact GA performance in constrained scenarios.
Possible considerations:
I have added tests to validate this behavior in a separate PR.