The standard CPLEX interface does not recognize most logical constraints. There is only an exception for "indicator" constraints that have the general form
binaryvar = 0 ==> linear-constraint1 else linear-constraint2
and simple variations of this (such as with binaryvar = 1). The linear constraints in this form cannot contain piecewise-linear expressions. Also this form does not allow constraints like
sum {t in 1..k} y[i,j,t] = 0 ==> ...
since in general the expression to the left of the ==> operator will not have the simple form binaryvar = 0.
To use the standard CPLEX interface, you'll have to think about how to linearize these constraints. For the left-hand side you could define a binary variable that is 0 if sum {t in 1..k} y[i,j,t] = 0; for the right-hand side you could substitute a variable for the piecewise-linear expression and then add a constraint to define that variable to equal the piecewise-linear expression.
Alternatively you could experiment with the IBM ILOG CP interface described at www.ampl.com/NEW/LOGIC; if you set
option ilogcp_options 'optimizer cplex';
then you can send more general logical expressions to CPLEX. In that case you are relying on CPLEX to do more reformulations automatically, which may or may not be better than doing the reformulations directly in your model.
Bob Fourer
From: am...@googlegroups.com [mailto:am...@googlegroups.com]
On Behalf Of jinh...@gmail.com
Sent: Saturday, December 7, 2013 10:49 PM
To: am...@googlegroups.com
Subject: [AMPL 7787] Logical constraints and piecewise linear constraints
--
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.
For more options, visit https://groups.google.com/groups/opt_out.