Answer the question
In order to leave comments, you need to log in
How to find the extremum of a non-linear function of two variables using a genetic algorithm?
Hello!
I can't write a program. I can’t systematize everything in my head, I need an algorithm for writing code. I'm probably wondering how to do this:
z = sqrt(3 * x * x - 5 * y * y)
Answer the question
In order to leave comments, you need to log in
In step 2 (one of the possible scenarios) - for an array of 10 elements:
2.1. apply x and y to your function
2.2. sort function values,
2.3. leave the 3 best ones (let's call them A, B, C)
2.4. create 3 new random mutations A', B', C'
2.5. create 3 more new ones by crossing AB, BC, AC
2.6. create 1 more new one completely by accident ("fresh blood")
In total, we got 10 elements again.
Repeat steps 2.* until the best value A of the previous run differs from the best value A of the current run by no more than 0.00001 (user-defined).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question