Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON:: Solve the following problem using a genetic algorithm (GA): Minimize f(X1, X2, X3) = X1 2 + X2 2 + X3 2 for -1.0
PYTHON::
Solve the following problem using a genetic algorithm (GA):
Minimize f(X1, X2, X3) = X1
2 + X2
2 + X3
2 for -1.0 <= Xi <= 5.0, i = 1, 2, 3.
The goal is to find values of X1, X2, and X3 (in the given interval) that will cause f(.,.,.) to have
the minimum value. Use real (floating-point) values, not bit-string representations. Use
proportional selection, single-point crossover, and gene-wise mutation (as discussed in class).
Use the following parameter values:
N = 30; pc = 0.8; pm = 0.1; max generations (for use as a stopping condition) = 50.
For a typical single run, report the following:
a. At intervals of 10 generations, the best and the worst fitnesses (the f values) in the current
generation and the corresponding X-vectors; the average fitness of all the members of the
current generation;
b. The best-of-run solution (the vector and its fitness).
Next, collect data on 30 independent runs, and then report:
a. At intervals of 10 generations, the following averages (and the corresponding standard
deviations) over 30 values: the best-of-generation fitness, the average-of-generation
fitness;
b. The average (and the corresponding standard deviation) (over 30 values) of the best-of-
run fitness.
That is, the three quantities in (a) and (b) above are each an average of 30 values.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started