Expected optimization time
Lax637351.Runtime · concepts/Lax637351/Runtime.lean · lax-637351
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The genetic algorithm with crossover probability is run on , starting from individuals chosen independently and uniformly at random from . Its optimization time is the number of iterations until the population first contains the optimum ; iterations whose offspring is discarded by avoidance of replications count as well. The expected optimization time is .
Concept map
Lean source view on GitHub
| 1 | import Lax637351.Algorithm |
| 2 | import Mathlib.Topology.Algebra.InfiniteSum.ENNReal |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Expected optimization time |
| 7 | type: definition |
| 8 | --- |
| 9 | The genetic algorithm with crossover probability is run on |
| 10 | , starting from individuals chosen independently and uniformly at |
| 11 | random from . Its optimization time is the number of iterations until the |
| 12 | population first contains the optimum ; iterations whose offspring is discarded by |
| 13 | avoidance of replications count as well. The expected optimization time is . |
| 14 | -/ |
| 15 | |
| 16 | namespace Lax637351.Runtime |
| 17 | |
| 18 | open Lax637351.Algorithm |
| 19 | open scoped ENNReal Classical |
| 20 | |
| 21 | noncomputable section |
| 22 | |
| 23 | /-- The population distribution after iterations of the GA. |
| 24 | Initialization is uniform over all populations, equivalently independent uniform initial |
| 25 | individuals. Each subsequent iteration uses `step` with fitness . -/ |
| 26 | def populationDistribution (n k : ℕ) (μ : ℕ+) (p_c : ℝ) (avoidReplications : Bool) (t : ℕ) : |
| 27 | PMF (Population n μ) := |
| 28 | match t with |
| 29 | | 0 => PMF.uniformOfFintype (Population n μ) |
| 30 | | s + 1 => do |
| 31 | let P ← populationDistribution n k μ p_c avoidReplications s |
| 32 | step (jump k) p_c avoidReplications P |
| 33 | |
| 34 | /-- The expected optimization time . The inner sum is |
| 35 | the probability that the population after iterations does not contain ; for |
| 36 | it equals , since has the unique maximal fitness and is never |
| 37 | lost once present. The sum is in nonnegative extended reals and may equal infinity. An optimum |
| 38 | already present in the initial population is found at time zero. -/ |
| 39 | def expectedOptimizationTime (n k : ℕ) (μ : ℕ+) (p_c : ℝ) (avoidReplications : Bool) : ℝ≥0∞ := |
| 40 | ∑' t : ℕ, ∑ P : Population n μ with (∀ i, P i ≠ optimum n), |
| 41 | populationDistribution n k μ p_c avoidReplications t P |
| 42 | |
| 43 | end |
| 44 | end Lax637351.Runtime |
| 45 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments