Multiplexor Test

In this test, the genetic algorithm was required to find a Boolean function that would perform the task of an 11-binary-input multiplexor.

The multiplexor function uses the fist three inputs(A1-A3) as a channel selector. The binary number represented by the first three inputs is used to select one of the other eight inputs (D0-D7) the value of which then becomes the output for the function. For instance, if the first three inputs are 011(the binary number for 6) then the output of the function is the value of D6.

Gene Type

The gene type for this test is a variable-branch node data tree. The tree is used to represent a binary operation. The tree can use the NOT, AND, and OR operators as well as if statements. The if statements have three arguments. If the first argument is true, then the function returns the second argument otherwise it returns the third. The crossbreeding was performed the same way as in the equation test.

Determination of Fitness:

The raw fitness for a given tree was the number of input/output sets it got wrong out of the total number possible - in this case 211, or 2048 possible combinations. The actual fitness was then determined as:2048/(1 + raw fitness). Thus those trees which produced the most correct responses had the highest fitnesses while those with the fewest correct responses had the lowest. As in the equation test, the fitnesses are skewed in such a way as to greatly benefit fitter individuals.

Genetic Algorithm Parameters

The population size was 4000. The cross-breeding percentage was set to 60%. Overselection was again used as in the equation test. In this example N was 15%. The maximum number of generations was set to 51 (the first random population and 50 evolved ones) and the run was terminated when the genetic algorithm found an individual with a perfect fitness(2048).

Result

The genetic algorithm converged on a perfect fitness after 28 generations.



The graph shows at least one member of the population reaching perfect fitness after 28 generations. By this time the average fitness of the population is converging strongly to the best of generation. As always, cross-breeding produces some unfit members in each new generation.