A wheel array stores cumulative normalized fitness values so roulette-wheel selection can choose population individuals according to their fitness. Normalize each fitness by the population's total, then accumulate the results in population order; the final entry equals 1. section 18.1.6
Build and query the array as follows:
- Start with a hidden or explicit zero entry, then add each individual's normalized fitness to the preceding cumulative value. section 18.1.6
- Draw a random real number r between 0 and 1, and select the first array entry larger than r. section 18.1.6
- Use modified binary search for O(log n) selection, or linear search for simpler O(n) selection. section 18.1.6
Cumulative probabilities
If the first two normalized fitness values are 0.16 and 0.15, the wheel begins [0.16, 0.31, ...]. Its final value is exactly 1, and a random draw is assigned to the first cumulative boundary above it. section 18.1.6
