That was our description about our heuristic algorithms. Mends is a process of doing evaluations. We keep asking ourselves whether we should downsize. Whenever we are trying to ask ourselves whether to do downsizing, we need to take an evaluation process back and false. Maybe. We are doing the downsizing decision, but from time to time we need to evaluate whether this downsizing or that downsizing is good. Let's take a look at the pseudocode for facility, downsizing process. Maybe that's going to give you a more concrete ideas. If you are not familiar with pseudocode you may just ignore this video, I guess. But if you have some experience about that, then this may be helpful for you. Initially, that set x to be zero, that means xjk is zero for all k. Well, we just write x is assigned to be zero. Initially x is zero, and then for each J, we set the highest possible scale level to be one. That means we open each facility at the largest scale level. Then we also set Pi star to be f of x. For start, f of x is the evaluation of a solution x. X is something that corresponds to the cost for opening facilities in this way. It certainly has the construction cost, it also has the customer service costs, and it has the hosting cost. In a function f we evaluate all these things. F somehow is estimated according to or implemented according to the idea we used in the previous page. That's something to do the evaluation. Let's assume this function has been built and the let's move on. We will keep iterating until we cannot do improvement anymore. That's how to do that. In each iteration first, let's use Pi bar to denote the current objective value, the current total cost. Therefore, each facility that see whether there is any facility whose tongue sizing is going to make us better than Pi bar. For each downsizing, we're going to evaluate the total cost. That k prime be the current scale level of facility j. This is something you know.. Then we're going to store x, the current solution to x prime, and then modify x prime to reduce the scale level for facility j by one. That you do for assigning one to facility k prime minus one, and assigning zero for facility k prime. Once you do that, now your x prime is a new solution after one option of downsizing. Then you would evaluate this particular downsizing idea. Of course, if your x already have one facility having the lowest possible scale level, then you just keep that one. Once you do the evaluation, you get Pi prime. Then once you have that Pi prime, you ask whether Pi prime is lower than Pi bar. If that's the case, then Pi prime is a good one. That Pi prime has the potential to improve the current solution. Then immediately, we would update Pi bar by Pi prime, and also record what's the current optimal solution is j with facility scale k prime. We will keep doing that for each facility. If later we can find one that is even better being the current j star, then we do the updating again. After this four loop, we will fight one facility that has the highest benefit for doing one level of downsizing. Then after these iterations, if there is at least one that can do the improvement, then we indeed invoke that improvement and also update the Pi bar to be the next Pi star, and then we keep iterating and iterating. There's only one thing that we need to do to make this happen, is that your f function when it does the evaluation? It should either returns the total cost, or if the Pi prime is actually, infeasible, then it may be designed to return infinity, or a very huge number. Then it's not going to replace whatever Pi bar you have, then is in some sense effective. We don't aim to train you to write pseudocode in this course. This course is about mathematical modeling. We don't really need to train you about algorithm design or whatever. At least it's not that the core for this course, but here I want to show you the pseudocode for our upper level facilitate downsizing strategy. Just to give you a concrete idea about maybe we are running this process, and from time to time, we need to invoke our lower level evaluation process. Then all together, that's going to give you our heuristic algorithm. That may not be a best one and that may not be a very good one, but at least now we have a strategy that generates a solution quickly. Somehow that's going to help us make decisions. At least somehow, if your optimal solution cannot be obtained, then it's better than nothing. Having a heuristic is always good. The only thing remains is that. First, you may want to implement this. You may want to decide or write down the pseudocode for your f on the Florida evaluation process by yourself, and then the only thing that remains is that we need to evaluate how good the heuristic is. Let's do it in the next video.