Originally posted by: mido199
Hello,
I am using CPLEX 12.8 to solve a MIP. My model includes constraints of time windows like the ones in the classical transportation problems. In my model, I create time variables (corresponding to arrival times at customer nodes) then add time windows constraints on each variable. When I solve the model with CPLEX and check the lp (output model), I find that not all time windows constraints are added to the model. Constraints on some variables are ignored. Here is the code that I use to set the bounds of time variables:
t = IloNumVarArray(env, (int)prob->GetNodeCount(),0, depot->tw_end,ILOFLOAT);
for(int i=0; i< s.GetDriverCount(); i++)
{
Driver * d= s.GetDriver(i);
Node * prev = s.GetNode( d->StartNodeID );
while(prev != NULL)
{
t[prev->id].setBounds(prev->tw_start, prev->tw_end);
char name[40];
sprintf(name,"t%d",prev->id);
t[prev->id].setName(name);
Node * next = s.Next[ prev->id ];
prev = next;
}
}
for(int i = 0; i<request_to_insert->GetNodeCount(); i++)
{
Node * n = request_to_insert->GetNode(i);
t[n->id].setBounds(n->tw_start, n->tw_end);
char name[40];
sprintf(name,"t%d",n->id);
t[n->id].setName(name);
}
Could you please help in this situation ?.
#CPLEXOptimizers#DecisionOptimization