## 3 Data and Methods
### Implementation of the HMAE Model  
The process of spatial optimization is to determine the optimal value of the decision variable that can optimize the objective function for each facility level (tertiary and secondary) independently. Figure 2 summarizes the procedures in this study. The decision variable of the maximal equality model is the supply size \(S_{j}\) at each candidate location. It can be zero, which means no facility is located at the location, or any positive value. Therefore, the selection of candidate locations is crucial for spatial optimization. In existingstudies, there are two ways to select candidate locations. The first way is to set up candidate locations without consideration of existing facilities. The candidate locations can be the centroids or random locations within administrative or census units, or evenly distributed locations across the study area. The second way, by contrast, aims to rearrange the supply of existing facilities. In other words, the locations of existing facilities are used as candidate locations. The advantage of the second way is that the existing resources can be accounted for, making it more cost-efficient and realistic for policy decision making. In this study, the selection of candidate locations was based on the existing facility locations. Furthermore, considering that the existing facility locations might not be enough to provide coverage to all demand nodes within given catchment areas, we also accounted for the possibility that new facility locations may be needed. Despite the existing facility locations, we examined whether there are demand nodes that are located outside the catchment areas of all existing facilities. If yes, additional candidate locations were be selected from these underserved demand nodes. In sum, candidate locations for locating facilities consisted of two parts, i.e., existing facilities and underserved demand nodes. The selected candidate locations are described below. This study introduces online map API to improve the estimation of travel time from patients to facilities. Specifically, the driving and transit navigation APIs provided by Baidu Map, a leading online map provider in China, were utilized to estimate travel time by driving or by public transit, respectively. Online map API can provide more accurate and reliable estimates of travel time on the basis of the frequently updated transport network, navigation rules, transit schedule, and traffic status [16; 47]. A few studies have demonstrated that various transport modes should be considered in accessibility analysis such that heterogenous demand of different socio-economic groups can be reflected [16; 34; 48]. This study considered two transport modes, i.e., private car and public transit. The latter includes both regular buses and subway and inter-mode transfers. Following Tao and Cheng [19], travel times by the two modes were combined on the basis of modal shares. Modal shares of private car, bus, and subway at the district level were collected from the Shenzhen 2016 Travel Survey. As for hierarchical healthcare facilities, the catchment sizes should vary across different levels. Following existing studies [19; 21], we determined the catchment sizes on the basis of the exceptional breakpoint of the distribution of the travel time from each demand node to the closest existing facility. The threshold was determined so that most demand nodes were within the catchment areas of existing facilities. Only a few extreme demand nodes that were extremely far away from existing facilities were excluded from the catchment areas. As a result, the catchment sizes for tertiary and secondary facilities were 70 and 40 min of travel times, respectively (see Figure 3). Figure 2: The framework of the procedures in this study. In the next step, the travel times from each demand node to the closest existing tertiary and secondary facilities were calculated on the basis of the travel time matrix.