Originally posted by: NguyenHuuTRi
Hi,
Thanks for your solution.
I am putting two more varaibles for timeslot and lecturer. I wonder if we have any other ways to reduce the number of variables as it generates 60.000 if we use 4 parameters. This is my model:
range course=1..20;
range room=1..25;
range lecture=1..10;
range timeslot=1..12;
tuple pairs {
int course;
int room;
};
setof (pairs) course_room={<c,r> | c in course,r in room};
dvar boolean x[course][room][lecture][timeslot];
maximize
sum (c in course, r in room, l in lecture, t in timeslot) x[c][r][l][t];
subject to{
forall (l in lecture, t in timeslot)
sum (<c,r> in course_room) x[c][r][l][t]==1;
};
Thanks so much.
Best regards,
#CPLEXOptimizers#DecisionOptimization