Constraint concerning the maximum of a set of variables

28 views
Skip to first unread message

Xu Wang84

unread,
Feb 18, 2014, 12:02:19 PM2/18/14
to yal...@googlegroups.com
Hi, 
I was wondering if I am able to write a constraint with description of the maximum of a set of variables. 
E.g. :
Y <= max(X)
where X is an array of variables. 
Thanks a lot.
Xu

Johan Löfberg

unread,
Feb 18, 2014, 12:04:44 PM2/18/14
to yal...@googlegroups.com
Yes, but it is a nonconvex constraint and will lead to a mixed-integer problem

Xu Wang84

unread,
Feb 18, 2014, 4:31:16 PM2/18/14
to yal...@googlegroups.com
Does it solve though?

Johan Löfberg

unread,
Feb 19, 2014, 12:56:02 AM2/19/14
to yal...@googlegroups.com
You never know. It is an integer program so it can be anything from trivial to unsolvable

The following MILP is not solved by any MILP solver. 
intvar x1 x2 x3 x4
sdpvar r1 r2 r3

obj = 2*x1+2*x2+2*x3-3*x4;

C = [2*x1+x2+x3-2*x4-2*r1 == .1;
     x1+2*x2+x3-2*x4-2*r2 == .1;
     x1+x2+2*x3-2*x4-2*r3 == .1;
     2*x1+2*x2+2*x3 >= .1
     0 <= [r1 r2 r3] <= .9];
 
 solvesdp(C,obj)

Make sure your variables are bounded so your big-M formulation of the nonconvex max operator works
Reply all
Reply to author
Forward
0 new messages