thank you for your reply Bob.Please find the attached model file.
--
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.
Since X is a binary variable, when using CPLEX you can write constraints c3 and c4 as
subject to c3 { i in 1..n, j in 1..n : i<>j} : X[i,j]=0 ==> Cnew[i] = C_old[i];
subject to c4a { i in 1..n, j in 1..n : i<>j} : X[i,j]=1 ==> Cnew[i] = C_old[i] + C_old[j];
subject to c4b { i in 1..n, j in 1..n : i<>j} : X[i,j]=1 ==> Cnew[j] = 0;
Something must be wrong with the c1 and c2 constraints, however, since they fix the values of all of the X variables according to the given values of param d, and thus fix the objective value and all the Cnew values -- leaving nothing to optimize.
In general, the if-then construct is used to specify expressions in AMPL, but not constraints.
Bob Fourer
--
i set the constraint c1 but i have the same problem
Please post your model and data again so that we can be sure we are looking at the current version.
Bob Fourer
am...@googlegroups.com
From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of Wafa Lakdhar
Sent: Monday, August 29, 2016 6:08 AM
To: AMPL Modeling Language
Indeed, but in your example X[1,2] = 1 and also X[2,1] = 1, and in that case I cannot see any way to obtain a feasible solution to your if-then conditions.
Bob Fourer