# An Optimization Framework for Data Collection in Software Defined Vehicular Networks
## 3 Materials and Methods
### Proposed Data Collection Optimization Model
#### 3.3.3 Data Collection Method for Hybrid SDVN Architecture  
The highest level of optimization for the data collection is possible in the hybrid SDVN architecture. Constraints specific to this hybrid SDVN architecture are given in the following section.  
**Specific Constraints**  
SDVN nodes (OBUs and RSUs) share their data with neighbors, and then collected data are sent to the control server using cellular or wired communication. In a hybrid SDVN architecture, all nodes do not need to participate in the data collection as agents, and all nodes do not need to broadcast data to neighbors as well. If all nodes participate in both types of communication, redundant data will be transmitted, as data has already been exchanged between the nodes. The minimum number of agents should be selected such that those agents cover the whole vehicular network. Any given node must be either an agent or should have at least one agent in its neighborhood in order for the agents to cover the whole vehicular network. This constraint is given in Equation (16).  
\[x_{i}+\sum_{m\in\mathcal{S}_{i}}x_{m}\ >=\ 1;\ \forall\ i\in\mathcal{S} \tag{16}\]  
In Equation (16), \(\mathcal{S}\) is the set of one-hop neighbors of the whole vehicular network. If a node is selected as an agent, it does not need to broadcast to its neighbors, and if a node  
Figure 3: Demonstration of problems that arise if data collection is not optimized when the network topology changes; (**a**) Network instances showing data loss of broadcasting nodes due to isolation; (**b**) Network instances showing redundant data collection by agent nodes due to an agent moving to the neighborhood of another agent.  
is selected as a broadcasting node, that node does not need to be an agent, as shown in the constraint given in Equation (17). In other words, every node in the network is either an agent or a broadcasting node.  
\[z_{i}\ +\ x_{i}\ =1;\ \forall\ i\in\mathcal{S} \tag{17}\]  
The total payload transmitted by the agents per unit of time after discounting the same data transmitted by multiple agents should be equal to the addition of data contained in each node. This constraint is given in Equation (18). When a given node broadcasts to multiple agents, such data should be counted only once. The negative term in Equation (18) ensures that such nodes are counted only once. The _max_ function in Equation (18) returns the maximum value of the two inputs given to that function.  
\[\sum_{j=1}^{\mathcal{N}}\mathcal{L}_{j}\ =\ \sum_{i=1}^{\mathcal{N}}x_{i}( \mathcal{L}_{i}+\sum_{l\in\mathcal{S}_{i}}\mathcal{L}_{l}z_{l})-\sum_{i=1}^{ \mathcal{N}}\mathcal{L}_{i}z_{i}max(((\sum_{m\in\mathcal{S}_{i}}x_{m})-1),0) \tag{18}\]  
However, by re-inspection, it can be found that when all agents cover the whole network, the agents will automatically transmit the total payload available in nodes of the network. Therefore, out of constraint Equations (16) and (18), only one is necessary and sufficient. Thus, we can remove quadratic constraint Equation (18) and keep linear constraint Equation (16). Thus, for the hybrid architecture, the data collection can be optimized by selecting the minimum number of agents satisfying the constraints given in Equations (16) and (17) for the objective function given in Equation (10) or for the simplified objective function in Equation (11) for the special case of collecting status data.