MATLAB: Genetic algorithm – Thousands of variables

genetic algorithmGlobal Optimization Toolboxmatrixnonlinearoptimization

Hello,
I am using Matlab's Genetic Algorithm from the Global Optimisation Toolbox to solve a multi-period Non-Linear constrained problem.
Let me try and give you a bit of a background for the problem: Basically, I have the heat and electricity demand of a building for 8760 hours of a year. I have 5 (or more) pieces of kit that can supply this demand and depending on the pricing I would like to find out what is the most optimal use of each technology for each single hour of the year. The objective is to minimize the annual cost.
So, for a single hour I would have 5 variables corresponding to the consumption of each piece of kit. However, as I said this problem is multi-period which means that the number of variables is actually multiplied by 8760 => reaching the number of 43800.
My question therefore is:
Can I somehow define these variables in any other form other than a single vector? For instance a matrix of 8760×5 would be much easier to comprehend and use to construct equations.
I know for instance that when using fmincon data can be passed as a matrix, taking some care of the A, Aeq matrices etc. Something that is very nicely illustrated here: http://www.mathworks.ch/matlabcentral/newsreader/view_thread/323075
Is there something equivalent I can do?
Note: I want to use the GA toolbox, because I will be extending the model by adding a few integer variables in future formulations. Hence, I cannot move to fmincon.
Thanks in advance,
George

Best Answer

I think that you are unlikely to obtain a satisfactory answer from GA with that many variables. GA is a random search algorithm, and searching more than a few hundred variables takes a long time. You would need to take a population of at least twice the size as the number of variables, and that alone will cause the iterations to be very slow. Furthermore, the GA nonlinear constraint algorithm takes a large number of iterations for constraint satisfaction, making the problem seem to me to be unlikely to yield a satisfactory result in a reasonable time.
I wonder if you can formulate the problem for fmincon, and then, if you have just a few integer-constrained variables, do an exhaustive search over the possible values of the integer variables.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Related Question