Originally posted by: SystemAdmin
Hi,
I'am doing a project consisting in finding a repartition of students in classes and a timetable. My problem is that though I write a cardinality constraint saying that all students must be placed in a class :
c2.add(IloRange(env, -IloInfinity, N_VG_st));
c2.add(IloRange(env, N_VG_st , IloInfinity));
c2_size++;
c2_size++;
for (int i=0 ; i<N_MC_VG; i++) //We sum over all students in all classes
{
for (int j=0 ; j<N_VG_st; j++)
{
c2
c2_size-2.setCoef(y_ij
i*N_VG_st+j, 1.0);
}
}
for (int i=0 ; i<N_MC_VG; i++) //We sum over all students in all classes
{
for (int j=0 ; j<N_VG_st; j++)
{
c2
c2_size-1.setCoef(y_ij
i*N_VG_st+j, 1.0);
}
}
Playing with constraints that have strictly nothing to do with the total number of students I sometimes loose 1 or 2 of them... Could anyone tell me what can be the problem in such situation please? The constraints I play with deals the average level in French, German an Maths for example :
//French Average
for (int i=0 ; i< N_MC_VG ; i++)
{
c2.add(IloRange(env, -IloInfinity, 0.0)); //Lower bound for the french average in a class
c2_size++;
for (int j=0; j< N_VG_st ; j++)
{
c2
c2_size-1.setCoef(y_ij
i*N_VG_st +j,1.58-VG_Fr[j]);
}
}
#ConstraintProgramming-General#DecisionOptimization