# Optimal Agent-Based Pickup and Delivery with Time Windows and Electric Vehicles
## 1 Introduction  
With the increasing complexity of demand for real-world transportation of goods and heightened environmental concerns, interest in improving transportation planning systems is now higher than ever. Given the vast and dynamic number of transportation requests in the real world, the proposed approach must provide feasible solutions. We introduce an agent-based approach that leverages a consensus mechanism as a decision-support tool to assist in human decision-making. A vehicle routing problem (VRP) can be static if we consider route planning when the information is provided _a priori_. In other words, the static VRP deals with the planning of batches of orders, while the requests that occur while the plan is in progress have to wait and accumulate in a new batch until the system decides to solve a new route planning problem. In the dynamic VRP, the requests are handled in the order in which they occur, with all available resources at that moment. Each new request is considered to define a new route planning problem to satisfy that order. A recent report by the International Energy Agency revealed that 16% of global carbon emissions come from conventional road transport. However, the same study indicated that the number of electrical vehicles (EVs) surpassed 16.5 million in 2021 [1]. To achieve net zero emissions by 2050 [2], more logistics companies are transitioning to EVs for daily operations, replacing traditional internal combustion engines. In their research,the authors of [3] provide a study estimating the potential of powertrain electrification to reduce road freight CO2 emissions and fossil fuel consumption. This shift has led to novel research opportunities in the field of VRP. Researchers are now exploring variations of traditional VRP that factor in battery charging times and the availability of charging stations. For example, the authors of [4] provide a solution method to the vehicle routing problem with time windows for EVs using a hybrid heuristic based on neighborhood search and tabu search algorithms. A similar approach using variable neighborhood search algorithms, but this time for the EV problem with simultaneous pickup and delivery, was introduced in [5]. Various factors, such as geographical locations, regulations, economics, and technological limitations, influence the utilization of EVs for logistics and car ride-sharing. Reference [6] underscores the importance of digital technology in optimizing routes for waste collection by employing geographical information systems and a combination of heuristics derived from the constructive genetic algorithm and tabu search. To optimize the routes of EVs while considering their limited range and energy consumption, the pickup and delivery problem with time windows and electric vehicles (PDPTW-EV) has been developed as a variation of the pickup and delivery problem with time windows (PDPTW). As the popularity of EVs continues to increase, PDPTW-EV has become an essential tool for efficient route planning. This model ensures that vehicles have sufficient charge to reach their intended destinations while considering uncertainties in travel times [7; 8; 9; 10]. The growing interest in sustainable transportation solutions through the integration of EVs into logistics, delivery networks, or ride-sharing underscores the need for advanced decision-support tools capable of handling the complexity and dynamics of modern transportation systems. According to our literature review, most works propose various solutions based on heuristic, constraint-based, or bio-inspired algorithms [11; 12], we address the challenge of dynamic environments by leveraging consensus mechanisms in an agent-based simulation context. Therefore, this research aims to evaluate the potential of this novel approach to better address the evolving demands of transportation planning in dynamic environments by proposing a more appropriate, sustainable, and efficient approach.