# Customized Bus Route Optimization with the Real-Time Data

Authors: Kai Huang; Lin Xu; Yao Chen; Qixiu Cheng; Kun An
Journal: Journal of Advanced Transportation
 (2020)

---

## Abstract

This paper investigates the real-time customized bus (CB) route optimization problem, which aims to maximize the service rate for clients and profits for operators. The on-road bus has a flexible route, which can be updated based on the real-time data and route optimization solutions. A two-phase framework is established. In phase 1, the vehicle-related data including existing route and schedule, client-related data involving pick-up/drop-off location, and time windows are collected once receiving a new CB request. The second phase optimizes the bus route by establishing three nonlinear programming models under the given data from phase 1. A concept of profit difference is introduced to decide the served demand. To improve computation efficiency, a real-time search algorithm is proposed that the neighboring buses are tested one by one. Finally, a numerical study based on Sioux Falls network reveals the effectiveness of the proposed methodology. The results indicate that the real-time route optimization can be achieved within the computation time of 0.17–0.38 seconds.


---

## Body

## 1. Introduction

In recent years, a series of traffic problems happen due to traffic congestion in an urban area, such as increasing on-road travel time of citizens during daily commuting. Encouraging public transport, like buses, is one of the main methods to address such a problem [1, 2]. Multiple clients can share a vehicle, which only occupy very limited traffic resources. The travel fee is obviously lower than the taxi and private car. However, the disadvantage of taking the bus is the low level of service (LOS) caused by the long travel time. Bus clients have to walk for a long distance to the fixed station from their desired origins, home, or workplace, which would largely harm their enthusiasm. Hence, the customized bus (CB) is proposed and becomes popular in many cities around the world. It has a flexible route to pick-up waiting clients in their origins. CB plays the role of a bridge between the traditional buses and taxi/private car. CB provides the ride-hailing service that clients can make travel requests by using mobility apps before departure. Clients can publish their desired pick-up/drop-off location and time windows. For the CB companies, named CB operators, they can dynamically change the route and schedule based on the real-time travel request.CB system can be divided into two main categories based on clients’ OD distribution: many-to-one mode, that is, clients have different origins but the same destination; many-to-many mode services, that is, clients have different origins and destinations. The former can meet the demand of clients who have the same trip purpose. Taking the passengers whose destination is the airport as an example, they can share a CB by publishing request online days or hours earlier [3]. Many existing studies have explored the many-to-one CB service [4]. When considering the return trip, a concept named as many-to-one-to-many is proposed by Tarantilis et al. [5]. It can be seen as two independent many-to-one trips when optimizing the bus route. Moreover, to provide more flexible service, many-to-many service is raised that clients are allowed to share a bus if they have an overlapping route [6]. Such a mode has been widely conducted in the shared mobilities, like the taxi sharing and carpooling [7]. In terms of the multiple pick-up and drop-off stations, it makes the system optimization more complex [8].Another difficulty in the CB system service, especially the many-to-many service, is the vehicle routing problem (VRP) [9]. The order of station visiting can largely affect the LOS of in-vehicle and waiting clients. A reasonable route can ensure the service reliability. The existing studies normally establish optimization models to address the CB VRP, like the schedule coordination submodel for the feeder bus [10] and integer programming model for the school bus [11]. In the objective function, the existing studies normally either maximize the service rate or minimize the operation costs [12–14]. However, it is challenging to find a balance between the two aspects. The low service rate results in the potential demand loss, while the high operation cost makes the CB system unsustainable [15–18].The last challenge comes from the real-time demand response. Studies show that only limited papers explore the real-time CB system optimization [19]. With the use of mobility apps, clients are allowed to make a request once he or she decides to take buses. It brings a huge challenge for the CB operator to collect the data, optimize bus routes, and then update the schedule in a short time. Hence, reducing the computation time is essential when providing the real-time decisions.This paper aims to maximize the service rate of CB clients and profits of CB operators. A real-time two-phase research methodology is built. In phase 1, real-time data are collected once a new CB request is proposed. It mainly includes the vehicle-related data with existing route and schedule and client-related data with pick-up/drop-off location and time windows. And then, the collected data are set as the inputs of phase 2, where three CB route optimization models are established. Considering the location of the new request, the many-to-many CB mode can be divided into three categories: only new pick-up service but drop-off location in the existing route, only new drop-off service but pick-up location in the existing route, and both new pick-up and drop-off service. The profit difference is introduced to decide the served demand. To handle the optimization problem, a real-time search algorithm is proposed that the neighboring buses are tested one by one.In the next section, the research methodology is given that including the real-time data collection in phase 1, the optimization model, and solution approach in phase 2. Section3 presents the application to the Sioux Falls network. Conclusions and future work directions are presented in the last section.


## 2. Research Methodology

### 2.1. Problem Setting

We consider a real-time CB route optimization problem that the operators update the bus route once a new request, namely, the latest request, is claimed. The objective of this paper is to find a vehicle to meet the latest request with the objective of maximizing service rate for clients and profit for CB operators. The study region consists ofI bus stations with a parking station denoted as i∈I. The current location is taken as the first station. There are V vehicles in the CB system with a bus denoted as v∈V. The bus v has a fixed route to drop off the in-vehicle clients and pick up waiting clients. The bus will be used to serve the latest client from station i∈I to station j∈I where i≠j. It is defined by decision variables Yi and Xji. Yi equals 1 if vehicle v∈V arrives at station i∈I and 0 otherwise. Xji equals 1 if vehicle departs from station j∈I to station i∈I, where i≠j and 0 otherwise. Similarly, Xij represents the binary decision of vehicle travel from station i∈I to station j∈I. The fixed time window between bus arriving at and departing from each station is given. Let tepi be the desired earliest pick-up time of clients at bus station i∈I, tlpi be the latest pick-up time of clients at bus station i∈I, and tldi be the latest drop-off time of clients at bus station i∈I. Clients who have the similar time windows and the same stations are grouped into one trip.In practice, the pick-up and drop-off location of the latest request might not always exist in the given route. Based on the station location, we divide the CB route optimization problem into three types, as shown in Figure1. Figure 1(a) shows the CB system with a single external pick-up station. The client’s origin location is not in the existing route, while her/his destination location is the bus route. In contrast, Figure 1(b) represents the CB system with a single external drop-off station. Figure 1(c) illustrates the CB system with external pick-up and drop-off stations. Both the client’s pick-up and drop-off stations are not in the existing bus route. The route optimization is to decide serving the latest request or not by updating the bus route. For an empty bus in the parking station, the trip of latest request can be seen as the optimized route.Figure 1
The customized bus system.
(a)(b)(c)


### 2.2. Notation

The notation used throughout the paper is listed below:SetsI:i,j: set of bus stationsV:v: set of busesParametersc: travel cost of bus per time stepp: payment of the latest CB requestttij: travel time from bus station i∈I to bus station j∈I, where i≠jtepi: desired earliest pick-up time of client at bus station i∈Itlpi: latest pick-up time of client at bus station i∈Itldi: latest drop-off time of client at bus station i∈IDecision variablesXij: binary variable; it equals 1, and if vehicle travels from station i∈I to station j∈I, where i≠j, it equals 1 and 0 otherwiseYi: binary variable; it equals 1, and if vehicle arrives at station i∈I, it equals 1 and 0 otherwiseAuxiliary variablestai: arriving time of vehicle at bus station i∈Itdi: departure time of vehicle at bus station i∈Iμi,νi: binary variables involved in the linearization


### 2.3. Phase 1: Real-Time Data Collection

In phase 1, the CB client claims the real-time CB request that includes pick-up location, drop-off location, time window of the desired earliest pick-up time, latest pick-up time, and latest drop-off time. Once such a request is published, the CB operator will search neighboring buses and identify vehicle location, existing route and schedule, in-vehicle and waiting clients’ location, and time window constraints. The neighboring search radius is the distance between the bus current location and latest clients’ pick-up location. The vehicle- and client-related data can be set as inputs of the optimization model in phase 2. The real-time CB route optimization can be fulfilled by rolling the bus search in phase 1 and optimization in phase 2. The profit difference among all tested buses decides the selected bus.


### 2.4. Phase 2: Route Optimization Model

#### 2.4.1. M-1: CB System with Single External Pick-Up Station

The model with a single external pick-up station is formulated as follows. We set the picking up location of the latest CB request as stationI:(1)P1-1maxX,Yϕ=YIsubject to(2)∑i∈IXi1=0,(3)∑j∈IX1j=1,(4)Xii=0,∀i∈I,(5)∑j∈IXij≤1,∀i∈I,(6)∑i∈IXij=1,∀j=2,…,I−1,(7)∑j∈IXjI=∑j∈IXIj,(8)Yi=max∑j∈IXij,∑j∈IXji,∀i=I,(9)ta1=0,(10)td1=0,(11)tai≤minYitlpi,Yitldi,∀i=2,…,I,(12)tdi≥maxYitai,Yitepi,∀i=2,…,I,(13)taj=∑i∈IXijtdi+∑i∈IXijttij,∀j=2,…,I,(14)Xij,Yi∈0,1,tai,tdi≥0,∀i∈I,j∈I.The objective function (1) aims to maximize the service rate of the latest CB request. Constraint (2) defines the starting station of a bus, where the vehicle is found when the latest CB request is proposed. Constraint (3) asks the bus must first leave the starting station and then serve other demand in the next trips. Only one trip between the starting station and other stations is approved. Constraint (4) represents that a bus cannot travel within its own station. Constraint (5) ensures the no more than one trip leaving one station is allowed. If one station is the ending station of this CB service, the trip departing from it would not exist. The term ∑j∈IXij represents all the possible trips leaving station i. Constraint (6) asks the in-vehicle and waiting clients, whose request with the pick-up or drop-off station j=2,…,I−1 has to be satisfied. The term ∑j∈IXji represents all the probable trips arriving at station i. Constraint (7) indicates that the bus must first arrive at and then leave the station, where the latest request happens if the client is served. Otherwise, no bus is arranged to visit this station. Constraint (8) identifies whether the request in one station is served or not based on the bus trip. Constraints (9) and (10) state that the arriving time and departing time are set as 0 in the starting station. Constraint (11) ensures that the bus arrives at one station no later than the waiting clients’ latest pick-up time and the in-vehicle clients’ latest drop-off time. Constraint (12) ensures that the bus leaves one bus station no earlier than the waiting clients’ earliest pick-up time and bus arriving time. Constraint (13) calculates the vehicle arriving time. The term ∑i∈IXijtdi and ∑i∈IXijttij represent the departing time and travel time of the bus at the station i. Constraint (14) specifies the domain of the decision variables.Based on the optimized route inP1-1, we calculate the increased profits of the latest CB request φ and total travel time cost γ1:(15)φ=YIp,(16)γ1=∑i∈I∑j∈JXijttijc,(17)P1-2minX,Yϕ=YI.Subject to Constraints (2)–(14).The objective function (17) minimizes the service rate of the latest CB request. It shares the same constraints with P1-1. Based on the optimized route in P1-2, we calculate the total travel time cost γ2 with equation (16).The profit difference is obtained as follows:(18)P1-3ϕ=φ−γ1+γ2.Equation (18) calculates the profit difference between P1-1 and P1-2. If the latest CB request in P1-1 is not served, ϕ would be equal to 0. Otherwise, it will be a positive or negative value that depends on the increased income and operation cost caused by servicing the latest CB request.


#### 2.4.2. M-2: CB System with Single External Drop-Off Station

The model with a single external drop-off station is formulated as follows. We set the dropping off location of the latest CB request as stationI:(19)P2-1maxX,Yϕ=YI.Constraints (2)–(6) and (9)–(14), plus:(20)Yi=max∑j∈IXij,∑j∈IXji,∀i=I−1,(21)YI=∑j∈IXjI.Constraint (20) identifies whether the request in one station of the existing route is served or not based on the bus trip. Constraint (21) identifies whether the bus arrives at the drop-off station of the latest request or not based on the arriving trip. As this station can be set as the ending station, the departing trips leaving this station might not exist.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and the total travel time cost γ1 in P2-1:(22)P2-2minX,Yϕ=YI.Subject to Constraints (2)–(6), (9)–(14), (20), and (21).Based on equation (16), we calculate the total travel time cost γ2 in P2-2:(23)P2-3ϕ=φ−γ1+γ2.The profit difference betweenP1-1 and P1-2 is obtained based on equation (23).


#### 2.4.3. M-3: CB System with Both External Pick-Up and Drop-Off Stations

The model with both external pick-up and drop-off stations is formulated as follows. We set the picking up location of the latest CB request as stationI−1 and dropping off location as station I:(24)P3-1maxX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), and (21), plus(25)∑i∈IXij=1,∀j=2,…,I−2,(26)∑j∈IXjI−1=∑j∈IXI−1j,(27)YI=YI−1.Constraint (25) asks the existing requests, picking up or dropping off at station j=2,…,I−2, in the existing route must be served. Constraint (26) indicates that the bus must first arrive at and then leave from the station where the latest request happens if this request is met. Constraint (27) represents that the bus has to visit pick-up and drop-off stations if the latest request is served. Otherwise, the bus will not arrive at both stations.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and total travel time cost γ1 in P3-1:(28)P3-2minX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), (21), and (25)–(27).Based on equation (16), we calculate the total travel time cost γ2 in P3-2:(29)P3-3ϕ=φ−γ1+γ2.The profit difference betweenP3-1 and P3-2 is obtained based on equation (29).


#### 2.4.4. Solution Approach

(1). Linearization. The nonlinear constraint (8) incurs a great computation challenge. A series of linearization methods are proposed as follows: constraint (8) is replaced by constraints (31)–(36):(30)Yi≥∑j∈IXij,∀i=I,(31)Yi≥∑j∈IXji,∀i=I,(32)Yi−M1−μi≤∑j∈IXij,∀i=I,(33)Yi−M1−νi≤∑j∈IXji,∀i=I,(34)μi+νi≥1,∀i=I,(35)μi,νi∈0,1,∀i=I,when μit=1 and νit=0. Constraint (32) reduces to Yi≤∑j∈IXij, and constraint (33) is redundant. Together with constraint (30), we have Yi=∑j∈IXij, and constraint (31) reduces to ∑j∈IXij≥∑j∈IXji. When μit=0 and νit=1, constraint (33) reduces to Yi≤∑j∈IXji and constraint (32) is redundant. Together with constraint (31), we have Yi=∑j∈IXji. When μit=1 and νit=1, we have Yi=∑j∈IXij and Yi=∑j∈IXji.(2). Search Algorithm. We develop a real-time search algorithm to optimize the CB system. It can reduce the computation burden by searching the bus one by one. In this way, the maximum profits for CB operators can be obtained via rolling all the found buses. The following pseudocode shows such an algorithm:Step 1: choose the real-time traffic network at time instant of the latest request happening, and set the initial profit difference ϕ as 0.Step 2: search the neighboring buses V of the latest CB request with a given search radius and number of required seats.Step 3: choose the vehicle v among all the found buses V, and check the existing route of this vehicle.Step 3.1: if both the pick-up location and drop-off location of the latest request are in the existing route, go to step 4; otherwise, proceed to step 3.2.Step 3.2: if only the pick-up location is in the existing route, go to step 5; otherwise, proceed to step 3.3.Step 3.3: if only the drop-off location is in the existing route, go to step 6; otherwise, proceed to step 3.4.Step 3.4: if both the pick-up location and drop-off location of the latest request are not in the existing route, go to step 7.Step 4: check the time window constraints. If the selected bus can serve the latest request, arrange the client to it, stop. Otherwise, proceed to step 3.Step 5: optimize models P1-1 and P1-2 and then calculate the profit difference by equation (18). Save the result as ϕv.Step 5.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 5.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 6: optimize models P2-1 and P2-2 and then calculate the profit difference by equation (23). Save the result as ϕv.Step 6.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 6.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 7: optimize models P3-1 and P3-2 and then calculate the profit difference by equation (29). Save the result as ϕv.Step 7.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 7.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Moreover, the parallel computing technique can be used to save computation time. The route optimization of each bus in phase 2 is independent that can be carried out at the same time with multiprocessing modules. In this way, the total computation time can be reduced to1/V.


## 2.1. Problem Setting

We consider a real-time CB route optimization problem that the operators update the bus route once a new request, namely, the latest request, is claimed. The objective of this paper is to find a vehicle to meet the latest request with the objective of maximizing service rate for clients and profit for CB operators. The study region consists ofI bus stations with a parking station denoted as i∈I. The current location is taken as the first station. There are V vehicles in the CB system with a bus denoted as v∈V. The bus v has a fixed route to drop off the in-vehicle clients and pick up waiting clients. The bus will be used to serve the latest client from station i∈I to station j∈I where i≠j. It is defined by decision variables Yi and Xji. Yi equals 1 if vehicle v∈V arrives at station i∈I and 0 otherwise. Xji equals 1 if vehicle departs from station j∈I to station i∈I, where i≠j and 0 otherwise. Similarly, Xij represents the binary decision of vehicle travel from station i∈I to station j∈I. The fixed time window between bus arriving at and departing from each station is given. Let tepi be the desired earliest pick-up time of clients at bus station i∈I, tlpi be the latest pick-up time of clients at bus station i∈I, and tldi be the latest drop-off time of clients at bus station i∈I. Clients who have the similar time windows and the same stations are grouped into one trip.In practice, the pick-up and drop-off location of the latest request might not always exist in the given route. Based on the station location, we divide the CB route optimization problem into three types, as shown in Figure1. Figure 1(a) shows the CB system with a single external pick-up station. The client’s origin location is not in the existing route, while her/his destination location is the bus route. In contrast, Figure 1(b) represents the CB system with a single external drop-off station. Figure 1(c) illustrates the CB system with external pick-up and drop-off stations. Both the client’s pick-up and drop-off stations are not in the existing bus route. The route optimization is to decide serving the latest request or not by updating the bus route. For an empty bus in the parking station, the trip of latest request can be seen as the optimized route.Figure 1
The customized bus system.
(a)(b)(c)


## 2.2. Notation

The notation used throughout the paper is listed below:SetsI:i,j: set of bus stationsV:v: set of busesParametersc: travel cost of bus per time stepp: payment of the latest CB requestttij: travel time from bus station i∈I to bus station j∈I, where i≠jtepi: desired earliest pick-up time of client at bus station i∈Itlpi: latest pick-up time of client at bus station i∈Itldi: latest drop-off time of client at bus station i∈IDecision variablesXij: binary variable; it equals 1, and if vehicle travels from station i∈I to station j∈I, where i≠j, it equals 1 and 0 otherwiseYi: binary variable; it equals 1, and if vehicle arrives at station i∈I, it equals 1 and 0 otherwiseAuxiliary variablestai: arriving time of vehicle at bus station i∈Itdi: departure time of vehicle at bus station i∈Iμi,νi: binary variables involved in the linearization


## 2.3. Phase 1: Real-Time Data Collection

In phase 1, the CB client claims the real-time CB request that includes pick-up location, drop-off location, time window of the desired earliest pick-up time, latest pick-up time, and latest drop-off time. Once such a request is published, the CB operator will search neighboring buses and identify vehicle location, existing route and schedule, in-vehicle and waiting clients’ location, and time window constraints. The neighboring search radius is the distance between the bus current location and latest clients’ pick-up location. The vehicle- and client-related data can be set as inputs of the optimization model in phase 2. The real-time CB route optimization can be fulfilled by rolling the bus search in phase 1 and optimization in phase 2. The profit difference among all tested buses decides the selected bus.


## 2.4. Phase 2: Route Optimization Model

### 2.4.1. M-1: CB System with Single External Pick-Up Station

The model with a single external pick-up station is formulated as follows. We set the picking up location of the latest CB request as stationI:(1)P1-1maxX,Yϕ=YIsubject to(2)∑i∈IXi1=0,(3)∑j∈IX1j=1,(4)Xii=0,∀i∈I,(5)∑j∈IXij≤1,∀i∈I,(6)∑i∈IXij=1,∀j=2,…,I−1,(7)∑j∈IXjI=∑j∈IXIj,(8)Yi=max∑j∈IXij,∑j∈IXji,∀i=I,(9)ta1=0,(10)td1=0,(11)tai≤minYitlpi,Yitldi,∀i=2,…,I,(12)tdi≥maxYitai,Yitepi,∀i=2,…,I,(13)taj=∑i∈IXijtdi+∑i∈IXijttij,∀j=2,…,I,(14)Xij,Yi∈0,1,tai,tdi≥0,∀i∈I,j∈I.The objective function (1) aims to maximize the service rate of the latest CB request. Constraint (2) defines the starting station of a bus, where the vehicle is found when the latest CB request is proposed. Constraint (3) asks the bus must first leave the starting station and then serve other demand in the next trips. Only one trip between the starting station and other stations is approved. Constraint (4) represents that a bus cannot travel within its own station. Constraint (5) ensures the no more than one trip leaving one station is allowed. If one station is the ending station of this CB service, the trip departing from it would not exist. The term ∑j∈IXij represents all the possible trips leaving station i. Constraint (6) asks the in-vehicle and waiting clients, whose request with the pick-up or drop-off station j=2,…,I−1 has to be satisfied. The term ∑j∈IXji represents all the probable trips arriving at station i. Constraint (7) indicates that the bus must first arrive at and then leave the station, where the latest request happens if the client is served. Otherwise, no bus is arranged to visit this station. Constraint (8) identifies whether the request in one station is served or not based on the bus trip. Constraints (9) and (10) state that the arriving time and departing time are set as 0 in the starting station. Constraint (11) ensures that the bus arrives at one station no later than the waiting clients’ latest pick-up time and the in-vehicle clients’ latest drop-off time. Constraint (12) ensures that the bus leaves one bus station no earlier than the waiting clients’ earliest pick-up time and bus arriving time. Constraint (13) calculates the vehicle arriving time. The term ∑i∈IXijtdi and ∑i∈IXijttij represent the departing time and travel time of the bus at the station i. Constraint (14) specifies the domain of the decision variables.Based on the optimized route inP1-1, we calculate the increased profits of the latest CB request φ and total travel time cost γ1:(15)φ=YIp,(16)γ1=∑i∈I∑j∈JXijttijc,(17)P1-2minX,Yϕ=YI.Subject to Constraints (2)–(14).The objective function (17) minimizes the service rate of the latest CB request. It shares the same constraints with P1-1. Based on the optimized route in P1-2, we calculate the total travel time cost γ2 with equation (16).The profit difference is obtained as follows:(18)P1-3ϕ=φ−γ1+γ2.Equation (18) calculates the profit difference between P1-1 and P1-2. If the latest CB request in P1-1 is not served, ϕ would be equal to 0. Otherwise, it will be a positive or negative value that depends on the increased income and operation cost caused by servicing the latest CB request.


### 2.4.2. M-2: CB System with Single External Drop-Off Station

The model with a single external drop-off station is formulated as follows. We set the dropping off location of the latest CB request as stationI:(19)P2-1maxX,Yϕ=YI.Constraints (2)–(6) and (9)–(14), plus:(20)Yi=max∑j∈IXij,∑j∈IXji,∀i=I−1,(21)YI=∑j∈IXjI.Constraint (20) identifies whether the request in one station of the existing route is served or not based on the bus trip. Constraint (21) identifies whether the bus arrives at the drop-off station of the latest request or not based on the arriving trip. As this station can be set as the ending station, the departing trips leaving this station might not exist.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and the total travel time cost γ1 in P2-1:(22)P2-2minX,Yϕ=YI.Subject to Constraints (2)–(6), (9)–(14), (20), and (21).Based on equation (16), we calculate the total travel time cost γ2 in P2-2:(23)P2-3ϕ=φ−γ1+γ2.The profit difference betweenP1-1 and P1-2 is obtained based on equation (23).


### 2.4.3. M-3: CB System with Both External Pick-Up and Drop-Off Stations

The model with both external pick-up and drop-off stations is formulated as follows. We set the picking up location of the latest CB request as stationI−1 and dropping off location as station I:(24)P3-1maxX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), and (21), plus(25)∑i∈IXij=1,∀j=2,…,I−2,(26)∑j∈IXjI−1=∑j∈IXI−1j,(27)YI=YI−1.Constraint (25) asks the existing requests, picking up or dropping off at station j=2,…,I−2, in the existing route must be served. Constraint (26) indicates that the bus must first arrive at and then leave from the station where the latest request happens if this request is met. Constraint (27) represents that the bus has to visit pick-up and drop-off stations if the latest request is served. Otherwise, the bus will not arrive at both stations.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and total travel time cost γ1 in P3-1:(28)P3-2minX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), (21), and (25)–(27).Based on equation (16), we calculate the total travel time cost γ2 in P3-2:(29)P3-3ϕ=φ−γ1+γ2.The profit difference betweenP3-1 and P3-2 is obtained based on equation (29).


### 2.4.4. Solution Approach

(1). Linearization. The nonlinear constraint (8) incurs a great computation challenge. A series of linearization methods are proposed as follows: constraint (8) is replaced by constraints (31)–(36):(30)Yi≥∑j∈IXij,∀i=I,(31)Yi≥∑j∈IXji,∀i=I,(32)Yi−M1−μi≤∑j∈IXij,∀i=I,(33)Yi−M1−νi≤∑j∈IXji,∀i=I,(34)μi+νi≥1,∀i=I,(35)μi,νi∈0,1,∀i=I,when μit=1 and νit=0. Constraint (32) reduces to Yi≤∑j∈IXij, and constraint (33) is redundant. Together with constraint (30), we have Yi=∑j∈IXij, and constraint (31) reduces to ∑j∈IXij≥∑j∈IXji. When μit=0 and νit=1, constraint (33) reduces to Yi≤∑j∈IXji and constraint (32) is redundant. Together with constraint (31), we have Yi=∑j∈IXji. When μit=1 and νit=1, we have Yi=∑j∈IXij and Yi=∑j∈IXji.(2). Search Algorithm. We develop a real-time search algorithm to optimize the CB system. It can reduce the computation burden by searching the bus one by one. In this way, the maximum profits for CB operators can be obtained via rolling all the found buses. The following pseudocode shows such an algorithm:Step 1: choose the real-time traffic network at time instant of the latest request happening, and set the initial profit difference ϕ as 0.Step 2: search the neighboring buses V of the latest CB request with a given search radius and number of required seats.Step 3: choose the vehicle v among all the found buses V, and check the existing route of this vehicle.Step 3.1: if both the pick-up location and drop-off location of the latest request are in the existing route, go to step 4; otherwise, proceed to step 3.2.Step 3.2: if only the pick-up location is in the existing route, go to step 5; otherwise, proceed to step 3.3.Step 3.3: if only the drop-off location is in the existing route, go to step 6; otherwise, proceed to step 3.4.Step 3.4: if both the pick-up location and drop-off location of the latest request are not in the existing route, go to step 7.Step 4: check the time window constraints. If the selected bus can serve the latest request, arrange the client to it, stop. Otherwise, proceed to step 3.Step 5: optimize models P1-1 and P1-2 and then calculate the profit difference by equation (18). Save the result as ϕv.Step 5.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 5.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 6: optimize models P2-1 and P2-2 and then calculate the profit difference by equation (23). Save the result as ϕv.Step 6.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 6.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 7: optimize models P3-1 and P3-2 and then calculate the profit difference by equation (29). Save the result as ϕv.Step 7.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 7.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Moreover, the parallel computing technique can be used to save computation time. The route optimization of each bus in phase 2 is independent that can be carried out at the same time with multiprocessing modules. In this way, the total computation time can be reduced to1/V.


## 2.4.1. M-1: CB System with Single External Pick-Up Station

The model with a single external pick-up station is formulated as follows. We set the picking up location of the latest CB request as stationI:(1)P1-1maxX,Yϕ=YIsubject to(2)∑i∈IXi1=0,(3)∑j∈IX1j=1,(4)Xii=0,∀i∈I,(5)∑j∈IXij≤1,∀i∈I,(6)∑i∈IXij=1,∀j=2,…,I−1,(7)∑j∈IXjI=∑j∈IXIj,(8)Yi=max∑j∈IXij,∑j∈IXji,∀i=I,(9)ta1=0,(10)td1=0,(11)tai≤minYitlpi,Yitldi,∀i=2,…,I,(12)tdi≥maxYitai,Yitepi,∀i=2,…,I,(13)taj=∑i∈IXijtdi+∑i∈IXijttij,∀j=2,…,I,(14)Xij,Yi∈0,1,tai,tdi≥0,∀i∈I,j∈I.The objective function (1) aims to maximize the service rate of the latest CB request. Constraint (2) defines the starting station of a bus, where the vehicle is found when the latest CB request is proposed. Constraint (3) asks the bus must first leave the starting station and then serve other demand in the next trips. Only one trip between the starting station and other stations is approved. Constraint (4) represents that a bus cannot travel within its own station. Constraint (5) ensures the no more than one trip leaving one station is allowed. If one station is the ending station of this CB service, the trip departing from it would not exist. The term ∑j∈IXij represents all the possible trips leaving station i. Constraint (6) asks the in-vehicle and waiting clients, whose request with the pick-up or drop-off station j=2,…,I−1 has to be satisfied. The term ∑j∈IXji represents all the probable trips arriving at station i. Constraint (7) indicates that the bus must first arrive at and then leave the station, where the latest request happens if the client is served. Otherwise, no bus is arranged to visit this station. Constraint (8) identifies whether the request in one station is served or not based on the bus trip. Constraints (9) and (10) state that the arriving time and departing time are set as 0 in the starting station. Constraint (11) ensures that the bus arrives at one station no later than the waiting clients’ latest pick-up time and the in-vehicle clients’ latest drop-off time. Constraint (12) ensures that the bus leaves one bus station no earlier than the waiting clients’ earliest pick-up time and bus arriving time. Constraint (13) calculates the vehicle arriving time. The term ∑i∈IXijtdi and ∑i∈IXijttij represent the departing time and travel time of the bus at the station i. Constraint (14) specifies the domain of the decision variables.Based on the optimized route inP1-1, we calculate the increased profits of the latest CB request φ and total travel time cost γ1:(15)φ=YIp,(16)γ1=∑i∈I∑j∈JXijttijc,(17)P1-2minX,Yϕ=YI.Subject to Constraints (2)–(14).The objective function (17) minimizes the service rate of the latest CB request. It shares the same constraints with P1-1. Based on the optimized route in P1-2, we calculate the total travel time cost γ2 with equation (16).The profit difference is obtained as follows:(18)P1-3ϕ=φ−γ1+γ2.Equation (18) calculates the profit difference between P1-1 and P1-2. If the latest CB request in P1-1 is not served, ϕ would be equal to 0. Otherwise, it will be a positive or negative value that depends on the increased income and operation cost caused by servicing the latest CB request.


## 2.4.2. M-2: CB System with Single External Drop-Off Station

The model with a single external drop-off station is formulated as follows. We set the dropping off location of the latest CB request as stationI:(19)P2-1maxX,Yϕ=YI.Constraints (2)–(6) and (9)–(14), plus:(20)Yi=max∑j∈IXij,∑j∈IXji,∀i=I−1,(21)YI=∑j∈IXjI.Constraint (20) identifies whether the request in one station of the existing route is served or not based on the bus trip. Constraint (21) identifies whether the bus arrives at the drop-off station of the latest request or not based on the arriving trip. As this station can be set as the ending station, the departing trips leaving this station might not exist.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and the total travel time cost γ1 in P2-1:(22)P2-2minX,Yϕ=YI.Subject to Constraints (2)–(6), (9)–(14), (20), and (21).Based on equation (16), we calculate the total travel time cost γ2 in P2-2:(23)P2-3ϕ=φ−γ1+γ2.The profit difference betweenP1-1 and P1-2 is obtained based on equation (23).


## 2.4.3. M-3: CB System with Both External Pick-Up and Drop-Off Stations

The model with both external pick-up and drop-off stations is formulated as follows. We set the picking up location of the latest CB request as stationI−1 and dropping off location as station I:(24)P3-1maxX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), and (21), plus(25)∑i∈IXij=1,∀j=2,…,I−2,(26)∑j∈IXjI−1=∑j∈IXI−1j,(27)YI=YI−1.Constraint (25) asks the existing requests, picking up or dropping off at station j=2,…,I−2, in the existing route must be served. Constraint (26) indicates that the bus must first arrive at and then leave from the station where the latest request happens if this request is met. Constraint (27) represents that the bus has to visit pick-up and drop-off stations if the latest request is served. Otherwise, the bus will not arrive at both stations.Based on equations (15) and (16), we calculate the increased profits of the latest CB request φ and total travel time cost γ1 in P3-1:(28)P3-2minX,Yϕ=YI−1.Subject to Constraints (2)–(5), (9)–(14), (20), (21), and (25)–(27).Based on equation (16), we calculate the total travel time cost γ2 in P3-2:(29)P3-3ϕ=φ−γ1+γ2.The profit difference betweenP3-1 and P3-2 is obtained based on equation (29).


## 2.4.4. Solution Approach

(1). Linearization. The nonlinear constraint (8) incurs a great computation challenge. A series of linearization methods are proposed as follows: constraint (8) is replaced by constraints (31)–(36):(30)Yi≥∑j∈IXij,∀i=I,(31)Yi≥∑j∈IXji,∀i=I,(32)Yi−M1−μi≤∑j∈IXij,∀i=I,(33)Yi−M1−νi≤∑j∈IXji,∀i=I,(34)μi+νi≥1,∀i=I,(35)μi,νi∈0,1,∀i=I,when μit=1 and νit=0. Constraint (32) reduces to Yi≤∑j∈IXij, and constraint (33) is redundant. Together with constraint (30), we have Yi=∑j∈IXij, and constraint (31) reduces to ∑j∈IXij≥∑j∈IXji. When μit=0 and νit=1, constraint (33) reduces to Yi≤∑j∈IXji and constraint (32) is redundant. Together with constraint (31), we have Yi=∑j∈IXji. When μit=1 and νit=1, we have Yi=∑j∈IXij and Yi=∑j∈IXji.(2). Search Algorithm. We develop a real-time search algorithm to optimize the CB system. It can reduce the computation burden by searching the bus one by one. In this way, the maximum profits for CB operators can be obtained via rolling all the found buses. The following pseudocode shows such an algorithm:Step 1: choose the real-time traffic network at time instant of the latest request happening, and set the initial profit difference ϕ as 0.Step 2: search the neighboring buses V of the latest CB request with a given search radius and number of required seats.Step 3: choose the vehicle v among all the found buses V, and check the existing route of this vehicle.Step 3.1: if both the pick-up location and drop-off location of the latest request are in the existing route, go to step 4; otherwise, proceed to step 3.2.Step 3.2: if only the pick-up location is in the existing route, go to step 5; otherwise, proceed to step 3.3.Step 3.3: if only the drop-off location is in the existing route, go to step 6; otherwise, proceed to step 3.4.Step 3.4: if both the pick-up location and drop-off location of the latest request are not in the existing route, go to step 7.Step 4: check the time window constraints. If the selected bus can serve the latest request, arrange the client to it, stop. Otherwise, proceed to step 3.Step 5: optimize models P1-1 and P1-2 and then calculate the profit difference by equation (18). Save the result as ϕv.Step 5.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 5.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 6: optimize models P2-1 and P2-2 and then calculate the profit difference by equation (23). Save the result as ϕv.Step 6.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 6.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Step 7: optimize models P3-1 and P3-2 and then calculate the profit difference by equation (29). Save the result as ϕv.Step 7.1: compare the ϕv and ϕ. If ϕv>ϕ, update the optional bus as v.Step 7.2: if v=V, stop. Otherwise, set v=v+1 and go to step 3.Moreover, the parallel computing technique can be used to save computation time. The route optimization of each bus in phase 2 is independent that can be carried out at the same time with multiprocessing modules. In this way, the total computation time can be reduced to1/V.


## 3. Case Study

### 3.1. Setting up the Case Study

The classical Sioux Falls network is used to demonstrate the applicability of the proposed models and algorithms. As shown in Figure2, 24 notes and 38 bidirectional links exist in the network. We carry out the real-time optimization based on the given data including the client’s demand, bus’s current location, route, and schedule. We assume that one bus with known routes is already found by the neighboring search, which is providing CB service at the time instant of one new request claiming. Even M-3 can be seen as a general model to optimization all three scenarios, we still use three independent models in this paper. It is to reduce the computation time as required by the real-time requests. An initial test reveals that the total computation time can be reduced to about 50% by using M-1 and M-2 to replace M-3 in special scenarios. Three scenarios are given in this case study. Figure 2(a) represents the M-1 CB system with a single external pick-up station. One client makes a request by starting from station #21 to station #20. Figure 2(b) shows the M-2 CB system with a single external drop-off station. The client departs from station #22 to station #21. Figure 2(c) illustrates the M-3 CB system with both external pick-up and drop-off stations. Station #21 and station #16 are the origin and destination of the latest request.Figure 2
The customized bus system scenarios.
(a)(b)(c)The client’s CB trip is defined by the OD location and pick-up/drop-off time windows at each station in Table1. The CB trips are not necessary to be tracked in the optimization model, which can save the computation burden by reducing the number of decision variables.Table 1
CB request with given OD location and time windows.
ModelClient IDOriginDestinationLocationtepi (minutes)tlpi (minutes)LocationtldiM-11#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#212224#2026M-21#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#221719#2122M-31#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#212224#1633


### 3.2. Optimization Results

The proposed CB route optimization model is solved by Python calling GUROBI 7.0.2 solver on an i7 processor @2.40 GHz, 8 GB RAM computer with a Windows 7 64 bit operating system. The total computation time is 0.17–0.38 seconds. Table2 shows the optimized route.Table 2
Results of CB optimization models.
ModeOriginDestinationLocationDeparting time (minutes)Pick-up client IDLocationArriving time (minutes)Drop-off client IDM-1#4—1,2#11——#1163#1461#14104#1511—#15165#22162#2219—#2119—#21216#20223,6#2026—#18264,5#1830————M-2#401,2#110—#1163#1461#14104#1511—#15165#22162#22196#21196#2121—#20213#2025—#18254,5#1829————M-3#401,2#110—#1163#1461#14104#1511—#15165#22162#2219—#2119#21216#20223#2026—#18264,5#1830—#16306#1633————As shown in M-1 of Table2, we can see that the CB request happening at location #21 can be served that does not break the existing service planning. The in-vehicle and waiting clients can be served within their desired pick-up/drop-off time windows. A new picking up location #21 is put into the CB route, and the optimized route has been changed to #4-#11-#15-#22-#21-#20-#18. We then made a sensitivity analysis on the time window constraints. We assume that both the earliest and latest drop-off time in the latest request are later than 20 minutes. The results show that there is a time window conflict for the bus to service clients in stations #22 and #21 simultaneously. The bus will follow the old route to serve the existing in-vehicle and waiting clients. In M-2 of Table 2, the optimized route is #4-#11-#15-#22-#21-#20-#18 by adding a new drop-off station #21. The CB system can serve the latest client by taking a detour and does not have a large travel delay. All the clients’ time window constraints can be ensured. In M-3 of Table 2, the drop-off location of the latest client is set as the ending station of this CB system. The total operation time rises to 30 minutes. The optimized route is #4-#11-#15-#22-#21-#20-#18-#16. Moreover, the sensitivity analysis in M-2 and M-3 is carried out by using a similar method in M-1. The results reveal that the latest CB request satisfying is largely dependent on the time window constraints.


### 3.3. Remarks

In this study, a two-phase research methodology is proposed. Considering the limited techniques to data collection, we assume that the vehicle- and client-related data are known. The CB service route is optimized based on the given data. Although we simplify this phase 1 of data collection, the complete CB route dynamic optimization has been conducted. In addition, the proposed neighboring buses search algorithm can fulfill the real-time CB route optimization. We have recognized the system optimal results cannot be obtained in this study [20], but the computation time and burden can be reduced by testing the bus one by one. In practice, it brings a huge challenge for the existing studies to update the bus route in a short time when optimizing the CB system with multiple vehicles and routes. This paper provides a feasible method to address large-scale many-to-many CB route optimization in an urban area.


## 3.1. Setting up the Case Study

The classical Sioux Falls network is used to demonstrate the applicability of the proposed models and algorithms. As shown in Figure2, 24 notes and 38 bidirectional links exist in the network. We carry out the real-time optimization based on the given data including the client’s demand, bus’s current location, route, and schedule. We assume that one bus with known routes is already found by the neighboring search, which is providing CB service at the time instant of one new request claiming. Even M-3 can be seen as a general model to optimization all three scenarios, we still use three independent models in this paper. It is to reduce the computation time as required by the real-time requests. An initial test reveals that the total computation time can be reduced to about 50% by using M-1 and M-2 to replace M-3 in special scenarios. Three scenarios are given in this case study. Figure 2(a) represents the M-1 CB system with a single external pick-up station. One client makes a request by starting from station #21 to station #20. Figure 2(b) shows the M-2 CB system with a single external drop-off station. The client departs from station #22 to station #21. Figure 2(c) illustrates the M-3 CB system with both external pick-up and drop-off stations. Station #21 and station #16 are the origin and destination of the latest request.Figure 2
The customized bus system scenarios.
(a)(b)(c)The client’s CB trip is defined by the OD location and pick-up/drop-off time windows at each station in Table1. The CB trips are not necessary to be tracked in the optimization model, which can save the computation burden by reducing the number of decision variables.Table 1
CB request with given OD location and time windows.
ModelClient IDOriginDestinationLocationtepi (minutes)tlpi (minutes)LocationtldiM-11#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#212224#2026M-21#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#221719#2122M-31#4——#14112#4——#22203#1157#20264#141112#18305#151417#18306#212224#1633


## 3.2. Optimization Results

The proposed CB route optimization model is solved by Python calling GUROBI 7.0.2 solver on an i7 processor @2.40 GHz, 8 GB RAM computer with a Windows 7 64 bit operating system. The total computation time is 0.17–0.38 seconds. Table2 shows the optimized route.Table 2
Results of CB optimization models.
ModeOriginDestinationLocationDeparting time (minutes)Pick-up client IDLocationArriving time (minutes)Drop-off client IDM-1#4—1,2#11——#1163#1461#14104#1511—#15165#22162#2219—#2119—#21216#20223,6#2026—#18264,5#1830————M-2#401,2#110—#1163#1461#14104#1511—#15165#22162#22196#21196#2121—#20213#2025—#18254,5#1829————M-3#401,2#110—#1163#1461#14104#1511—#15165#22162#2219—#2119#21216#20223#2026—#18264,5#1830—#16306#1633————As shown in M-1 of Table2, we can see that the CB request happening at location #21 can be served that does not break the existing service planning. The in-vehicle and waiting clients can be served within their desired pick-up/drop-off time windows. A new picking up location #21 is put into the CB route, and the optimized route has been changed to #4-#11-#15-#22-#21-#20-#18. We then made a sensitivity analysis on the time window constraints. We assume that both the earliest and latest drop-off time in the latest request are later than 20 minutes. The results show that there is a time window conflict for the bus to service clients in stations #22 and #21 simultaneously. The bus will follow the old route to serve the existing in-vehicle and waiting clients. In M-2 of Table 2, the optimized route is #4-#11-#15-#22-#21-#20-#18 by adding a new drop-off station #21. The CB system can serve the latest client by taking a detour and does not have a large travel delay. All the clients’ time window constraints can be ensured. In M-3 of Table 2, the drop-off location of the latest client is set as the ending station of this CB system. The total operation time rises to 30 minutes. The optimized route is #4-#11-#15-#22-#21-#20-#18-#16. Moreover, the sensitivity analysis in M-2 and M-3 is carried out by using a similar method in M-1. The results reveal that the latest CB request satisfying is largely dependent on the time window constraints.


## 3.3. Remarks

In this study, a two-phase research methodology is proposed. Considering the limited techniques to data collection, we assume that the vehicle- and client-related data are known. The CB service route is optimized based on the given data. Although we simplify this phase 1 of data collection, the complete CB route dynamic optimization has been conducted. In addition, the proposed neighboring buses search algorithm can fulfill the real-time CB route optimization. We have recognized the system optimal results cannot be obtained in this study [20], but the computation time and burden can be reduced by testing the bus one by one. In practice, it brings a huge challenge for the existing studies to update the bus route in a short time when optimizing the CB system with multiple vehicles and routes. This paper provides a feasible method to address large-scale many-to-many CB route optimization in an urban area.


## 4. Conclusion

This paper studies the CB route optimization with real-time data. A two-phase research methodology is established including the data collection and route optimization. In phase 1, the vehicle- and client-related data are real-time collected and then is set as the input to phase 2. Three nonlinear programming models are established to address the many-to-many CB optimization problem. A concept of profit difference is proposed that decides the served requests. A customized solution approach including a linearization method and search algorithm is proposed. The case study based on the Sioux Falls network is carried out to verify the proposed methodology [21–28].The results show that the proposed optimization model can address the CB request in 0.17–0.38 seconds. It indicates that the real-time CB route optimization is fulfilled by searching the neighboring buses one by one, conducting route optimization, and then comparing the profit difference. The optimization solutions represent that CB request can be satisfied if the bus takes a detour and ensures the existing clients’ pick-up/drop-off location and time window constraints simultaneously. Moreover, the sensitivity analysis also verifies the reliability of the proposed models.Although this paper conducts the CB route optimization, the vehicle- and client-related data are given in the case study. In the future study, the rolling horizon method based on the real-time data can be explored. Furthermore, to save the computation time and burden, we introduce the profit difference. However, the global optimal solutions might not be obtained. Another possible extension is on global optimization of CB route optimization problem.



---

*Source: 8838994-2020-08-28.xml*