# Secrecy Rate of Resource-Constrained Mobile Relay Model under Two-Way Wiretap Channel
## 2 Materials and Methods  
### System Model  
#### 2.1.1 Mobility Model  
The two-way wireless secure transmission mobile relay system shown in Figure 1 was considered, and it consists of two IoT users ([PERSON] and [PERSON]), an eavesdropper ([PERSON]), and a relay. The relay is equipped with N antennas and mounted on a ground mobile vehicle. [PERSON], [PERSON], and [PERSON] are configured with a single antenna. [PERSON] and [PERSON] exchange data through the mobile relay under the condition of [PERSON] eavesdropping the whole process. The scenario is described as a directed graph \((\
u,\varepsilon)\) as shown in Figure 2, where \(\
u\) is the set of M vertices representing the possible stopping points, and \(\varepsilon\) is the set of directed edges representing the allowed movement paths [14; 15]. We let \(\mathbf{D}=(D_{m,j})\), \(1\leq m\leq j\leq M\) be an asymmetric \(M\times M\) non-negative real distance matrix associated with \(\varepsilon\), and we assume that the following three conditions hold:  
1. The mobile relay returns to the starting point.
2. The mobile relay visits all important positions.
3. There is no subtour in the planned path.  
Accordingly, we define a selection path variable \(\mathbf{s}=[s_{1},\cdots,s_{M}]^{T}\), where \(s_{m}=1\) if the vertex \(\mathbf{m}\), \(1\leq m\leq M\), appears in the visiting path and \(s_{m}=0\) otherwise. In addition, we introduce an \(M\times M\) matrix \(\mathbf{Z}\) with variables \(Z_{m,j}\) being set to 1 or 0, \(1\leq m\leq j\leq M\) and interpret the value 1 (0 resp.) to mean \"in path\" (\"not in path\" resp). Then, motion distance \(\Theta(\mathbf{Z})\) is given by  
\[\Theta(\mathbf{Z})=\min\Big{\{}\sum_{m=1}^{M}\sum_{j=1}^{M}Z_{m,j}D_{m,j}: \mathbf{Z}\in\mathcal{A}(\mathbf{s},\mathbf{Z})\Big{\}} \tag{1}\]  
Figure 1: System model.  
Figure 2: Mobility model.  
and we define set \(\mathcal{A}(\mathbf{s},\mathbf{Z})\) as the visiting path, which can be expressed as [14]:  
\[\mathcal{A}(\mathbf{s},\mathbf{Z})=\Big{\{}(\mathbf{s},\mathbf{Z}): \sum_{j=1}^{M}Z_{m,j}=s_{m},\quad\sum_{j=1}^{M}Z_{j,m}=s_{m}, \quad\forall m=1,\cdots,M \tag{2a}\] \[\lambda_{m}-\lambda_{j}+(\sum_{l=1}^{M}s_{l}-1)Zm,j+(\sum_{l=1} ^{M}s_{l}-3)Z_{j,m}\] \[\leq\sum_{l=1}^{M}s_{l}-2+J(2-s_{m}-s_{j}),\quad\forall m,j\geq 2,\quad m\
eq j\] (2b) \[s_{m}\leq\lambda_{m}\leq(\sum_{l=1}^{M}s_{l}-1)s_{m},\quad\forall m\geq 2\] (2c) \[Z_{m,j}\in\{0,1\},\quad\forall m,j,\quad Z_{m,m}=0,\forall m\] (2d) \[s_{1}=1,s_{m}\in\{0,1\},\quad\forall m\geq 2\Big{\}} \tag{2e}\]  
Constraint (2a) guarantees that vertex \(m\) being visited only once at the most, while (2b) and (2c) are sub-tour elimination constraints, which ensure that the visiting path is connected. (2d) represents whether edge \((m,j)\) belongs to the path and also ensures that no self-loop appears in the visiting path. (2e) stands for the first vertex is the starting point. Note that\(\{\lambda_{m}\}\)represents slack variables to guarantee a connected trajectory, and \(J\) is a constant set to \(J=10^{6}\).  
With the moving time from vertex \(m\) to vertex \(j\) being \(D_{m,j}/a\), where \(a\) is the average velocity, the total moving time along a selected visiting path is  
\[\frac{\Theta(\mathbf{Z})}{a}=\frac{1}{a}\sum_{m=1}^{M}\sum_{j=1}^{M}Z_{m,j}D_{ m,j} \tag{3}\]  
Furthermore, the total motion energy \(E_{G}\), along with the visiting path, is proportional to the total moving time [16]; it can be expressed as  
\[E_{G}=\zeta(a)\sum_{m=1}^{M}\sum_{j=1}^{M}Z_{m,j}D_{m,j} \tag{4}\]  
where \(\zeta(a)\) is a simple parameter function of velocity \(a\) of the model. It can be described as \(\zeta(a)=(\tau_{1}+\tau_{2}/a)\), where \((\tau_{1},\tau_{2})\) are parameters related to the weight of ground mobile vehicle (e.g., for the considered Pioneer 3 DX robot, we have \(\tau_{1}=7.4\) and \(\tau_{2}=0.29\)) [6; 16; 17].