liveBook · Manning

Wheel array

As explained in Advanced Algorithms and Data Structures

A wheel array is a cumulative-probability array whose entries represent the accumulated normalized fitness of population individuals.

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

How Advanced Algorithms and Data Structures covers it

How deep it goes
Explains normalization, cumulative construction, random lookup, and binary-versus-linear search costs.
Examples
Uses cumulative values beginning with 0.16 and 0.31 and ending at 1.
What it assumes
Assumes population fitness values and basic array searching; defines normalization and cumulative sums.
What you can do after
Apply it to select parents by drawing a random number and locating the first cumulative entry larger than it.
How it connects
Connects normalized fitness, roulette-wheel selection, binary search, linear search, and genetic-algorithm parent selection.

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.