# An Optimization Framework for Data Collection in Software Defined Vehicular Networks
## 3 Materials and Methods
### Proposed Data Collection Optimization Model
#### 3.3.1 Objective Function  
The objective is to minimize the parameters listed below. * The number of agents;
* Communication delay between nodes;
* Communication delay for agents;
* Communication cost per byte between nodes;
* Communication cost per byte for agents;
* Total payload of communication between nodes;
* Total overhead of communication for agents (maximize the number of neighbors of the agent nodes);  
The above parameters can be mathematically written to formulate the objective function given in Equation (6). Each term in Equation (6) corresponds to the parameters given in the above list in the same order. Note that in the objective function given in Equation (6), \(x_{i}\) and \(z_{i}\) are the decision variables. \[ \begin{array}{ll}minimize&C_{N}\sum\limits_{i=1}^{\mathcal{N}}x_{i}+C_{DN} \sum\limits_{i=1}^{\mathcal{N}}(z_{i}\sum\limits_{m\in\mathcal{S}_{i}}\mathcal{ D}_{im})+C_{DA}\sum\limits_{i=1}^{\mathcal{N}}\mathcal{D}_{i}x_{i}+C_{CN}\sum \limits_{i=1}^{\mathcal{N}}(z_{i}\sum\limits_{m\in\mathcal{S}_{i}}\mathcal{C} _{im})\\ &+C_{CA}\sum\limits_{i=1}^{\mathcal{N}}\mathcal{C}_{i}x_{i}+C_{LN}\sum \limits_{i=1}^{\mathcal{N}}\mathcal{N}_{i}f((p_{i}\mathcal{L}_{\text{s},i})+( q_{i}\mathcal{L}_{\text{s},i}))z_{i}-C_{O}\sum\limits_{i=1}^{\mathcal{N}}(x_{i} \sum\limits_{m\in\mathcal{S}_{i}}z_{m})\end{array}  \tag{6}\]  
In Equation (6), \(C_{N}\) is a large positive coefficient to stress the fact that the number of nodes participating in the data collection process should be minimized. \(\mathcal{N}\) is the total number of nodes in the vehicular network. \(k=\sum\limits_{i=1}^{\mathcal{N}}x_{i}\) is the total number of agent nodes participating in the data collection process. \(C_{DN}\) is a positive coefficient for delay between nodes and \(C_{DA}\) is the coefficient for delay of the agents. \(C_{CN}\) is the cost coefficient for the communication between nodes, and \(C_{CA}\) is the cost coefficient for the communication of agents, \(C_{LN}\) is the coefficient for the overhead of the nodes, and \(C_{O}\) is the coefficient for overhead. \(\mathcal{D}_{im}\) is the delay for communication from the \(i^{th}\) node to its neighbor m. \(\mathcal{D}_{i}\) is the delay for communication from the \(i^{th}\) agent to controller. Furthermore, \(\mathcal{C}_{im}\) is the communication cost associated with communication between the \(i^{th}\) node and its \(m^{th}\) neighbor. \(\mathcal{C}_{i}\) is the communication cost for transmitting collected data by the \(i^{th}\) agent to controller. However, we can derive a simpler version of the objective function given in Equation (6) by reducing redundant terms and combining terms as follows. Note that the first term in Equation (6) minimizes the number of agents. However, when minimizing the communication delay of agents using the third term, and when minimizing the cost of agents using the fifth term in Equation (6), the total number of agents will be automatically minimized. Therefore, the first term of the objective function given in Equation (6) can be removed. Furthermore, we can observe similar terms for the communication cost per byte and communication delay (term 2 and term 4, term 3 and term 5 of Equation (6) are similar). Therefore, we define combined communication cost (\(\mathcal{B}\)) as the encapsulation of communication delay and communication cost per byte for a given link. Accordingly, the combined communication cost from \(i^{th}\) node to its \(m^{th}\) neighbor (\(\mathcal{B}_{im}\)) can be formulated as given in Equation (7). \[\mathcal{B}_{im}=\ \mathcal{C}_{im}+\mathcal{D}_{im} \tag{7}\]  
Similarly, the combined communication cost of an agent \(i\) (\(\mathcal{B}_{i}\)) is the sum of the communication cost per byte and communication delay for the link that exists between the agent and the control server as shown in Equation (8).