 Hi, welcome to another Optoplanar video. This time we're going to look at the dinner party example, where we're going to try to host the perfect dinner party for our single friends. So we're going to invite 144 guests and divide them over 12 tables. So there are 12 persons at each table. There's an equal number of females and males. And so we're putting them in a male-female order at the table. So for example, this is the first table, this is the second table, this is the third table, and so forth, right? And we have 12 of these tables. And as you can see, we're putting them in a male-female order. So here we have a male, female, male, female, male, female, and so forth sitting around this table. Now, dinner itself would be pretty simple, because we could just take any male and put them on the first seat, put any female, put her on the second seat, and so forth, right? And we have a number of constraints to make sure that the dinner party is interesting for all of our guests and that there are stimulating conversations. So first of those is that on each table, we want to have two, of each profession, we want to have two guests there. So for example, we want to have two doctors on this table. So here we have Matthew and Michael on this table. And we want to have two politicians, Sophia and Lily, two coaches, two developers, two teachers, and two socialites, right? And that is the first condition. And then if there are certain types of professions, we want to make sure that they are not the same subtypes. For example, if they are both coaches, sport coaches, we want to make sure that they're the different kinds. So we have a football and a basketball here, a coach, and for example, for the developers, we have a python and a Java developer here, so it's not the same kind. And similarly for the others, there's two exceptions there. For teachers and for socialites, it doesn't matter if they're actually the same type. But for the other conditions, for the other professions, we do want to make sure they are different type, different subtype. Okay, so that's the first constraint. As you can see, and as you can see, the job of each guest is its background color. So the doctors are yellow, and the politicians are light green, and so forth, right? Now, what they also have, each of the guests is a hobby, which has nothing to do with their profession, of course, hopefully for them at least. And what we have is that, for example, plays poker and plays chess, and then for example, Sofia plays chess and so forth. What the other constraint is, is that we want to make sure that people that sit next to each other, guests that sit next to each other, that they have the same hobbies. So for example, that they share at least one hobby. So for example, Matjou loves chess, and Sofia loves chess too. And his other neighbor, Sarah, also loves chess and so forth. So that's a good seating arrangement, right? Here we have Adam, who has a lot of hobbies, but one of them is chess, so he can sit next to Sofia, who loves chess, and another one is motorcycle, so he can also sit next to Lily, who loves motorcycles. As you can see, we have about five hobbies in this set. So tennis, chess, motorcycles, poker, and golf, yes. Okay, that works out nicely. Then we get the solution like this, but maybe we want to add some extra constraints. And I have to find a few extra constraints in the decision table in this case. These are the extra constraints. Now, let me just go down a little bit. So the extra constraints is the first one that Matjou and Sofia don't get along. So if there's a guest by the name Matjou, and he's sitting next to a guest by the name of Sofia, then we have a score of minus one. So they don't like this. And you can actually see that if you look at the score here at the bottom, you can see that this is bad. We are losing one point because Mat and Sofia are sitting next to each other. All the other constraints are, by the way, in this version already met. All the negative constraints, at least. So another one is that Ali dislikes politicians. But in this case, Ali is not sitting next to politicians. I don't recall where she exactly is, but she's not sitting next to one. Then, of course, Democrats and Republicans don't get along. So those politicians, we don't want to sit them next to each other either. They all will be on the same table, of course, because you won't have one of each type on every table. They just won't sit next to each other. Then the last one here in this decision table set is actually a positive constraint. So we're saying that Eva likes French teachers. So she really wants to sit next to French teachers. So here we have Eva. And you can see that she's sitting next to Michael and Eva. But none of them are a teacher and especially not a French teacher. So let's take a look. We are French teachers. Here we have a science teacher, an English teacher. But if we look around, we can actually find over here, Kylie is one of the French teachers. So she probably wants to sit next to him and so forth. And if we get her to sit next to one of those, then we get 10 points for every time we are able to do this. So let's take a look. Let's try to restart the thing with the new rule, with those extra rules. So here we have our 12 tables again. They're still empty at this point in time. We're going to solve them. We're going to give it a little bit of time. You can see how the score improves as we give it more and more time. So now we have a pretty good dinner party seating. And if you give it a little bit more time, you'll see that score improves even more. And here we go. We have a great dinner party seating. It's not yet perfect though. So because we have a positive score, all of the negative constraints are met. And of the positive constraints, there's also one met. That's where we get those 10 points. That's because Eva is actually sitting next to one of the teachers. Now let's see if I can find Eva. Oh, okay. We just switched to the perfect solution, actually, where Eva is sitting next to two French teachers. And there are only two male French teachers. So that wasn't too easy to get that done, keeping in mind all the other constraints too, right? Let's take a look where is Eva. Oh, here we have Eva. And you can see she's sitting next to the male French teacher and also next to the other male French teacher. Okay. So this is the dinner party example. So, and of course we can change the rules and so forth. And to get the party that specifically somebody specific host would want, of course, right? It depends on how the host wants to organize and optimize his dinner party. But the thing we can learn from this is that autoplanet can not only organize your business more efficiently, it can also organize your dinner parties more efficiently. So if you want to learn more about Autoplaner, an open source planning engine in Java, just go to optoplaner.org. And if you want to try this example, just download the example zip and you can easily try this example. Thanks for listening.