## 3 Proposed Approach and Methodology
### Role of Rewards in Standard and Rerouting Scenarios  
The design of the reward function and the integration of inter-agent communication significantly impact the system's ability to handle traffic, creating different strategies that fit the scenario in question; in this case, the standard and rerouting scenarios. With a certain reward, it is possible to affect the training policy of the neural network, thus creating a traffic control strategy. While isolated optimization may suffice in simple environments, interconnected traffic systems require coordinated, adaptive strategies to achieve efficient and balanced flows. Two types of scenarios were considered:  
* Standard Scenarios: Rewards typically aim to minimize queue lengths, waiting times, or delays at a single intersection. With this reward, the traffic strategy developed during network training involves each agent considering only the intersection it controls, without contemplating neighboring intersections. This encourages each agent to optimize locally without necessarily considering downstream impacts. While this approach is effective in isolated or less congested intersections, it may lead to suboptimal results when intersections are interconnected. Static reward structures often fail to adapt to dynamic conditions, leading to peaks in occupancy. * Rerouting Scenarios: In scenarios where traffic flow from one intersection affects neighboring ones, the reward design needs to account for global traffic metrics. For example, this might involve penalizing congestion caused by vehicles heading toward already congested intersections or rewarding actions that reduce overall network pressure, even if local delays increase temporarily. Introducing a hierarchical reward structure, where global objectives (e.g., reducing network-wide congestion) take precedence over local ones, leads to a new policy in the training, resulting in a new strategy that fits this type of connected intersection scenario, improving overall performance. Alternatively, dynamically adjusting weights in the reward function based on the observed environment (e.g., during rush hours or peak flow) can help address evolving traffic patterns. The necessity for inter-agent communication becomes evident in dense and complex networks. Without communication, the agents optimize independently, which can lead to localized bottlenecks or oscillatory behavior. Communication based on sharing lane occupancy or flow rates allows agents to make informed decisions, aligning local actions with network-wide goals. For example, an agent may delay activating a green phase for incoming traffic if the downstream intersection is nearing capacity, or it can also prioritize outgoing traffic to alleviate pressure on upstream intersections. When vehicles travel between intersections, the system must consider how decisions at one intersection propagate throughout the network. This requires the following:  
* Real-time data exchange to synchronize decisions. * Adaptive strategies that consider not only local queue lengths but also expected arrivals from neighboring intersections. When designing the reward function (Equation (2), Figure 6), agents controlling intersections in proximity must adopt strategies to redistribute traffic dynamically. Localized reward components ensure that intersections minimize immediate queues and waiting times. If an intersection's queue length exceeds a threshold, neighboring agents might adjust their phase timings to divert or delay incoming traffic. Coordination can also enable smoother transitions for vehicles heading to subsequent intersections, preventing cascading congestion. Globalized reward components encourage behavior that aligns with network-wide goals, such as reducing total system delay or balancing traffic flow across intersections. Three scenarios were analyzed and address different traffic conditions.