 Welcome to the course-time-tabling example in OptaPlanar. In this use case, we'll be assigning courses, a time, and a place. For example, the MAT course, which exists out of three lectures. This is MAT 0, MAT 1, and MAT 2. It needs to be assigned a place, so this is a room, and in this case, we've assigned all three lectures to the room 36, and a place, and a time, and the first lecture of the MAT course, so MAT 0, we've assigned this to the Monday morning, the first lecture of the day. And the same thing, and for MAT 1. So the second lecture, we've assigned the second period on Monday, and for MAT, the last MAT lecture, we've assigned it on Wednesday on the second period of that day. Now you can guess the first hard constraint in this case, is that no two lectures should be given in the same room at the same time, and you can easily see that we have a feasible solution for that constraint, at least, as the one we're showing here. So let's scroll to the right, and you can see that in no place, two lectures are actually being given in the same room at the same time. But there's a different point of view that we can look at this data set. Let's take a look at it from the teacher's point of view. So these are the same lectures, but now we're showing for each lecture which teacher is giving him, or is giving that course. And you can see, for example, that the French course is being given by teacher 10. These names, real names, have been sophisticated. And this is the first course is on a Monday, the third period there, and then the second one is on a Tuesday, the third period, and so forth. Now, if we look into this set, we will actually see the math course in here too, which is given by teacher 25. And you can see that it's, of course, at the same periods as we've seen them in the rooms. So if we would change the math course to a different period, it would both affect the rooms and the teacher's view because they would actually change in both the views. You can also see that this teacher is giving another course. And you can see that in this case, none of the teachers have to give two courses at the same time. So that's our second hard constraint. There shouldn't be no conflicts for the teachers. And that's, of course, a third way we can look at this, and this is from the curricula. So a curriculum is a group of students and they follow a number of lectures. So let's look for a math course again. Here's our math course. And the thing is that multiple curricula can follow the same lecture. So in this case, the math lecture is actually followed by three curriculums, so curricula. So this group of students is joined by this group of students, is joined by this group of students in that lecture. And of course, in one curriculum, there is a natural hard constraint that in one curriculum, no two lectures should have the same period. So it should be possible for the students to attend all of their lectures. Now, if you look at this, in this case, we can actually see there's one violation here. So on the Monday, on the fourth period, you can see that we're using more space there and that's because if we scroll down, we can actually see that this lecture and this lecture are given at the same time, but they actually share a curriculum. Actually they share three curriculums, as you can see. That also explains why at the bottom we see minus three hard constraints because three hard constraints have been broken. So let's take a look. So this is one of these lectures on the fourth period, zero fourth period. And this is one also on the zero fourth period. So that's not good. So let's try to move one of them. Apparently this lecture is in a lot of curricula, so let's move the other one and let's move it down to over here somewhere. Let's take period three, four, all right? And as you can see, we've moved this lecture down here. This is always the same lecture, it's just repeated because it's in multiple curricula. But you can see if you scroll now to the beginning that there are no conflicts in the curricula, which is good. So all the students can attend all of their classes. As we look at the teachers, this is good too. No conflicts either. All the teachers can attend all of their classes, all of their courses, all of their lectures. But if you look at the rooms point of view, then we have a problem. Then we have two lectures in the same room at the same time. So that's no good. So let's move one of these again and hope that that will actually solve, then we will finally get a feasible solution. So let's take, so we just move this one. Let's take that one, this lecture and move it to one period sooner. Great, we've just solved it over here. No more rooms conflicts. Let's take a look at the state of the teachers. Oh, the teachers are broken. Apparently two lectures at the same time for this teacher and let's take a look at the curricula and they're broken too. And actually we have now 14 hard constraints. This is not going in the correct direction. We're breaking more and more by actually when we're trying to improve stuff. So let's instead try to see what Opto Planner does. So let's just let Opto Planner solve it. As you can see in quite some, in not a lot of time it's actually gone to zero hard constraints. It's currently even improving the soft constraints which I'll explain in a minute. But you can easily see that there are no hard constraints broken, so no curricula curricula which I have two lectures at the same time and the teachers which have two lectures at the same time and no rooms which have two lectures at the same time. So this is a feasible solution. This is something we can give to our school and execute there. But as I've said, there are also soft constraints and these are the things that Opto Planner is now trying to improve even more by moving stuff around without breaking any of the hard constraints or at least not or usually only temporarily. So what is that? Well, one of the soft constraints for our several is to minimize the number of days that the lecture is being given. Another one is to compact them for the curricula. So this means that they try to sequence the lectures so they are given in sequence. The students really like this so they don't have to attend so they don't have to waste too much time. For example, to come for one hour on a Friday, they really like it that all of their lectures are in sequence on the same day. In this implementation, this doesn't happen for a teacher. There's no soft constraint which says the teachers would like that too. But it's actually pretty easy to add. You just copy paste the curriculum one and ingest it so it counts for teachers. Or you could just invent new ones like, for example, say that if a teacher prefers to give his lectures on a certain time that this system can accomplish that, that you get some soft constraints reward for that. And it will try, of course, to maximize the soft constraints. So in this case, there are only negative constraints so that's a negative number. But so it will try to analyze the penalties in this case. But if you add rewards, then it will try to maximize the rewards while minimizing those penalties too, of course. OK. That's great. We have a feasible solution. We can give this to the students and to the teachers. And we try to match with their desires as much as possible. But you might not be entirely comfortable with letting a system like Optoplanar decide when the teachers and the students are following a certain course and where that will be held. You might sometimes want to override what Optoplanar chooses for whatever reason. Maybe the boss says, OK, I want this lecture on that place no matter what. And there are several ways you can actually enforce that. One way would be to just add a score rule which says, OK, what the boss says is most important. But you can also lock things in place. And I'm going to show a locking at this point. So let's take a look at, let me just reset the data set. So we have, again, three hard constraints broken. And let's see, say, for example, that I want to have this math course on the third period of that day. So let's move that to the third period of the day. I've moved it to over here. And as you can see, OK, there are still, actually, we just broke more hard constraints by doing that. And let's say, OK, Optoplanar, you can solve it now. Look what happens to this math course. The first thing it's going to do is it's going to move it because that's not the optimal position. So yeah, that's not fun, of course, right? Because it's just undead what we forced it to do. So there's a way to fix that. And let's go to, let's load the initial data set again. And this time, let's move it again to over there. But let's lock it. You can see I've just enabled the locking. So make it a moveable during planning. As you can see, now it has a locked symbol. That basically means that Optoplanar has to stay off this. But it will still take it into account. It will still make sure that no lectures are, that there are no conflicts with this lecture. So let's see what happens if we solve it. As you can see, it takes a little bit longer now to find a feasible solution because it's annoying that this one is stuck there. But it does, and it finds a better solution to relit with regards to the soft constraints as we give it some more time. But as you can see, it is following our desire. So we can override the behavior of the planner and choose a code. I want this lecture to be given at that time, at that place, no matter what. This is a nice thing, especially if you want to say to the teacher, I can guarantee you'll have that lecture at that time. So because we might want to stop planning at this point in time and tell some of our teachers, you will be giving that course at that time. But we might get some new lectures, which we didn't know about yet that we have to plan to. So what we can then do is lock part of the solution, which we already told the teachers. And then let Optoplanar play with those new lectures and try to optimize this together with the lectures, which haven't been locked yet. So there's a lot of opportunity there. OK. So thank you for watching. And if you want to know more about Optoplanar, just go to the website, optoplanar.org.