## 2 Materials and Methods
### Optimization Model Formulation  
Consider a set of \(L\) smart infrastructures in an area such as a city. Each infrastructure include \(N^{l}\) nodes with \(\{l=1,2,\ldots L\}\). The geographic space is divided into \(K\) zones denoted by \(Geo_{i}\) with \(\{i=1,2,\ldots K\}\). The size and configuration of the geographic zones can be based on various properties of the region investigated (e.g., political boundaries,squares, etc.). Note that the geographical range of microgrid elements are normally limited to within 10 km\({}^{2}\)[31]. Here, for simplicity, the geographic space is spilt into \(K\) equal size squares, as shown in Figure 2.  
\(F_{i}\) denotes the price of building and running a microgrid in \(Geo_{i}\). Determining the total project cost \(F_{i}\) will be based on many determinants, such as the volume of power produced, the combination of power sources (i.e., fuel cells, wind turbines, solar cells, and batteries), the value of property, financing, and the construction and maintenance cost. Here, we assume that \(F_{i}\) is pre-computed by employing a relevant model [8], including the scaling toward the range of \(TW\). Let the decision variable \(x_{i}\) denote a binary variable equivalent to one if area \(Geo_{i}\) is selected as the location for a microgrid. We define \(S_{i}\) as the power production of a microgrid at position \(i\). Let \(PC_{i\
u^{l}}\) denote the price regarding energy provided through a microgrid at position \(i\) passed to node \(v^{l}\) of the \(l\)th infrastructure. The decision variable \(y_{i\
u^{l}}\) implies the portion of power node \(v^{l}\) of infrastructure \(l\) obtained from a microgrid at location \(i\). Given the notation above, the microgrid location problem is to be expressed as an optimization problem \(P1\) as follows:  
\[P1:\;\;Min\;\;\alpha\sum_{l=1}^{K}\sum_{l=1}^{L}\sum_{v^{l}\in Geo_{i}}-C_{p} (v^{l})y_{i\
u^{l}}PC_{i\
u^{l}}TW(v^{l})+\beta\sum_{l=1}^{K}F_{i}*x_{i} \tag{9}\]  
\[\sum_{l=1}^{L}\sum_{v^{l}\in Geo_{i}}C_{p}(v^{l})y_{i\
u^{l}}\leq S_{i}*x_{i} \qquad\forall\;i \tag{10}\]  
\[\sum_{v^{l}\in Geo_{i}}C_{p}(v^{l})y_{i\
u^{l}}\leq\eta^{l}S_{i}*x_{i}\qquad \forall\;l \tag{11}\]  
\[\sum_{i=1}^{K}x_{i}=1 \tag{12}\]  
\[0\leq y_{i\
u^{l}}\leq 1\quad\forall i,\;v^{l};\qquad\;\;x_{i}\in\{0,1\}, \tag{13}\]  
The objective (9) is to find the minimum cost location for the microgrid while powering the most critical infrastructure nodes. The objective function represents, in the first term, the expense of transferring power to a node \(v^{l}\) from a microgrid placed in \(Geo_{i}\) weighted by the importance \(TW(v^{l})\) of the node. The \(TW(v^{l})\) values are conducted using Equations (5) or (8) depending on the type of infrastructure. The second term in the objective function is the total microgrid project cost if installed in \(Geo_{i}\). Finally, \(\alpha\) and \(\beta\) in the objective function are weights that can be customized to trade-off infrastructure importance versus cost of building and operating. The first constraint ensures that the power transferred to the infrastructure loads is less than or equal to the production of the microgrid if it is located in \(Geo_{i}\). The second constraint seeks to enforce the community/shared nature of the microgrid by ensuring that a single infrastructure can receive a maximum of \(\eta^{l}\) percent of the power produced by the microgrid in \(Geo_{i}\). The \(\eta^{l}\) values are assumed and could reflect the infrastructure's financial contribution of infrastructure \(l\) to the cost of constructing and operating the microgrid. The constraint in (12) guarantees that only a single microgrid is built, and the constraints in (19) ensure the boundaries of the decision variables. Note that several alternate formulations and extensions to the optimization model are possible. For example, one can relax the constraint that a microgrid in \(Geo_{i}\) can only power infrastructure nodes \(v^{l}\) in \(Geo_{i}\).