## 2 Material and Methods
### V2X Communication Scenario  
The V2X scenario is shown in Figure 1, where vehicles are moving along a street and communicate with everything whether it is infrastructure, vehicles, or devices, the infrastructures are located on both sides of the road.  
The frequency-flat block-fading Rayleigh channels are considered for uplink communications between vehicles and everything [31]. Thus, the overall achievable data rate (\(R_{bV2X}\)) is expressed as:  
\[R_{bV2X}=B\,log_{2}\Bigg{(}1+\frac{P_{V}|h_{V2X}|^{2}}{\sum_{i=1}^{K}P_{I}|h_{ II2X}|^{2}+N}\Bigg{)} \tag{9}\]  
The first-order optimality conditions are investigated to determine the solution of the optimization problem given in Equation (1). Therefore, the Lagrange optimization problem can be formulated as:  
\[L(R_{bV2X},\lambda,\mu)=R_{bV2X}+\lambda(U-1+p_{outV2X})+\mu(P_{Vmax}-P_{V}) \tag{10}\]  
where \(\lambda\) and \(\mu\) should be non-negative values that represent the Lagrangian multipliers for C1 and C2, respectively.  
The optimal solution to Equation (1) can be obtained by taking the derivative of Equation (10) with respect to \(P_{V}\) and \(P_{I}\), respectively, where it can be found as:  
\[\frac{\partial L(R_{bV2X},\lambda,\mu)}{\partial P_{V}}=0 \tag{11}\]  
\[\mu=\Bigg{[}\frac{B\left|h_{V2X}\right|^{2}}{\sum_{i=1}^{K}P_{I}|h_{I2X}|^{2} +N+P_{V}|h_{V2X}|^{2}}\Bigg{]}-\lambda\Bigg{[}\frac{\left|h_{V2X}\right|^{2}} {\left(\xi\sum_{i=1}^{K}P_{I}|h_{I2X}|^{2}+P_{V}|h_{V2X}|^{2}\right)}\Bigg{]} \tag{12}\]  
\[\frac{\partial L(R_{bV2X},\lambda,\mu)}{\partial P_{I}}=0 \tag{13}\]\[\lambda=\frac{\left(\xi\sum_{i=1}^{K}P_{I}|h_{I2X}|^{2}+P_{V}|h_{V2X}|^{2}\right)* B*\xi}{\left(\sum_{i=1}^{K}P_{I}|h_{I2X}|^{2}+N\right)} \tag{14}\]  
Consequently, with taking the derivative of Equation (10) with respect to \(\lambda\) and \(\mu\), respectively, we find that:  
\[\frac{\partial L(R_{bV2X},\lambda,\mu)}{\partial\lambda}=0 \tag{15}\]  
\[\frac{\partial L(R_{bV2X},\lambda,\mu)}{\partial\mu}=0 \tag{16}\]  
Then, based on Equation (15) and Equation (16), the two following propositions can be derived which are:  
* Proposition 1 (Optimal interference transmission power): To maximize \(R_{bV2X}\), the transmission power should be given by: \[P_{I}=\frac{P_{V}|h_{V2X}|^{2}(1-U)}{\xi\sum_{i=1}^{K}|h_{I2X}|^{2}U}\] (17)
* Proposition 2 (Optimal vehicle transmission power): To maximize \(R_{bV2X}\) when V communicates with X, the vehicle transmission power of any V2X link should be allocated as: \[P_{V}=P_{Vmax}\] (18) To evaluate the QoS of the proposed approach four different metrics have been considered: 1. Packet delivery ratio (PDR): PDR is known as the ratio of the successfully received packets (rp) when compared to the total number of sent packets (sp). The value of the packet delivery ratio always reflects how much the network is reliable. Hence, the increment of the sending packets means a relative increase in the receiving packets [35]. \[\text{PDR}=\frac{\#\text{rp}}{\#\text{sp}}\] (19)
2. Packet loss rate (PLR): PLR occurs when the sent packets fail to reach their destination. It is typically caused by an error in data transmission across the wireless network, or network congestion. Then, the packet loss rate can be calculated as the difference between the numbers of sent packets and received packets with respect to packets sent. Thus, it is defined by the Equation below [36]: \[\text{PLR}=\frac{\#\text{sp }-\text{ }\#\text{rp}}{\#\text{sp}}\] (20)
3. Average end-to-end-delay (E2E): E2E is a networking term used to indicate any kind of delay and can be defined as the time needed for each transmitted packet to reach its destination; it is also called the network latency. Thus, it can be measured as the sum of the time needed to successfully send packets to the destination over the number of successfully received packets [35]: \[\text{E2E}\ =\frac{\sum_{\text{received packets}}\text{ time spent to deliver packets}}{\#\text{rp}}\] (21)