# Resource Assignment Algorithms for Autonomous Mobile Robots with Task Offloading
## 3 System Model and Problem Formulation
### Formulation of the Minimization Problem  
The problem consists in finding a specific configuration \((\mathbf{f},\mathbf{S})\) that optimizes a KPI \(\mathcal{P}\), such as, for instance, the latency, bit rate, or radio/CPU loads. In this work, we want to minimize the average latency experienced by all AVs, written as  
\[\mathcal{P}(\mathbf{f},\mathbf{S})=\frac{1}{N_{\mathrm{AV}}}\sum_{i=1}^{N_{ \mathrm{AV}}}L_{i}(\mathbf{f},\mathbf{S}), \tag{12}\]  
while choosing a unique configuration that connects the AV to a DC through a BS and a finite amount of radio and computation resources. Thus, as described in Section 3 and discussed in the example, every connection to a DC is unique, i.e., it cannot be split among two or more BSs. Similarly, every AV can connect to a single DC only, but differently, it must use its internal service. Due to finite radio and computation resources, latency increases proportionally when either BSs or DCs are overloaded, as shown by (6). With these conditions, the problem falls within the case of nonlinear integer (binary) constrained optimization, and, since the number of AVs is fixed, can be mathematically formulated as a minimization of the total sum latency, as expressed by  
\begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline \(\mathbf{S}_{3}\) & \(\begin{bmatrix}1&0\\ 0&0\\ 0&0\end{bmatrix}\) \\ \(\mathbf{S}_{4}\) & \(\begin{bmatrix}0&0\\ 1&0\\ 0&0\end{bmatrix}\) \\ \hline \end{tabular}
\end{table}
Table 2: _Cont._\[\min_{\mathbf{f},\mathbf{S}} \sum_{i=1}^{N_{\text{AV}}}L_{i}(\mathbf{f},\mathbf{S})\] (13) subject to \[\mathbf{f}\in\{0,1\}^{N_{\text{AV}}} \tag{14}\] \[\mathbf{S}\in\{0,1\}^{N_{\text{BS}}\times N_{\text{DC}}N_{\text{AV}}}\] (15) \[f_{i}+\sum_{k=1}^{N_{\text{BS}}}\sum_{m=1}^{N_{\text{DC}}}S_{i,k, m}=1,\ i=1,\ldots,N_{\text{AV}}. \tag{16}\]  
We rewrite \(L_{i}\) in (6) as  
\[L_{i}(\mathbf{f},\mathbf{S})= \ell_{i}f_{i}\] \[+\sum_{k=1}^{N_{\text{BS}}}\sum_{m=1}^{N_{\text{DC}}}[(l_{m}\max\{ 1,U_{k}\}\max\{1,\Gamma_{m}\}+d_{k,m})D_{i,k}K_{k,m}+l_{\infty}(1-D_{i,k}K_{k,m })]S_{i,k,m}, \tag{17}\] \[i=1,\ldots,N_{\text{AV}},\]  
so as to make explicit its dependency on the assigned configuration \((\mathbf{f},\mathbf{S})\) and to contain the various cases into a single equation. To include the 2 nd line in the right-hand side of (6), we also introduce \(l_{\infty}\gg l_{m}\), a latency value denoting connection absence (e.g., \(l_{\infty}=10^{9}\)). Expression (17), then, represents the latency distribution among the AVs. The problem (13) is integer nonlinear, and also nonconvex, where the constraints are as follows:  
* (14) and (15) state that the selection vector and matrix have binary components;
* (16) states that when \(f_{i}=1\), then \(\mathbf{S}_{i}=\mathbf{0}\), and that when \(f_{i}=0\), then there is only a 1 in \(\mathbf{S}_{i}\) (the other values being 0).  
In the following, when referring to the complexity of the proposed algorithms, we denote with \"_call_\" the calculation of the values \(L_{i}(\mathbf{f},\mathbf{S})\) in (17) for \(i=1,\ldots,N_{\text{AV}}\).