Abstract
On-demand transportation (ODT) systems have proliferated in diverse cities worldwide due to their social, economic and environmental advantages. Despite those advantages, it is vital to get public approval. The approval key is the system’s reactivity in supplying speedy and reliable solutions that consider clients’ and vehicles’ constraints. Those solutions have to reflect actual life conditions to optimize the quality of service. The most regarded challenge in studying the ODT problem in cities is the stochastic time-dependent travel speed that varies due to traffic fluctuations. To deal with an actual ODT problem, a system has to represent the traffic on its scale. Hence, estimating the travel speed at a specific time and affording a solution based on reliable traffic data. Accordingly, the passengers are served better. This work contributes to the study by solving the ODT problem in cities with a massive multi-agent system that considers historical traffic data and unpredictable events disrupting the typical traffic. We evaluate the proposed approach by experiments with instances based on actual data for a city in the north of Lebanon. The results reveal that the quality of service increases when the stochastic time-dependent travel speed is considered. 50% to 100% of affected clients by an unpredictable event are satisfied when this event is considered by the system.
Keywords
Introduction
On-demand transportation (ODT) is a ride-sharing taxi that addresses several transportation demands to the same vehicle. ODT problem has been widely studied for several years [7,21]. Nowadays, it is still critical because an increase in the population and its mobility leads to an increase in the traffic problem. Recently, ODT systems have proliferated in diverse cities in the world due to their social, economic and environmental advantages [15,30,31]. For instance, they serve areas uncovered by traditional public transport. Moreover, they propose a cheaper solution than taxis because they allow the transportation of several clients per vehicle simultaneously. That contributes to reducing the negative consequences on the environment, especially air and noise pollution, soil consumption, etc. [3]. However, it is essential to get public approval despite those benefits. The approval key is the system’s reactivity in supplying speedy and reliable solutions that consider clients’ and vehicles’ constraints, reflect actual life conditions, and optimize the quality of service.
The most regarded challenge in studying the ODT problem in cities is the stochastic time-dependent travel speed. This later varies according to the traffic situation. Therefore, an ODT system has to evaluate the traffic conditions to foresee any transformations in speed during vehicle circulation and provide reliable results. Multi-agent system [36] has been regarded as an efficient tool for solving ODT problem [2]. However, up to our knowledge, all precedents published research using the multi-agent technology do not consider the stochastic time-dependent travel speed, especially that varies according to unpredictable events [1,12,13,23,37]. In this paper, we use multi-agent system to agentify the ODT problem in cities massively. We propose a historical traffic data-based system that reflects the traffic on its scale and provides accurate travel speeds. It can also anticipate the effect of unpredictable events on the traffic, avoid congested roads by diverting the vehicles, and finally serve the passengers on time.
The main contributions of the paper are as follows: First, a specification model is defined to design and implement a massive multi-agent system that we have applied to ODT problem and traffic representation. Second, the massive multi-agent system considers historical traffic data and unpredictable events disrupting the typical traffic to represent the traffic organization on its scale. Third, a prototype of the proposed approach is designed and implemented to validate its effectiveness. Finally, we generate instances based on real data for a city in the north of Lebanon to evaluate the proposed approach. The contribution is significant for the following reasons: The stochastic time-dependent travel speed is considered while solving the ODT problem in cities. The representation of the traffic organization on its scale enables estimating the travel speed at a specific time and affording a solution based on reliable traffic data. Concepts within the traffic organization framework can be extended and applied to several similar problems, e.g. traffic regulation in urban areas.
In the rest of this paper, we present some previous works solving the Vehicle Routing Problem (VRP) and its variants in Section 2. A description of the elements of the ODT system is provided in Section 3. Section 4 outlines the massive multi-agent approach of the ODT problem. Section 5 manifests the treatment of a new client’s demand. Section 6 presents the treatment of the traffic evolution. The experimentation is presented in Section 7. The last section concludes and discusses the future works.
Literature review
Most researches on Vehicle Routing Problem (VRP) and its variants presume fixed travel speeds [5,14]. That is fictitious and conducts to acquire irresponsible and pricey outcomes- the service quality declines and the drivers’ regular working hours increase. Neglecting the variation of travel speeds will lead to scramble the working hours of 50% of the vehicle’s trips [26] and to misevaluating the trajectories duration up to 20% [10]. Accordingly, it is essential to take into consideration the time-dependent travel speed.
Limited papers address the VRP with time-dependent travel speed [6]. For a recent survey about the different models, interested readers can refer to [16].
Some works contemplate the travel speed modification emanated from predictable events. For example, a model is proposed for vehicles routing and scheduling problem considering the variation in travel speed during different times of the day [22]. This sample shows more evolved results than those conveyed by another one that deals with the same problem with a fixed travel speed. The authors use the FIFO property to guarantee that a vehicle initiating at a time t, will reach its destination at a time
Predictable events are insufficient to show the actual traffic conditions. The consideration of unpredictable events is necessary. The authors in [24] show that considering traffic information allows a 12% reduction in the use of a vehicle: 8.4% of the reduction is due to historical information, and 3.6% is due to real-time traffic information. Therefore, some recent researches have considered the change in travel time due to unpredictable events. For example, the authors in [32] discuss the dynamic dial a ride problem (DDARP) by studying the effect of the time-dependent and stochastic travel speeds on vehicles trips. They solve the problem by two types of methods: (1) deterministic methods that treat DDARP by using the average time-dependent travel speeds and (2) stochastic methods that treat stochastic DARP by considering the unpredictable events that may occur in the future. In this approach, the paths of the vehicles do not change due to an unpredictable event, but the time required to cross the shortest-distance path is calculated by bearing in mind the future accidents that may occur. The two methods are compared and proved that considering the historical effect data of the accidents in the paths estimation has a beneficial impact on the quality of the solutions. Authors in [19] weigh each road by an interval travel time (ITT) to give reliable solutions in city logistics. The shifted gamma distribution generates the value of travel times of each road. The lower bound of the intervals is the 5% quantiles and the upper bound is the 95% quantiles. Using the ITT technique, the aggregation of different travel times on each road and data collection to calculate the roads travel time are avoided.
Based on our information, all precedents papers that propose multi-agent systems to model and solve the ODT problem do not consider the stochastic time-dependent travel speed [1,4,12,13,23,28,29,37]. In [27], the authors propose a multi-agent approach to resolve the ODT problem in cities with time-dependent travel speed. Based on the city’s historical traffic data, the travel speed is evaluated at a particular time. Experimental results show that considering travel speed reduces customer dissatisfaction by more than 50%.
To the best of our knowledge, this paper is the first to address the ODT problem using multi-agent technology and considering stochastic time-dependent travel speed and real-life conditions as unpredictable events.
The components of ODT system
The essential components in the ODT system are: the road network of the city, the client’s demand, the vehicle and the trajectory. In this section, we describe the representation of each component in the system.
Stochastic dynamic road network
The road network of the city is characterized by dynamic (time-dependent) and stochastic speeds. It is defined by a graph
A List of expected traffic situations. This list reflects the typical traffic on the road. We construct this list by adopting the method described in [9] with regard to the road’s historical traffic data.
Table 1 represents an example of this list. A time interval and a traffic situation characterize every row in the table. For example, between 7h00 and 10h00, the traffic situation on the road is dense.
A List of expected traffic situations following unpredictable events. This list reflects the usual impact on the traffic of unpredictable events that may occur on the road such as car accidents. It is used to anticipate future changes in traffic conditions when an unpredictable event occurs on the road. The list is constructed from historical traffic data about the impact of unpredictable events on traffic.
Table 2 represents a simple example of this list. It reflects the impact on the traffic of an accident occurred on the road
a real-time traffic situation. It can be calculated using various technologies [17,33,35].
List of expected traffic situations
List of expected traffic situations
List of expected traffic situations following an accident on road
This is a distributed, dynamic and self-organizing model that depends heavily on historical traffic data. Consistent data collection is essential to accurately reflect traffic, ensure the accuracy of this model and achieve goal. The collection and analysis of traffic data is not part of this work. Those interested can refer to [20,35].
The client’s demand is defined by:
Consider
Vehicle
Every vehicle is described by (name, capacity, planning table):
name represents the vehicle’s name,
capacity represents the passenger seats’ number in the vehicle,
planning table refers to the occupancy of the vehicle for each day. Every row in the table is represented by t is time,
The planning table provides the path of the vehicle and the number of passengers at each time.
This is an example of a vehicle: (
Vehicle
planning table
Vehicle
Every trajectory
Massive multi-agent modeling for ODT problem
The ODT problem consists of a large number of elements such as customers, vehicles, roads, traffic situations, etc. Thus, it is modeled as a massive multi-agent problem to represent diverse ODT elements and realize a self-organizing system.
Types of agents
We distinguish two categories of agents: static agents and dynamic agents.
In the static agent category, there is the Client agent, the Vehicle agent and the Pathfinder agent.
Client agent: it sends the demand of the client to all the vehicles in the system and, if available, gets the best vehicle that can serve it.
Vehicle agent: is associated to every vehicle in the system. Its role is to check if it can transport the passengers of a demand.
Pathfinder agent refers to every Vehicle agent and it offers the trajectories for the Vehicle agent to follow.
We identify as dynamic agent: Road agent and Regulator agent. They are dynamic because they self-organize online by changing their number and their characteristics according to traffic situations.
Road agent: is associated to contiguous roads that have a similar speed limit and traffic situation for a given period of time. Regulator agent: is associated to contiguous roads that have a similar traffic situation for a given period of time.
Each road is associated to a Road agent and a Regulator agent. These agents rely on historical traffic data of their roads to continuously predict and reflect real traffic.
General architecture
Figure 1 shows the general architecture of the ODT system. The main agent is the Regulator agent. It interacts with the Road agents, the Pathfinder agents and the contiguous Regulator agents. The ultimate goal of the Road and Regulator agents is to reflect the traffic at its real scale. Thus, the Pathfinder agent provides the Vehicle agent a reliable trajectory with an accurate estimation of the duration of the path.

General architecture.
This section describes the collaboration between agents to treat a new demand. The Client agent broadcasts each new demand to all Vehicle agents. A Vehicle agent executes the demand if it complies with two constraints: (1) having free seats to transport the passengers between the requested times, and (2) inserting the demand into its planning table without breaking the time slots of its previously accepted demands and the new demand. We address these constraints in the next section.
The description of constraints
A Vehicle agent checks its availability when a demand
Constraint (1) assures that the new demand initiates at a time that does not surpass the earliest time to depart, constraint (2) assures that the demand is served without disregarding the time slot of the subsequent demand, constraint (3) asserts that it ends at a time that does not exceed the latest time to reach its destination, and finally, constraint (4) ensures that the service is provided by taking into consideration the time interval for the following order.
Constraints verification
After checking the number of free seats, each Vehicle agent proceeds to check each of the above constraints. To do this, the Vehicle agent contacts the Pathfinder agent to find the trajectory connecting the two locations in each constraint starting from the departure time of the initial place. The Pathfinder agent suggests the usual path1
How a path becomes a usual path is not discussed in this paper.
Based on the List of expected traffic situations of its roads, each contacted Regulator agent calculates the time required to cross its roads segment by applying the algorithm described in [22]. This algorithm respects the FIFO priority. It ensures that a vehicle starting at a time t, will arrive at a time
Then, it sends its part of trajectory containing the computed time to the Pathfinder agent. The latter computes the result of the trajectory from the responses of all the contacted Regulator agents and sends the result to its Vehicle agent. The Vehicle agent checks whether the trajectory matches the currently verified constraint. If it does, the Vehicle agent proceeds to verify the other constraints. If the trajectory does not satisfy the constraint, the Pathfinder suggests two other paths. Then, the same scenario is repeated to estimate each path. Figure 2 shows how agents cooperate in estimating a path.

Agents cooperation strategy.
The Vehicle agent informs the Client agent of its availability to execute the demand after verifying all the constraints. If a Vehicle agent does not comply with these constraints, it cannot conform to the demand.
Vehicle agents able to execute the demand calculate two values: the number of vehicles in circulation and their total traveled distance. Then, they negotiate with each other to find the best vehicle to transport the passengers. The best Vehicle agent is the one that minimizes the number of vehicles in circulation. If two Vehicle agents have the same number, the one that minimizes the total traveled distance is the best. The method of negotiation is explained in [28,29].
We distinguish two types of traffic: a dynamic deterministic traffic and a dynamic stochastic traffic. In this section, we explain how the Road and Regulator agents rely on the historical traffic data of their roads to anticipate the real traffic situation. Finally, we explain the merging and the decomposition of the dynamic agents.
Treatment of the deterministic traffic evolution
Deterministic traffic is the typical traffic of everyday life. Based on the List of expected traffic situations of their roads, Road and Regulator agents self-organize to represent deterministic traffic continuously on its scale. They vary their traffic situation and execute the merging and decomposition operations to assign themselves to a new set of roads depending on the traffic situation.
Determination of dynamic agents and their time intervals
At the initial time
Behavior of dynamic agents during their time intervals
During
During the interval
Behavior of dynamic agents at the end of their time intervals
At
Using the List of expected traffic situations, each Road agent and each Regulator agent check the traffic situation of their roads at
The roads have similar traffic situations during a certain period. In this case, the Road agent and the Regulator agent keep the same set of roads but with a new traffic situation during
The roads have different traffic situations. In other words, at least one of the road has a different traffic situation than the others. In this case, the Road agent and the Regulator agent trigger the decomposition operation by creating one or more new Road agents and new Regulator agents, respectively, according to the traffic situation on their roads. Each new agent Road agent and each new Regulator agent define their roads and their traffic situation during
Treatment of the stochastic traffic evolution
At a time t, a Road agent notices that the expected traffic situation on a road differs from the real situation. In this case, the Road agent detects the occurence of an unpredictable event on the road. It defines the type, the location and the time of the event. Then, it sends an urgent message with the event parameters to the Regulator agent responsible for the impacted road. Based on these parameters and the List of expected traffic situations following unpredictable events of the road, the Regulator agent creates an urgent list for each impacted road. The urgent list contains the new traffic situations of the road during the time of impact. It replaces its List of expected traffic situations during that time. Each Road agent associated with an impacted road received the corresponding urgent list from the Regulator agent. Table 4 is an example of an urgent list created for the road after an accident.
Urgent list
Urgent list
The Road agent and the Regulator agent created based on the urgent list, are referred to as the Urgent Road agent and Urgent Regulator agent, respectively. Each Urgent Regulator agent searches for the Pathfinder agents that are affected by this unpredictable event. These are the agents whose the trajectory of their Vehicle agent will pass through the impacted roads during the impact period. The Urgent Regulator agent re-evaluates these trajectories and sends the new evaluation to the affected Pathfinder agents. The Pathfinder agent, in turn, informs its Vehicle Agent of the new evaluation. If the new evaluation is consistent with the planning table of the Vehicle agent, it continues following the trajectory normally. Otherwise, it decides to divert and asks its Pathfinder agent for a new trajectory. The latter proposes the trajectory that contains no impacted roads or the minimum number of impacted roads. The diversion helps to reduce the negative effect of the event on the trajectory duration.
The dynamic agents self-organize to continuously fit the real traffic. They decompose into several and merge with others contiguous dynamic agents to cover the road network according to the traffic. Therefore, their number varies. For example, during the night at 02:00, there is one Regulator agent. This is not the case during peak hours, when the Regulator agent decomposes to represent the multiple traffic situations.
In the following two subsections, we explain the merging and decomposition operations of dynamic agents. To know how Road agent and Regulator agent apply these operations, please replace the word dynamic agent by Road agent and Regulator agent, respectively.

Merging of road agents in a single one.
At a time
As illustrated in Fig. 3, a Road agent
Decomposition of a dynamic agent
At a time t, a dynamic agent perceives several traffic situations on the roads associated to it. In this case, it decomposes into multiple dynamic agents. Each dynamic agent reassociates with contiguous roads that have the same traffic situation during a common time interval. The time interval is determined as explained in Section 6.1.1. Then, it informs its contiguous dynamic agents about the new traffic situation to trigger the merging operation if possible.
Figure 4 gives an example of Road agents decomposition. The part1 shows a Road agent has two traffic situations (medium and low) on its roads. This contradicts the definition of a Road agent. Therefore, the Road agent decomposes into two Road agents as shown in part 2 and part 3. The Road agent 1 has low traffic and the Road agent 2 has medium traffic.

Decomposition of a road agent.
This section includes experiments based on real instances to validate the proposed approach. These experiments measure:
the number of served demands (clients) considering the traffic situation; the number of satisfied clients when the system considers unpredictable events; the number of Road and Regulator agents associated with the dynamic stochastic road network of a city at various times; the number of contacted agents to evaluate paths.
Experiments parameters
We used the multi-agent simulation toolkit MASON [25] to develop an experimental platform and validate our approach.
We used the road network of a Lebanese city called Tripoli. We used 214 nodes and 410 roads for the experiments. The road has a distance and a speed limit which varies between 40 and 100 km/h. We also selected a well-known transportation company in Tripoli called Connexion. The interview with the general manager enabled us to identify the needs of the Tripolitan population in order to define the number of daily demands, the origin and destination locations and the most requested departure times.
The List of expected traffic situations and the List of expected traffic situations following unpredictable events for each road are generated based on the city traffic statistics provided by the municipality.
The clients’ demands are generated according to the information provided by the general manager of the transportation company. The origin and destination locations are generated by the application of Monte Carlo method [8] on Tripoli locations. The frequently requested locations have a more elevated probability (75%) of being appointed corresponding to other places. Moreover, the number of passengers is haphazardly chosen by applying the uniform distribution to a set of four integers that range between 1 and 4.
The Monte Carlo method is applied to a set of hours that vary between 7:00 and 22:00. The peak hours that have a higher possibility (75%) to be picked than the others range between the two intervals
Experiments results
We conducted three experiments, which are explained in the following subsections.
Number of unsatisfied clients
In these experiments we generate four accidents, each of which we measure:
the number of demand served during the impact time of the accident; the number of clients affected by the accident. These are clients who will be dissatisfied if the system does not consider the accident; the number of satisfied clients among those affected by the accident after the system considers the accident.
We assume that three traffic accidents occurred in Tripoli in one day. The roads are chosen based on Tripoli municipality statistics on the most accident-prone roads. The first accident occurs at 07:30 on a road chosen by applying the Monte Carlo method to the most accident-prone roads between 07:00 and 09:00. The second accident is generated on the same road at 12:30. The road for the third accident generated at 20:30 is chosen among the most prone roads to have accidents between 19:00 and 21:00. We present five scenarios: the first has 100 transportation demands, the second 200, the third 300, the fourth 400, and the fifth 500. The demands of the previous scenario are included in each scenario. Table 5 shows the results obtained for each accident in the five scenarios.
Impact of the three accidents on demands
Impact of the three accidents on demands
In this experiment, we find that: (1) the number of dissatisfied clients increases when the number of served clients during the accident period increases; (2) an accident affects between 2% to 39% of the clients; (3) 50% to 100% of the affected clients are satisfied because accidents are considered by the system.
This experiment ascertains that considering unpredictable events is necessary because the predictable ones are insufficient to reflect the actual traffic. In brief, the stochastic time-dependent travel speed should be considered while computing the trajectories durations.
In this experiment, we measure the number of Road and Regulator agents associated with Tripoli roads. This number is measured every 30 minutes starting at 7:00 until midnight. We additionally choose a road by applying the uniform distribution to the roads where an accident is most likely to occur. Then, we generate an accident on this road and we measure the change in the number of agents due to this accident. Figure 5 shows the results.
The chart shows that: (1) at midnight,when traffic is fluid, Tripoli, made up of 410 roads, is covered by 14 Road agents and a single Regulator agent; (2) the number of Regulator agents is less than the number of Road agents; (3) the number of agents increases during peak hours between
This experiment proves that the dynamic Road and Regulator agents self-organize online by changing their number and their characteristics according to traffic situations. When an unpredictable event appears, the number of dynamic agents increases to reflect accurately the traffic of the roads affected by this event.

Number of road and regulator agents associated with the roads of Tripoli during a day and variation of this number following an accident.
In the approach proposed in [27] where each road is associated with a Road agent, the Pathfinder agent contacts the Road agents to evaluate a path. In our approach, the Pathfinder agent contacts the Regulator agents instead of the Road agent. In this experiment, we measure the number of contacted Road agents in [27] and that of Regulator agents in this approach to evaluate a path. Figure 6 presents the experiment’s results. It shows that the number of contacted Road agents is always greater than that of Regulator agents. Our approach saves more than 60% of the contacted agents.

Difference between the number of contacted roads and regulator agents.
In brief, the two last experiments reveal that the ultimate goal of the dynamic agents is to reflect the traffic on its real scale and optimize the communication by minimizing the number of contacted agents.
This paper presented an agent-based algorithm for the ODT problem in cities characterized by dynamic and stochastic speeds. The main contribution is the resolution of the problem by a massive multi-agent system that considers historical traffic data and unpredictable events disrupting the typical traffic. The system operates online for continuously represent the traffic organization on its scale and produce reliable results to serve the client on time. Experiments with instances based on real data for a city in the north of Lebanon showed that the quality of service increases when the stochastic time-dependent travel speed is considered. 50% to 100% of clients affected by an unpredictable event are satisfied when this event is considered by the system.
Our approach assumes that each road must have the actual traffic situation and consistent and up-to-date historical traffic data. If a road does not have the actual traffic situation or the historical traffic data does not take into consideration a new sudden event, our approach will be limited in the representation of the traffic. Therefore, the results will not be reliable, and the quality of service will decrease.
This approach may be extended to regulate traffic in a city. In addition, multiple agents can be added: road junction agent, unpredictable event agent, etc. Moreover, a Pathfinder agent that offers the shortest time trajectory is under study. The purpose of the usual path is to respect the desires of the drivers and prevent the vehicles from following the same trajectories. Accordingly, this helps to minimize the possibility of traffic on the roads. As an example, if the Pathfinder agent always offers the shortest path in terms of time, then this path taken by all vehicles will never remain the shortest path.
