# An Emergency Message Routing Protocol for Improved Congestion Management in Hybrid RF/VLC VANETs
## 4 Algorithm Description
### Proposed Routing Protocol
Maps are exchanged between neighboring RSUs periodically to synchronize, or immediately on triggered updates. The channel assignment algorithm runs periodically and then utilizes these maps by excluding any channels where RSSI/noise thresholds are exceeded in a zone, ensuring assignments avoid heavy interference areas. **Channel Assignment**: Assign unique RF channels and VLC frequencies/beams to each zone based on traffic density \(T_{i}\) and interference level \(I_{i}\) using:  
\[C_{ROI_{i}}=f(T_{i},I_{i}) \tag{15}\]  
Equation (15) determines the unique RF channel assignments for zone ROI\({}_{i}\). \(T_{i}\) is the traffic density metric for zone \(ROI_{i}\), which can be calculated based on the average vehicle count in the zone over time. Higher densities mean more RF channels likely need to be assigned to support throughput needs. \(I_{i}\) is the interference level metric for zone \(ROI_{i}\). This can be evaluated based on RF noise measurements collected by the RSU over time at different locations in the zone. Higher interference means fewer RF channels can be reused in the zone. \(f(T_{i},I_{i})\) represents the assignment function run by the RSU, which takes into account the inverse relationship between density/interference and available RF channels. For this, RSU uses a graph-based channel assignment algorithm, which creates a graph that is made with zones as nodes and edges between zones indicating potential interference. Channels are represented as colors that can be assigned to zones The goal is to color the graph such that no two adjacent nodes share the same color/channel. RSU would implement one such technique to systematically evaluate density and interference, and find acceptable \(C_{ROI_{i}}\), and \(V_{ROI_{i}}\) mappings based on the interference constraints modeled. Let \(G=(V,E)\) be the interference graph with zones as nodes \(V\) and edges \(E\) representing interference constraints. Define C as the set of available channel colors, \(w_{i}\) = weight of node \(i\) based on density \(T_{i}\), and \(I_{ij}\) = interference between nodes \(i\) and \(j\). The channel assignment function can then be expressed as:  
\[f(T_{i},I_{i})=argmax_{c}\phi(c) \tag{16}\]  
The objective function \(\phi(c)\) for a candidate channel coloring c is:  
\[\phi(c)=\sum_{i\in V}w_{i}c_{i}-\mu\sum_{(i,j)\in E}I_{ij}\delta(c_{i},c_{j}) \tag{17}\]  
where we are finding the channel assignment \(c\) that maximizes density benefits while avoiding interference constraints represented by the graph edges, the first term captures density benefits of assigning channel \(c_{i}\) to node \(i\) based on its weight \(w_{i}\) (which represents traffic density \(T_{i}\)). Higher is better, and the second term penalizes interference from adjacent nodes having the same color. \(\mu\) is a constant parameter that helps balance the two terms in the objective function \(\phi(c)\). \(\mu\) controls the relative importance/weight given to avoiding interference versus gaining density benefits from the assignment. A higher \(\mu\) value emphasizes avoiding interference more, while a lower \(\mu\) prioritizes density benefits even if it allows some interference. \(c_{i}\in\) C is the channel color of node \(i\), \(\delta(x,y)\) is 1 if x = y; 0 otherwise,  
\[V_{ROI_{i}}=g(T_{i},I_{i}) \tag{18}\]  
Equation (18) assigns unique VLC channels/beams to zone \(ROI_{i}\) based on similar considerations as RF assignments. \(g(T_{i},I_{i})\) is again the assignment function capturing the trade-off between coverage needs due to density and limitations due to interference conditions VLC beam orientations, widths, and frequencies selected aim to reliably reach the expected number of vehicles in \(ROI_{i}\) while avoiding inter-zone interference issues. For this, we can use the bin packing algorithm, which treats densities as \"items\" to pack into \"bins\" which are VLC channels, then greedily assigns frequencies starting from zones with the highest density and packs into the fullest bin first to minimize the number of bins/frequencies used.