I have a VRP code in AMPL and want to write it in GUROBI-C#. Here is the constraint in AMPL:
subject to cons2{j in customer}: sum{i in nodes: i<>j} x[i,j] = 1;
and here is my code in C#, but it is still not working:
//constraint 2
for (int j = 1; j < DC1; j++)
{
GRBLinExpr sumI = 0.0;
for (int i = 0; i < DC1; i++)
if (i != j)
{
sumI += x[i, j];
}
model.AddConstr(sumI, GRB.EQUAL, 1.0, "C1.2");
}
I have not see example when i<>j
is used in C#, if anyone knows please help.
Thank you