I am attempting to solve a simple problem using GA.
My problem has 8 decision variables, all integers, with lb of zeros and ub of TWOS.
I need to ensure that the sum of the variables is always equal to 2.
Therefore I used ga with the following set up:
[x,fval,exitflag,output] = ga(@(x)ObjFun,nvars,A,b,[],[],lb,ub,[],IntCon,opts)
I am writing A and b so that an equality condition is enforced (A(:,2)=-A(:,1) and b(2)=-b(1))
I am solving this simple problem to test the convergence and reliability of ga in a simplified version of my actual problem, before jumping to the real monster.
This problem has 36 possible combinations results. They are:
Comb=[00000002,00000011,00000020,00000101,00000110,00000200,00001001,00001010,00001100,00002000,00010001,00010010,00010100,00011000,00020000,00100001,00100010,00100100,00101000,00110000,00200000,01000001,01000010,01000100,01001000,01010000,01100000,02000000,10000001,10000010,10000100,10001000,10010000,10100000,11000000,20000000]
I solved them all outside of GA and all the possible results (objective function results) are:
R=[97.23,86.40,109.57,93.80,94.21,97.67,89.55,89.75,85.00,95.27,93.71,94.11,94.65,90.41,97.55,88.71,88.81,89.54,85.25,84.12,93.78,93.26,93.61,94.14,89.88,94.07,88.99,97.17,89.43,89.60,90.22,85.84,90.17,85.09,84.29,93.70]
as a student working on research I am trying to get a stable, reliable and fast optimization code to start with those smaller versions of my problem and then build into the big one.
using GA, with all default options, I get no convergence with an exitflag of -2.
however, if I increase the population size (default is 10*8) to 100, 200... I start getting convergence of an exiitflag of 1. HOWEVER, that depends on how I set the RNG.
using 400 population works for all RNG I have tried. but this means that for my actual problem, that will be a lot more complex, I will need such a large population that the problem will take forever to solve. That's my intuition.
so my questions now are:
1) are there other GA options I should try to have a fast and reliable code, given this example and al these conditions?
2) is it possible to use patternsearch enforcing integer constraints for This problem that I am solving?
however, even setting those options, matlab goes to non-integer decision variables in the second interation.)
Thanks for anyone that took the time to read all this,
Conrado