## 1 Introduction
### Developing the VAOMP Model Considering the Capacity Criterion (VAOCOMP)
Applying the ranking, any demand closer to a facility is likely to be allocated earlier than demands which are further away, and therefore, the capacity of the facility will be filled up with closer, rather than more distant, demands. If two arrays or demands have the same cost for a facility (while the facility has spare capacity), the array with the smaller demand index will be allocated for the capacity. Then the partial sum (\(w_{k}\)) is calculated for each facility, based on the ranking level. The OD Cost Matrix seems to be highly effective in quickly reaching the solution: as it is possible to find the lowest cost between facilities and demands, each demand point will be allocated to its closest adjacent facility, and every facility will also be served by its closest adjacent demand. For example, a demand may be serviced by different facilities based on its ranked level, but the capacity of the facility can only serve the closest demands around it. However, the intended demand may not be the closest demand to the facility, so the capacity of the facility will not be allocated to the demand further away, and that more distant demand must use capacity from another facility, which is not necessarily the closest facility to the intended demand. The constraints of this model are described as follows:  
Equation (2) also considers capacity as a factor: if a demand is allowed to be allocated to a facility, the value of \(c_{ij}^{l}\) will be equal to 1. Constraint (3) requires a large coefficient value, M; this constraint establishes that when i has the kth smallest partial sum, the unconditional partial sum should be equal to the actual partial sum of the costs. Constraints (4) and (5) define that each partial sum should be assigned only one rank and that each rank should be assigned to only one partial sum. Constraint (6) stated that the partial sum of the kth rank should be less than, or equal to, the partial sum at the next rank. Constraint (7) is a constraint, ensuring that each demand is assigned to a facility as its lth closest. Constraint (8) is a Balinski-like constraint, where an assignment to a site at j can be made only if that site has been selected for a facility. Constraints (9) stated that a given demand i is assigned to facility j as the lth closest facility, when j is actually the lth closest facility to i. Constraint (10) stated that the number of open facilities should be from p2 to p1. Constraint (11) defines the appropriate values and constraints for the decision variables [1]. Constraint (12) states that each demand can only be allocated to L facilities according to the ranked level. Constraint (13) states that the sum of allocations for each facility should be less than, or equal to, its capacity. The pseudo-code of this function is as follows:1. The required number of facilities is selected as the initial solution using spatial analysis. This solution will speed up the time required to reach the optimal solution. 2. The OD Cost Matrix is created for all demands and facilities selected at the previous step. 3. All the arrays in the OD Cost Matrix are arranged or ranked based on the minimum cost. 4. Based on the order of matrix arrays, which was created in the previous step, and considering the capacity of each facility, the closest demand to each facility is allocated according to the type and the number of service levels. 5. According to Equation (2), the partial sum for each demand is calculated based on the allocations of each demand to each facility and the possibility of allocating the demand to a facility according to the capacity criterion and the ranked level of each demand to any facility. 6. Then, all the demands are sorted according to their minimum partial sum: the minimum value will be the lowest weight \(\lambda_{k}\). 7. In the last step by Equation (1), the minimum value of the function will be obtained for the selected facilities.