## 4 Scheme Design: MPMF
### Relay Selection
#### 4.2.1 Case 1  
When a message-carrying node encounters more than one relay at the one-hop distance in some geographic proximity, it looks for another relay beyond the coverage of one-hop distance to relay a message. When no candidate nodes are found qualified to receive this message, the message-carrying node holds this message in the hope of encountering more nodes in the near future. In this case, the location information of one-hop and two-hop relays with respect to the message-carrying node, their DP's weight value, and the direction in which the two-hop relay moves are exploited to select the best relay nodes to carry a message. The steps involved are discussed as follows. 1. Summation angle measurement: The summation angle is used to indicate whether a relay node's position is closer to a destination node. 2. DP's weighting calculation in one-hop and two-hop distance levels: A relay node with more frequent contacts with a destination node will have a higher weight. 3. To select relay nodes, both one- and two-hop relays should be closer to the destination, their DP's weight value calculated by considering their respective contact frequency with the destination should be higher, and the moving direction of the two-hop relay should be closer to the destination node. Figure 2 illustrates a scenario to ease exposition of the MPMF. Nodes \(n_{i}\) and \(n_{j}\) are in one-hop transmission range of \(s\). Node \(n_{i+1}\) is in one-hop transmission range of \(n_{i}\), as well as two-hop transmission range of \(s\). Given that \(n_{i}\) lies at a one-hop distance from \(s\) and forms the first offset angle \(\theta_{i}\) with respect to \(\overrightarrow{n_{i}}\) and \(\overrightarrow{sd}\), then \(\theta_{i}\) is calculated by using (1). \[\theta_{i}=arccos\left(\frac{\overrightarrow{n_{i}}\cdot\overrightarrow{sd} }{\lVert\overrightarrow{n_{i}}\rVert\cdot\lVert\overrightarrow{sd} \rVert}\right), \tag{1}\]  
In (1), \(\lVert\overrightarrow{n_{i}}\rVert\) and \(\lVert\overrightarrow{sd}\rVert\) are Euclidean vectors, and \(\overrightarrow{sn_{i}}\cdot\overrightarrow{sd}\) represents an inner product. Let \(n_{i+1}\) be at one-hop distance from \(n_{i}\) and two-hop distance from \(s\); then, two second offset angles at the two-hop distance \(\theta_{i+1}\) and \(\theta_{i+1}^{\prime}\) with respect to \(\overrightarrow{n_{i}n_{i+1}}\) and \(\overrightarrow{n_{i}d}\), and \(\overrightarrow{n_{i}n_{i+1}}\) and \(\overrightarrow{n_{i}d}^{\prime}\) are formed. Because a smaller geometric angle with respect to \(d\) implies that a node is moving toward the destination, then the first threshold value for one-hop relay selection is \(\theta_{i}\leq\frac{\pi}{2}\). The condition for two-hop relay follows by checking \(\theta_{i+1}\leq\frac{\pi}{2}\) first, and then \(\theta_{m}=|\theta_{i}+\theta_{i+1}^{\prime}|<\varepsilon\) for \(\epsilon\in[0,\frac{\pi}{2}]\). Note that \(\theta_{i+1}\) and \(\theta_{i+1}^{\prime}\) are calculated by replacing \(\overrightarrow{n_{i}}\) and \(\overrightarrow{sd}\) with \(\overrightarrow{n_{i}n_{i+1}}\) and \(\overrightarrow{n_{i}d}\) and \(\overrightarrow{n_{i}n_{i+1}}\) and \(\overrightarrow{n_{i}d}^{\prime}\) in (1), respectively. Provided that \(\theta_{i}\leq\frac{\pi}{2}\) is true, then at the two-hop distance, if \(\theta_{i+1}\leq\frac{\pi}{2}\) and \(\theta_{m}<\epsilon\), the MPMF policy goes to the next phase, as follows. Let \(p_{i}\) and \(p_{i+1}\) denote the respective DP values of the one-hop \(n_{i}\) and the two-hop \(n_{i+1}\) with respect to \(d\). With \(p_{i}\) and \(p_{i+1}\), a primary weighted DP form \(W^{(1)}\) is given as  
\[W^{(1)}_{i}=\frac{1}{\ln p_{i}\cdot\ln p_{i+1}+1}\, \tag{2}\]  
where \(p_{i}\) and \(p_{i+1}\) are calculated using (3) as a result of PRoPHET [10]. \[P_{(x,y)}=P_{(x,y)old}+(1-P_{(x,y)old})P_{init}, \tag{3}\]  
where \(P_{(x,y)}\) and \(P_{(x,y)old}\) represent the current and previous DP values with respect to two nodes \(n_{x}\) and \(n_{y}\), and the value \(P_{init}\in[0,1]\) is an initial constant.