Skip to content

Commit 8384141

Browse files
committed
Add example/visualize_mutation_types and image to README
1 parent 2959d10 commit 8384141

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ Run with `cargo run --example [EXAMPLE_BASENAME] --release`
116116
* See [examples/hill_climb_table_seating](../main/examples/hill_climb_table_seating.rs)
117117
* Explore internal and external multithreading options
118118
* See [examples/explore_multithreading](../main/examples/explore_multithreading.rs)
119+
* Explore MutationType differences with visualization
120+
* See [examples/visualize_mutation_types](../main/examples/visualize_mutation_types.rs)
121+
* Generates visualization showing exploration patterns of different mutation strategies
119122
* Use superset StrategyBuilder for easier switching in implementation
120123
* See [examples/explore_strategies](../main/examples/explore_strategies.rs)
121124
* Use fitness LRU cache
@@ -126,6 +129,21 @@ Run with `cargo run --example [EXAMPLE_BASENAME] --release`
126129
* Custom Mutate implementation
127130
* See [examples/evolve_milp_custom_mutate](../main/examples/evolve_milp_custom_mutate.rs)
128131

132+
## Mutation Type Visualization
133+
134+
The library supports various mutation strategies that affect how the genetic algorithm explores the search space. The visualization below shows how different mutation types explore a 2D search space when searching for a target point:
135+
136+
![Mutation Types Exploration Patterns](examples/visualize_mutation_types.png)
137+
138+
The visualization demonstrates:
139+
- **Random**: Chaotic exploration, can jump anywhere in search space
140+
- **Range**: Local search with fixed radius around current position
141+
- **RangeScaled**: Adaptive exploration that starts broad and narrows down (funnel-like convergence)
142+
- **Step**: Fixed-step local search in cardinal directions
143+
- **StepScaled**: Grid-like exploration with progressively finer resolution
144+
145+
Run the example with `cargo run --example visualize_mutation_types --release` to generate this visualization.
146+
129147
## Heterogeneous Genotype Support
130148

131149
MultiRangeGenotype supports heterogeneous chromosomes that mix different gene

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
//! * See [examples/hill_climb_table_seating](https://github.com/basvanwesting/genetic-algorithm/blob/main/examples/hill_climb_table_seating.rs)
9898
//! * Explore internal and external multithreading options
9999
//! * See [examples/explore_multithreading](https://github.com/basvanwesting/genetic-algorithm/blob/main/examples/explore_multithreading.rs)
100+
//! * Explore [MutationType](crate::genotype::MutationType) differences with visualization
101+
//! * See [examples/visualize_mutation_types](https://github.com/basvanwesting/genetic-algorithm/blob/main/examples/visualize_mutation_types.rs)
100102
//! * Use superset StrategyBuilder for easier switching in implementation
101103
//! * See [examples/explore_strategies](https://github.com/basvanwesting/genetic-algorithm/blob/main/examples/explore_strategies.rs)
102104
//! * Use fitness LRU cache

0 commit comments

Comments
 (0)