Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Repartition and Timetabling Problem

    Posted Sun December 16, 2012 10:00 AM

    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++)
    {
    c2c2_size-2.setCoef(y_iji*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++)
    {
    c2c2_size-1.setCoef(y_iji*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++)
    {
    c2c2_size-1.setCoef(y_iji*N_VG_st +j,1.58-VG_Fr[j]);
    }
    }
    #ConstraintProgramming-General
    #DecisionOptimization


  • 2.  Re: Repartition and Timetabling Problem

    Posted Mon December 17, 2012 06:53 AM

    Originally posted by: SystemAdmin


    Hello,
    You do not mention which engine you are using to solve your problem. Is it CPLEX or CP Optimizer?
    If it is CPLEX, I suggest you post your message on the CPLEX Optimizer forum (http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2059).
    This being said, if I understand well, you say that in some cases, the solution found by the engine is such that some students are not assigned any class. It probably means that you are missing something in the formulation of the constraint "all students must be placed in a class".
    Do you say somewhere that a given student cannot be placed in more than one class ? Could it be that some students are not allocated any class because some other students are allocated several classes ?
    Philippe
    #ConstraintProgramming-General
    #DecisionOptimization


  • 3.  Re: Repartition and Timetabling Problem

    Posted Mon December 17, 2012 08:28 AM

    Originally posted by: SystemAdmin


    Hello,
    Thanks a lot for your answer. I use CPLEX for solving this problem (thanks for the link!).
    Otherwise, I indeed say that a student can be placed in at most one class and that the number total number of students placed in classes should be equal to the total number of students...
    I never have a student which is placed in several classes so the problem is unfortunately not there :(.
    #ConstraintProgramming-General
    #DecisionOptimization