# An Adaptive Delay-Tolerant Routing Algorithm for Data Transmission in Opportunistic Social Networks
## 3 System Model Design
### The First-Factor Fuzzy Input: Computation of the Remaining Energy Level  
In opportunistic social networks, the purpose of routing algorithm is to construct an end-to-end communication connectivity from the source to the destination. However, wireless mobile devices with limited energy are hardly able to implement the long-distance communication connectivity [47]. To this end, it is a challenge for routing algorithm to use the limited energy of nodes to route data packets. DTCM focuses on the relationship between the residual energy and data transmission, thereby constructing a novel routing strategy for opportunistic networks [37; 38]. As shown in Figure 2, when \(node_{i}\) moves to communication area of \(node_{j}\) and communicates with \(node_{j}\), energy consumption is related to mobility distance and the number of data packets. To quantify the whole process, we fist define \(e_{(i,j)}\) as the energy consumption from data communication between \(node_{i}\) and \(node_{j}\). Since the communication between two nodes can only occur in the same communication area, \(node_{i}\) needs to move to some locations that are covered by communication area of \(node_{j}\). Accordingly, energy consumption \(e_{(i,j)}\) can be divided into two aspects of energy consumption: communication energy consumption and mobility energy consumption. Therefore, \(e_{(i,j)}^{com}\) and \(e_{(i,j)}^{mob}\) can be regarded as communication energy consumption and mobility energy consumption, respectively, and then the energy consumption \(e_{(i,j)}\) between \(node_{i}\) and \(node_{j}\) can be computed by \(e_{(i,j)}=e_{(i,j)}^{com}+e_{(i,j)}^{mob}\). Since the mobility energy consumption between a pair of nodes is related to the distance between them, we can calculate it from the perspective of movement and unit loss rate. On the other hand, the communication energy consumption rate is related to the amount of data that needs to be transmitted. Then, we denote \(x\) and \(y\) as the horizontal and vertical coordinate of relay node in two-dimensional geographical position, and define \(e_{unit}^{mob}\) as the energy consumption per unit distance, so \(e_{(i,j)}^{mob}\) and \(e_{(i,j)}^{com}\) can be calculated by:  
\[\left\{ \begin{array}{l}e_{(i,j)}^{mob}=d_{(i,j)}\times e_{unit}^{mob}=\sqrt {\left(x_{i}-x_{j}\right)^{2}+\left(y_{i}-y_{j}\right)^{2}}\times e_{unit}^{ mob}\\ e_{(i,j)}^{com}=re(j,i)+te(j,i)\end{array} \right. \tag{1}\]  
where \(x_{i}\), \(x_{j}\), \(y_{i}\), and \(y_{j}\) are the horizontal and vertical coordinates of \(node_{i}\) and \(node_{j}\), respectively. As shown in Figure 1, \(re_{(j,i)}\) and \(te_{(j,i)}\) are the energy consumption rate of \(node_{j}\) receiving data from \(node_{i}\) and the energy consumption rate of \(node_{j}\) transmitting data to \(node_{i}\), respectively. Message carriers select a next hop based on the energy consumption from the communication between neighbor nodes and the destination node. Since the energy consumption of each neighbor  
Figure 2: Energy consumption model for data transmission in opportunistic social networks. node and destination node is different, the probability of each neighbor node being selected as a relay node is also different, and this probability can be calculated as:  
\[P_{(j,p)}=\frac{e_{(j,p)}}{\sum\limits_{k\in R}e(k,v)+e(j,k)} \tag{2}\]  
where \(node_{j}\) is a neighbor node of \(node_{i}\) and \(R\) is a set of relay nodes that have been selected by \(node_{j}\) to forward data packets to the destination \(node_{v}\). Only when \(P(j,v)\) from \(node_{j}\) is above those from other neighbor nodes, \(node_{j}\) will it be regarded as a reliable relay node and \(node_{i}\) will forward data packets to it. Through the evaluation of energy consumption and selecting probability, the energy consumption level of mobile node can be defined as the ratio of the energy consumption of the current node to the energy consumption of all neighboring nodes.