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
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…