A
A
Artyom N2011-12-04 20:20:05
JavaScript
Artyom N, 2011-12-04 20:20:05

I am looking for an example of the work of a genetic algorithm

Once on Habré, an article slipped through that explained the essence of the work of the genetic algorithm. I'm looking for that particular article because of the example written in JS. The bottom line is that the background color of the page was manually set, and the table cells changed colors. In the first generation, the cells closest in color to the background were selected, from which the next generation was formed. Please help me find an article or this example.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Artyom N, 2011-12-06
@nobr

If someone else stumbles upon my question in the search results, I post here an example that I literally wrote on my knee: bungu.ru/gen/ It works, but it’s better not to look at the code :)

S
sergeyZ, 2011-12-05
@sergeyZ

habrahabr.ru/blogs/algorithm/128704/
habrahabr.ru/blogs/algorithm/122222/
habrahabr.ru/blogs/algorithm/111417/
habrahabr.ru/blogs/algorithm/114910/
habrahabr.ru/blogs/DIY/111811/

S
Sshra, 2016-12-09
@Sshra

There are quite a lot of articles on Habré on the application of genetic algorithms.
But the essence is very simple - there is a set of solutions, there is a selection criterion and methods for creating new solutions. We discard some of the "bad" solutions, and on the basis of the remaining ones we build new solutions. We discard and build again.
There is also a long version of the above :)
There is also an example on Deplhi for solving the traveling salesman problem with this method. On JS, too, there will soon be a fresh example for a simpler task.

O
Oleg Petrov, 2017-10-04
@Smeilz1

I wonder if it is possible to use genetic algorithms for such a task?
There is a faucet with water. Water can be from very cold to very hot (from 0 to 100), but we do not know exactly which one.
There are 40 factors and their combinations that influence this.
And there is a recorded history of observations on them, a very large one.
We need to find situations where the water was very hot or cold, and under what combinations of factors this eventually happened.
After all, this is essentially a search of all options with a fitness function for finding very cold and hot water.
Is it possible to use genetic enumeration here? Am I formulating the problem for GO correctly?
We set a random set of factors and run through all registered cases and see if the water was, on average, very cold or very hot in all cases.
If not, we change some factors and repeat again and see if we are moving towards Max and min or not, and thus we find those combinations of factors that give us the best indicators of "hot" and "cold"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question