So, welcome to the summary for Module 1 of Course 2. So, Jimmy what's been happening in the story? >> Wow, Cao Chao, finally discovered that somebody was trying to kill him. So, he tried to round up the traitors. And fortunately, our hero Liu Bei and Zhang Fei, they managed to escape. But unfortunately, Guan Yu and Lui Bei's family, they were caught. And because of that, Guan Yu had to submit to Cao Cao in order to protect the Liu Bei's family. Although Guan Yu is of great help to Cao Cao, but he's essentially under house arrest. But he also managed to send his son to go and find the whereabouts of
Liu Bei and Zhang Fei. and then later, he reunited with his brothers. >> So technically this module is all about debugging. And of course once we have like any other programming language when we're building a complex model there are going to be bugs in that model. >> Yeah. In terms of modelling the kind of symptoms we have in bugs in models would be unsatisfiability, missing solutions and also too many solutions. >> So we've seen some methods to tackle that and the first method very simple. Add assertions to the data there is nothing worse than chasing a error in your model for many hours when you actually just have an error in your data and assertions will stop you from doing that. >> We also saw the trace function which really help us to understand the behavior of iteration and comprehensions. >> Absolutely, you'll be building complex loops in, as forms of comprehensions and you can use trace to work out exactly what's going on in those >> Besides using the tools within MiniZinc, I think we also have to have a good understanding of the relational semantics of MiniZinc. That would help us to understand the behavior of partial functions. >> So this is one of the most challenging subjects for many people in the course and this is understanding how partial functions behave because when we do a division by zero or we do an array out of bounds in a normal language we do expect some kind of abort. But in MiniZinc and the relational semantics, that's basically kind of convert into failure. And we have to understand where that falseness happens and whether that that stops our model doing what we want. >> Okay Peter, what can we do when we have too many solutions? >> So too many solutions is kind of the easy case because we should really just pick one of those solutions which we expected not to see so a thing that isn't really a solution >> And we should look and find which constraint we expected to remove that solution, and so obviously if we think that this constraint should remove that solution and it doesn't, then it's being written wrongly. So, it gives us a real key as to where to look for the problem. >> Right. So, what can we do when we have too few solutions. Lets try. >> Okay. >> Okay, especially in the case when we have unsatisfiability >> I think we will suggest you to construct a smaller instance of the problem. Perhaps also try to construct a known solution and then add that to your model, as a constraint and then we will be able to examine each of the constraints in the model one by one, try to relax them and then we will be able to identify the culprit and then fix it. >> Yeah so that's the general approach that we're going to need for too few solutions. And the worst possible bug, of course, is when I run my model and it just runs forever. And that could be just because my model isn't efficient enough or the problems way too hard to get a solution. So that's bad news. Then we need to simplify our problem and see that it's working on simpler versions of the problem. >> Before we go on. >> Yeah, I think we also look at the sliding sum global. >> Yes, so we introduced a new global in this module, the sliding sum global which allows us to look at a long sequence and have some property of every small section of that sequence. >> And the last thing we did was look at various ways of improving the model. So anytime you can write down a constraint for your model, there's probably a number of ways of doing that. And we looked at which ways are likely to give a model which is easier to solve. >> Okay. The application we solved was actually the routing problem that Guan Yu had to solve to escape from the control of Cao Cao. >> Yeah. So routing is, of course, a very important application of discrete optimization. So if we look at the workshop and assignment, so the different type of workshop this week. In workshop five, you're going to be given actually a model. It's got bugs, and what you have to do is debug it. So this is one of the most challenging versions of debugging, where you're debugging someone elses' model. >> And you've seen me debugging a model that was written by Peter. >> Absolutely. So, he knew nothing about those errors. In the assignment five, again, is a different kind of assignment. We're going to actually give you a model, which actually is correct, and then what we're going to do is ask you to improve that model. So you can use all the techniques we've talked about here to make a better version of the same model. >> Okay, we look forward to seeing you at the end of the next module.