Directly or indirectly, disjunctions require the introduction of binary variables (or an equivalent adjustment of the branching mechanism) and force an LP to become a MILP. I'm not sure if there is a way to write a disjunction in AMPL and have it automatically converted to indicator constraints or have binary variables automatically introduced, but the above is how we old-timers do it. :-)
The standard AMPL/CPLEX interface will accept certain kinds of logical constraints, but only if they are "indicator" constraints that have one of the two forms
<binary-var> = 0 ==> constraint
<binary-var> = 1 ==> constraint
where ==> means "implies", or equivalent constraints using <== or <==> in the obvious way. Thus you could formulate your constraint as
var xind {i in 1..nb_rect, j in 1..nb_rect} binary;
var yind {i in 1..nb_rect, j in 1..nb_rect} binary;
subj to xindDefn {i in 1..nb_rect, j in 1..nb_rect}: xind[i,j] = 1 ==> x2[i] <= x[j];
subj to yindDefn {i in 1..nb_rect, j in 1..nb_rect}: yind[i,j] = 1 ==> y2[i] <= y[j];
subj to borderCheck {i in 1..nb_rect, j in 1..nb_rect}:
xind[i,j] + xind[j,i] + yind[i,j] + yind[j,i] >= 1;
Alternatively you can use the borderCheck constraint as you wrote it, by sending your model to the "ilogcp" interface to CPLEX -- see www.ampl.com/NEW/LOGIC for details, especially the "IBM ILOG CP with CPLEX" section.
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of Jean Respen
Sent: Thursday, May 16, 2013 5:30 AM
To: am...@googlegroups.com
Subject: [AMPL 7023] Problem with AMPL and logical constraint _slogcon[1] is not an indicator constraint
Hello all,
The following constraint:
subject to borderCheck {i in 1..nb_rect, j in 1..nb_rect}: x2[i] <= x[j] or x2[j] <= x[i] or y2[i] <= y[j] or y2[j] <= y[i]; (where x,x2,y,y2 are variables)
returns the following error from Cplex:
CPLEX 12.5.0.0: logical constraint _slogcon[1] is not an indicator constraint.
I read a few posts on this message, but can't find a workaround... Any idea?
Thanks, cheers,
Jean
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
--
--
subject to CONVEXITY {i in conv_bid_sets} :
sum {j in start_index[i]..end_index[i] }
(X[j])<=1+eps;