Research Article

Data Cooperative Distribution Mechanism of Internet of Vehicles Using D2D Technology

Table 2

Detailed steps of D2D unicast cooperative distribution algorithm based on multihop relay.

Algorithm 2

Input:F = (CM, L),CS = {i},CR,d
Output: Optimal multicast distribution path tree from CS to CR with the constraint that the number of D2D unicast forwarding hops is not greater than 2 and the corresponding resource consumption costopt
Step 1: Initialize the algorithm by making the resource cost function cost(i) = 0 for element i, making the set CSR= {i} and the loop variable t= 1
Step 2: Use formula (13) to look for xopt in CSR. In the path tree, add the element st as a child of the node xopt
Step 3: Use formula (14) to calculate
Step 4: If st is a child of element i, the terminal st is added to the set CSR
Step 5: If t < M − 1, then let t=t + 1 and return to step 3. Otherwise, use formula (15) to find the costopt