The first step is to forget about GAs. After that it is
a matter of convenience whether to choose a graph flow
computation algorithm (Dijkstra's algorithm?) or a brute
search. Graph flow analysis is a bit trickier to implement,
but will run the fastest. Brute searches are easy to
implement but will take the longest to run.
You have 18 swithches, each will be open or closed, meaning
there are 2^18 = 250000 combinations all in all. That's not
an awful lot, these days. Assuming that it takes less than
10 ms to compute the fitness of one topology, the brute
search will take less than an hour.
Rune
Thanks a lot! Since I don't have experience in any of them I
have to read about them and see if they can be applied to
the problem. However, the small search I did in wikipedia,
the Dijkstra's algorithm don't seem the right one.
There might be some specialized algorithm available in
the field where your network originates. You might want to
run some tests and see how long it takes to do the computations
for one case, to see how long a brute search will take.
Try and take the time of a loop which computes 100 or 1000
cases, and compute the per case average.
Rune
Well, the 2^18 cases are actually much more, because for
each case, in order the topology to be valid, adjustments to
39 transformers can be made. Those adjustments are discrete
of +/- 8 steps, which means 17 possible changes for each
transformer. For this part of the code GA is also used in
order to find the best adjustment. Now I think it's clear
that it is not possible to test all the topology candidates
and why GA was selected.
> Well, the 2^18 cases are actually much more, because for
> each case, in order the topology to be valid, adjustments to
> 39 transformers can be made. Those adjustments are discrete
> of +/- 8 steps, which means 17 possible changes for each
> transformer. For this part of the code GA is also used in
> order to find the best adjustment. Now I think it's clear
> that it is not possible to test all the topology candidates
> and why GA was selected.
Then you need to profile the code and see where it spends the
most time. Mind you, I've seen GAs run literally for weeks without
producing useful results, so it is always the question when
to abort the GA - maybe it will find the ideal solution if it
is allowed to run for another hour. Or day. Or month.
There is just no way to know.
Rune