Discussion of article "Genetic Algorithms - It's Easy!" - page 2

 
joo:

....

I have posted some interesting test functions in the MQL4 forum thread "Test Multivariable Multiextremal Function", one of them is presented in the article.

If you want, you can try to find extrema of the proposed functions using other optimisation algorithms other than GA and post the results here. You are welcome to do so. It will be interesting for everyone and for me in the first place.

....

I saw my favourite matcad.

In the article the figures are given ...21.7 seconds vs. 1.6e32 years! Have you tried to solve the same problem(test problems) by means of matcad. How much faster (slower) than MQL5 ?

 
Prival :

I saw my favourite mathcad.

The article cites figures ...21.7 seconds vs. 1.6e32 years! Have you tried to solve the same problem(test problems) using matcad. How much faster (slower) than MQL5 ?

Yes, the picture is from matcad. It is for the first problem.

And the figures are from the second task. Unfortunately, I am not so good with this matkad package, and did not use it to solve the second problem. I, like you, am also interested to know the answer to your question.

 

Just your second problem (its) solution, is necessary to solve this problem

https://www.mql5.com/ru/forum/123072/page6#254964 (very interesting thread by the way).

At one time I wanted to (combine these two problems) and calculate, look, think, but my hands as always did not reach (there is little time as always).

Оптимальные значения SL и ТР ордеров для произвольной ТС. - MQL4 форум
  • www.mql5.com
Оптимальные значения SL и ТР ордеров для произвольной ТС. - MQL4 форум
 
Prival :

It's just that your second task (its) solution, is necessary for solving this task here

https://www.mql5.com/ru/forum/123072/page6#254964 (very interesting thread by the way)

At one time I wanted to (combine these two problems) and calculate, look, think, but as always I didn't get the time (time is short as always).

Yes. Heuristic algorithms are a godsend for problems that have no analytical solution or when formalisation of the problem is difficult.

Half of the problems, if not more, for example, of this branch can be solved with the help of UGA. By the way, it is very pleasant to be the destroyer of one of the most famous trader myths related to ZZ (the second task in the article). :)

[Архив!] Чистая математика, физика, химия и т.п.: задачки для тренировки мозгов, никак не связанные с торговлей - MQL4 форум
  • www.mql5.com
[Архив!] Чистая математика, физика, химия и т.п.: задачки для тренировки мозгов, никак не связанные с торговлей - MQL4 форум
 

IMHO this article is a great contribution, but the title underestimates the content. I suspected to find a simple introduction to GA but I got already developed library to work with. Thanks!

 

On health! :)

PS Yes, and still. If I article named: "Genetic algorithms it is very difficult!", who would read it?. :)

Though also it would not correspond to true. Nevertheless, GA are simple if a little to make efforts judgement. As however, everything demands judgement, as to the markets. If we want to earn on them...

PPS I warn at once, now and subsequently I will use machine translation means. I am sorry.
 

Good article! Thanks.

But still I'll start writing the same thing myself, on OOP.
Nothing has been invented better than practice)))

 

Your search for duplicates is organised in an open form, i.e. you store all unique chromosomes, at least it seemed to me so.

That is, there is a search of chromosomes and in each chromosome is compared every gene (almost)
I wonder, if you apply some algorithm hashing chromosome, then ideally the speed of the search for a duplicate should increase, especially with a large number of genes.
Only here is left to think up or find a way to quickly and suitable for the algorithm.

Gone to dig in mathcad))))

 
mrProF:

Your search for duplicates is organised in an open form, i.e. you store all unique chromosomes, at least it seemed to me so.

It is so, all unique chromosomes are stored in a separate array - up to 100000 pieces (one hundred thousand). This is more than enough for practical tasks.

mrProF:

That is, there is a search of chromosomes and in each chromosome every gene (almost) is compared.

Not every gene in the chromosome is compared. It would be at least impractical to compare all the genes, and more foolish. The criterion of uniqueness of a chromosome is the presence of at least one different gene compared to the chromosomes in the "archive". Therefore, as soon as a unique gene is found in a chromosome, the comparison stops and the whole chromosome is recognised as unique and put into the archive for "eternal" storage.

mrProF:

I wonder, if to apply some algorithm of chromosome hashing, then by idea the speed of duplicate search should increase, especially at a large number of genes.
Only here it remains to think up or find a way fast and suitable for the algorithm.

Gone to dig into mathcad))))

I don't know - I don't know... And then I'll have to compare it with hash? :)

If you find a faster way to check the uniqueness of a chromosome, please inform me about it - I will be grateful.

 
joo:

That's right, all unique chromosomes are stored in a separate array - up to 100,000 pieces (one hundred thousand). This is more than enough for practical tasks.

Not every gene on a chromosome is compared. It would be at least not practical to compare all genes, and at most - stupid. The criterion of uniqueness of a chromosome is the presence of at least one different gene compared to the chromosomes in the "archive". Therefore, as soon as a unique gene is found in a chromosome, the comparison stops and the whole chromosome is recognised as unique and put into the archive for "eternal" storage.

I don't know - I don't know... And then you still have to compare with hash? :)

If you find a faster way to check the uniqueness of a chromosome, please inform me about it - I'll be grateful.
.

Well, that's what I meant by "almost.")))

Well comparing with one hash is faster than with 100 genes in a loop....

Here it is necessary to calculate the speed of the algorithm of direct search of genes or with comparison with hash.
If for example the number of genes is less than 20, then direct comparison, if more with hash.
Now I will dig into the ways of calculating hash, maybe I will find something fast enough and at the same time sufficient uniqueness of hash.
As I understood from reading books and articles, the removal of duplicates is not too critical, even if there will be one non-unique hash out of 100.
Most likely mutation will cover this non-unique key, if there will be a noticeable increase in speed.

True this is still only a theory, I GA second day I am engaged in only)))
In the head terrible mess, and the literature is not enough to see)))