Now, let's use our variables and the parameters to describe to precisely formulate our objective function. Our objective is to minimize the total cost, which is the sum of the three things: office rent, traveling cost, engineer hosting cost. Let's take a look at each of them. For each location, we're going to ask ourselves, whether we built a facility there. If xjk is zero for all the levels, then we don't pay anything. But if we choose one of the levels, then xjk would be one, and then we pay that corresponding fjk. According to the level you choose, then you pay that particular fix office rent. Then for traveling cost, whenever you see a pair of ij such that yij is one, that means you assign customer i to facility j, and then you need to travel hi, that many of times, and for each traveling you pay dij as per service cost. The sum of all these things is the total service cost we pay for all customers. Then finally, you assign engineers. If wj is the number of engineers you hire at facility j, then for each of them, you pay cj as the utility cost, as the cost for hosting an engineer here. The last term is the engineering hosting cost. Then let's take a look at constraints one by one. For each location, we may choose at most one scale level. Choosing no scale level means building nothing. We'll write down our formulations in this way. This in some sense is a nice way to combine the construction decision and the scale level selection decision. Somehow, for each location you need to choose among all those levels, you choose one, if you choose nothing, that means you don't build anything there, so that's constraint 1. Then for constraint 2, for each customer and each location, only a built facility may serve customers. What does that mean? For each customer and each location, first, you ask yourself, whether any level is chosen in that particular location. If yes, the right-hand side, would be one. That means you are allowed to assign customer i to facility j. If the right-hand side on the other hand is zero, then you cannot assign customer i to facility j. The second constraint is to enforce that, you may only assign customers to build facilities. Constraint 3, for each customer. A customer may be served and must be served by a close enough facility, so for each customer, we take a look at all those facilities. There must be one facility that is open, so this is Aij, this is aij. It must be open, and it must be the customers a side facilities together. There must be exactly one facility that is assigned to the customer, and then that is close enough. We need to have one close enough facility to be assigned to a customer. Then for each facility, the number of engineers that you allocate there cannot be larger than its capacity. According to scale level you choose, you know how many engineers you may host there. The number of engineers you allocate there cannot be greater than that. Finally, for each facility there must be some capacity constraints. The left-hand side here somehow means, the number of engineers you hire. S is here, I'm sorry. According to the number of engineers you hire, multiply it by S, that's going to be the total number of services that in this facility may complete in a year. Once you know this number, then the total number of assigned customers, those assigned customers, each of them is going to bring hi events to these facilities. The total number of assigned services cannot be greater than the total number of services that this facility may complete. That's about capacities. Finally, all these decisions are binaries. Whether to choose a specific level, whether to build a facility, that's binary decision, and whether to assign this customer to facility j or not, that's also a binary decision. Collecting all of them, that's our mathematical model. Once you have a mathematical model, then that's a description. You build a mathematical model only with pen and paper. Then you may give that for someone to build a computer model. A computer model in our case, we write Python to invoke Gurobi Optimizer, that's enough for us to find an optimal solution. Maybe you would also try to use MS Excel Solver, but unfortunately, for our problem, there are too many decision variables, too many constraints, so it does not work, maybe Gurobi Optimizer is better choice. Actually in practice, it's rare for practical problems that can be formulated and solved with MS Excel Solver, so this is a nice tool for teaching. In classes, it's nice to use MS Excel Solvers for beginners to learn OR. But to make practical use, those commercial solvers like Gurobi Optimizers, may be a better choice. Being able to write some programs to invoke your optimization engines is always a nice scale to have, if you'll try to becoming operations researchers.