# Joint Spreading Factor and Channel Assignment in Multi-Operator LoRaWAN Deployments
## 4 Optimal Formulation for SF and Channel Assignment  
We consider multiple co-located operators. Suppose that the different operator devices are transmitting on one of a set of available channels \(\mathcal{C}\). We introduce the normalized channel traffic load per SF, and per channel \(G_{sc}\), as:  
\[G_{sc}=\lambda_{sc}^{e}\cdot T_{s}+\sum_{i=1}^{N}\frac{1}{n}\cdot x_{i}^{c}( \lambda^{i}\cdot N_{co}^{i}\cdot p_{s}^{i}\cdot T_{s}), \tag{1}\]  
where \(x_{i}^{c}\) is a binary variable that is equal to one if network operator \(i\) is using channel \(c\), and zero otherwise, and \(n\) is the number of channels that each operator can use. The total normalized traffic load for a network \(i\), per SF, and per channel it is utilizing, can be written as:  
\[G_{sc}^{i}=\frac{1}{n}(\lambda^{i}\cdot N_{co}^{i}\cdot p_{s}^{i}\cdot T_{s}). \tag{2}\]  
As such, with the success rate being expressed as \(\exp(-2G_{sc})\), the total normalized throughput in the network becomes:  
\[\mathcal{T}=\sum_{i=1}^{N}\sum_{c=1}^{\mathcal{C}}\sum_{s=1}^{S}x_{c}^{i}\cdot G _{sc}^{i}\exp(-2G_{sc}). \tag{3}\]  
We define the proportional fair global optimal problem, in order to maximize the total normalized throughput through spreading factor and channel selection, as follows:  
\[\underset{x_{c}^{i},p_{s}^{i}}{\text{Maximize}}\sum_{i=1}^{N}\sum_{c=1}^{ \mathcal{C}}\sum_{s=1}^{S}x_{c}^{i}\cdot\log(G_{sc}^{i}\exp(-2G_{sc}))\] (4a) Subject to \[\sum_{s=1}^{S}p_{s}^{i}\leq 1,\ \ \forall i\in\mathcal{N}, \tag{4b}\] \[\sum_{k=1}^{s}p_{k}^{i}\leq\sum_{k=1}^{s}\frac{N_{k}^{i}}{N_{co}^ {i}},\ \ \forall s=1,...,S,\ \ \forall i\in\mathcal{N},\] (4c) \[\sum_{c=1}^{C}x_{c}^{i}\leq n,\ \ \forall i\in\mathcal{N},\] (4d) \[x_{c}^{i}\in\{0,1\},\ \ \forall i\in\mathcal{N},\ \ \forall c\in \mathcal{C}. \tag{4e}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Notation** & **Definition** \\ \hline \(\lambda^{i}\) & Packet generation rate for devices in network \(i\) \\ \(T_{s}\) & Time to transmit a packet on SF \(s\) \\ \(l\) & Packet length in bytes \\ \(d\) & Duty cycle \\ \(N_{co}^{i}\) & Number of covered nodes for operator \(i\) \\ \(N_{g}^{i}\) & Number of nodes that can use SF \(s\) and higher for operator \(i\) \\ \(p_{s}^{i}\) & Ratio of devices using SF \(s\) and belonging to operator \(i\) \\ \(n\) & Maximum number of channels that can be used by each operator \\ \(G_{sc}\) & Total normalized traffic load on SF \(s\) and channel \(c\) \\ \(\lambda_{sc}^{e}\) & Intensity of external traffic on SF \(s\) and channel \(c\) \\ \(\mathcal{N}\) & Set of operators and \(N\) their number \\ \(\mathcal{T}\) & Total normalized throughput \\ \(S\) & The number of available SFs \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Notation Summary. The function in (4a) is the objective of the problem, in order to maximize the total normalized throughput in the system over all the channels, over all of the spreading factors. The constraints in (4b) ensure that the sum of the ratio on all of the SFs remains less than or equal to one. The constraints in (4c) ensure that no device could be assigned an SF it cannot use. Finally, the constraints in (4d) and (4e) verify that each operator will not use more than \(n\) channels. Not only is the problem with this formulation expensive to solve (MILP), it also requires the presence of a centralized server that can solve the problem in one shot. The latter would have to have all of the information regarding all the different operators. This is not a realistic approach. As a consequence, we divide the problem into two sub problems: (a) a spreading factor selection problem and (b) a channel selection problem. We use game theory to solve each of the aforementioned problems at the operator level. In our work, we decoupled the joint problem and solved for the SFs first, and for the channels second. Iterating the algorithm i.e., solving again for SF assignment after channel assignment and so on does not yield a different result.