# Constraint definition among the variables for Genetic Algorithm (GA) Optimization

3 views (last 30 days)
Karthik Vemireddy on 29 Nov 2011
Hello Everyone,
I'm trying to use multiobjective genetic algorithm to identify various parameters for my models. I have a problem in defining the constraints between the variables. If v1,v2,v3 etc.,are the variables, then I want to define constraints like v1>v2>v3...
Could anyone help me out with this?
Thanks and Regards, Karthik
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

### Answers (2)

Alan Weiss on 30 Nov 2011
The syntax for gamultiobj includes linear inequality constraints: X = gamultiobj(FITNESSFCN,NVARS,A,b) If v is your vector of n decision variables, and you want v(1) > v(2), v(2) > v(3),...,v(n-1) > v(n), set your A matrix as
v = zeros(1,n);
v(1) = -1;v(2) = 1;
A = gallery('circul',v);
A(n,:) = [];
b = zeros(n-1,1);
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

Karthik Vemireddy on 2 Dec 2011
Thank you Alan.....
Meanwhile I have found another simpler solution. It's described in the following link in detail...
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

### Categories

Find more on Genetic Algorithm in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!