feat(operators): add SwapMutation for permutations

Variation that clones the first parent (a Vec<usize> permutation) and
swaps two distinct random indices when len >= 2 (spec §11.4). Tests
confirm the multiset of contents is preserved.
This commit is contained in:
2026-05-04 19:22:07 -06:00
parent b97ec4f7ab
commit 0cbef6be1b
3 changed files with 74 additions and 1 deletions
+1 -1
View File
@@ -16,4 +16,4 @@ pub use crate::pareto::{
pareto_compare, pareto_front,
};
pub use crate::operators::{BitFlipMutation, GaussianMutation, RealBounds};
pub use crate::operators::{BitFlipMutation, GaussianMutation, RealBounds, SwapMutation};