taking the help of the hall) - page 7

 

Unfortunately, I'm not a mathematician, I didn't quite understand what you wrote at the beginning of this page. If we talk about my problem, there is a set of seven vectors, we need to find all possible combinations of elements of these vectors, giving a total of 256.

 
Has anyone ever wondered why the topic-starter and Vitaly would want to solve this problem - and with all the options?
 
I don't know what it is for. I was asked to formulate the condition of the problem, plus I am curious how such a complicated problem can be solved with the help of the GA.
 
Mathemat:
And has anyone ever thought why the topicstarter and Vitaly need the solution of this problem - and with all variants?

I have given it some thought. And I have expressed that I don't see the practical point.

vitali_yv:

I do not know why the TC. I need it because I was asked to formulate the conditions of the problem and I wonder how GA can be used to solve such a complex problem.

Oops. And I, on the contrary, thought that you are the topicstarter. :[

Then everything is cancelled. We are waiting for the mysterious creator of the mysteriously unnecessary problem.

 
Well why cancel it? Let me make a special topic for you with my condition, if you want to solve it only if I am the TC )
 
vitali_yv:
Why is it cancelled? Let me create a thread specifically for you with my condition, if you only want to solve it if I am the TC )

No need to start a new branch. There is already a branch of Alexei for this. All variants of the problem listed here are solved with GA.

Still, I'd like to hear from the head of the transport department.

 
There you go, and you were promised a mountain of gold.
 
vitali_yv:
Here we are, and they promised a mountain of gold.
A solution will be presented in the evening.
 
vitali_yv:
A =  11    12    16    19    23    25    26    27    29    34    37    38    43    46    48    58    59    62    64    73
B =   2     3     7     9    11    16    18    31    32    33    41    42    43    47    53    54    60    61    64    81
C =   7     9    15    22    24    25    27    28    29    34    42    44    46    52    53    64    66    67    68    70
D =   1     5     4    15    18    19    24    32    34    39    42    46    47    48    49    60    61    68    72    77
E =   9    12    19    21    24    27    29    35    43    45    46    55    58    61    64    65    66    68    71    82
F =   6    11    12    22    26    32    42    48    52    54    58    61    64    65    72    83    84    87    94    97
G =   4     9    14    15    19    26    35    37    39    40    45    48    52    53    59    63    67    70    74    76

A + B + C + D + E + F + G = 256

Well, let me give you an assignment. You don't know if the values in the variables are repeated, so let's say they are. The problem is simplified to 7 variables, 20 variants.

Well, problem solved. One of the solutions is this:

64+11+9+24+24+72+52=256


Promised source code for solving this problem and others like it attached.

There is only one little detail. The algorithm is developed for problems in which variables are strictly unique and their permutation in an expression is not allowed, for example for such function:

f(x,y)=x*x+y.

It is quite clear that the values of x and y cannot be interchanged, otherwise the value of the function will change. That's why only chromosomes of the following types are considered to be absolutely identical

3,9,8,7,4,5,3 и 3,9,8,7,4,5,3. If chromosomes of the type 3,9,8,7,4,5,3 and 3,8,9,7,4,5,3 are compared, they are considered to be completely different chromosomes.

So my algorithm is not suitable for finding all solutions of the above-mentioned types of problems, where "rearranging the places of addends does not change the sum".

For this reason, after a single run of the algorithm, it is possible to get only one solution variant, not all of them. One of the solutions I gave above.

In order to make the algorithm applicable for such types of problems, you should introduce the optionally included rule "the sum does not change when rearranging the places of addends" and treat chromosomes like 3,9,8,7,4,5,3 and 3,8,9,7,4,5,3 as duplicates.


The source code is written in MQL5.


PS What kind of millennia were you talking about to solve the problem? :)

Files:
 
Very interesting, it's a pity that not all the options are available. It's hard to compare. Respect.
Reason: