COMP3600 Intelligent Systems HW3
COMP3600 Intelligent Systems HW3
Suppose there is equality a + 2b + 3c + 4d = 30, genetic algorithm can be used to find the value
of a, b, c, and d that satisfy this equation. The objective is minimizing the value of function f(x)
where f(x) = ((a + 2b + 3c + 4d) - 30). Since there are four variables in the equation, namely a,
b, c, and d, chromosomes can be composed as
To speed up the computation, the integer values of variables a, b, c, and d are restricted between
0 and 30. The selection process should be achieved by using the cumulative probability, random
number (r) and roulette wheel. To perform cross, use one point crossover as below
Mutation process is done by replacing a gene value at any random position in a chromosome
with a new value as
Implement the algorithm in Python programming language with the following setting: