Mostafa
Mostafa

Reputation: 113

How to add Equality constraint in Cplex using Matlab?

I am implementing a scheduling model in Cplex using Matlab. The model is a flow shop model, and is as follows:

Flow shop model

where z_{j,i} are binary and s_{r,i} are integers. Also, p_{r,j} are problem data. I am trying to write the first two constraints, that are in the form of equality, and using cplex.addRows. But I don't know how to specify that these constraints are in the form of equality, rather than less than or equal.

As far as I know, cplex.addRows(lhs,A,rhs,rowname) does not have the part sense to specify this.

Upvotes: 0

Views: 263

Answers (1)

Alex Fleischer
Alex Fleischer

Reputation: 10059

Have you tried to have the same lhs and rhs?

In the example lpex3.m you may see

%   minimize  c*x
%   subject to  Hx = d
%               Ax = b
%               l <= x <= u

and in the model

cplex.addRows(b, A, b);

Upvotes: 1

Related Questions