2

I'm working since few weeks now on a project really interesting but unfortunately with a very complex background.

I already asked 3 questions :

in both of them, I get my answer (thank you again @Amit) but now arrived the final part, who will make this project useable :)

I for now can manage :

  • N time-intervals.
  • C courses.
  • T teachers.
  • S rooms.

My constraints are the follow:

  • 2 teachers cannot be in the same room in the same time.
  • 2 courses cannot be in the same room in the same time.
  • Teachers can teach only specific courses.
  • Some courses can happen only on specific time-intervals.

So this is for now, my result :

Illustration of my final output for now

But here comes the final part that I want to add : I want to manage group of students, with the following constraints :

  • A group has only some courses to do.
  • 2+ groups can be in the same room in the same time only for specific courses (like Magistral course for example)

Again, I success to isolate the constraint, but I have no idea on how to transform this constraint into a "time-intervals should not overlap" constraint.

Thanks in advance, Best regards,

Community
  • 1
  • 1
Valentin Montmirail
  • 2,594
  • 1
  • 25
  • 53

1 Answers1

1

Since a student can only be in one place at a time:

Lectures for courses attached to the same student group should not overlap in time.

Edit:

There should be no constraint on different student groups overlapping. If you have such a constraint you should remove it!

The constraints are on courses. If you schdeule a lecture for course A, then it may not overlap a lecture for any other course for the student group(s) that attend course A. It may also not overlap any other course held by the same teacher.

So, you have a many-to-many relationship between students and courses and a many-to-many relationship between teachers and courses.

You want to schedule a number of lectures for each course with the constraint that no teacher and no student has overlapping lectures.

Regarding

2+ groups can be in the same room in the same time only for specific courses (like Magistral course for example)

If the groups may not mix, then it is not the same course (even though the subject may be the same). So if two student groups can not mix for Java, then you need to model it as two separate courses, Java group1 and Java group2.

Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82
  • the problem is : in some course (like magistral courses) 2+ groups of students can be in the same time in the same room... which is the difficulty.. :/ – Valentin Montmirail Mar 25 '15 at 15:03
  • Ohhh *-* indeed this representation can avoid any other problem. If I have the course Java CM, this course has to be scheduled somewhere, and the 2+ groups will attend it. if I have the course Java Grp1, then it's a different course than Java CM... That's what you mean, right ? – Valentin Montmirail Mar 25 '15 at 15:26
  • Yes. A real course, `Java 101`, may have to be separated into several "courses" in your system: `Java 101 - common lectures` for the lectures where all students attend, and `Java 101 - group1` and `Java 101 - group2` for the lectures in smaller groups. – Klas Lindbäck Mar 25 '15 at 15:32
  • I will try this solution, but I don't see any reason why it shouldn't work :) thank you so much. I spend so much time finding constraints with @Amit, that I don't even think anymore about splitting course into sub-courses :) – Valentin Montmirail Mar 25 '15 at 15:34