Constraints on the genes of a chromosome of multi-objective Genetic algorithm (gamultiobj)

1 view (last 30 days)
I'm using the multi-objective GA in matlab and I have to put constraints on the members of the population as follows: let x be my population vector; its size is 1x192. The constraint is that
sum(reshape(x,6,[]))<=40.
How can I include this in the linear constraints specifications of gamultiobj?

Answers (1)

Alan Weiss
Alan Weiss on 28 Mar 2013
You need to write this as a linear inequality of the form
A*x <= b
If I understand you correctly, sum(reshape(x,6,[]) is a 1-by-32 vector. So I am not sure what you mean when you say the value is <= 40. Do you mean each value is less than 40, or the sum of the values?
In any case, you either have one inequality or 32 inequalities that you need to represent as A*x <= b. The matrix A will either be a row vector of 192 elements, some of which are zeros and some are ones. Or it will be a 32-by-192 matrix, again consisting of zeros and ones. b will be either the scalar 40, or will be a vector of 32 elements, probably consisting of all 40s.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  1 Comment
Bramer
Bramer on 29 Mar 2013
Thanks. I meant each value of the sum vector to be less or equal to 40. So I'll have to create a 32-by-192 inequality matrix. I think I tried that when running gamultiobj from the command line and it causes a huge time difference between the start of optimization.(with no inequalities time between pressing enter and pop-up of plot=5s,with equality matrix>3min).
I haven't waited for it beyond 3 minutes. At this time I aborted the operation and a message is then displayed at the command prompt telling me it interrupted at a subroutine for QR factorisation,if i remember correctly. Is there a problem there or should I let the algorithm run?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!