A Posteriori Approach of Real-time Ridesharing Problem with
Intermediate Locations
Kamel Aissat
1
and Ammar Oulmara
2
1
University of Lorraine - LORIA, Nancy, France
2
University of Lorraine, Ile de Saulcy, Metz, France
Keywords:
Operations Research, Transport, Ridesharing, Shortest Path Problem, Geographical Maps.
Abstract:
Ridesharing is a travel mode that provides several benefits and solutions, such as the reduction of travel cost,
the reduction of the traffic congestion and the provision of travel options. In the classical ridesharing approach,
the driver makes a detour to the rider’s origin in order to pick-up the rider, then drives him to his destination
and finally the driver goes to his own destination. This implies that the driver endures the whole detour and
may not accept such matching if the detour is too long. However, the matching could be accepted if the
rider meets the driver at an intermediate location. In this paper, we present a general ridesharing approach in
which a driver and a rider accept to meet each other at an intermediate pick-up location and to separate at an
intermediate drop-off location not necessarily their origins and destinations locations, respectively.
Thus, for a given rider, we propose an exact and heuristic methods to determine the best driver and the best
meeting locations that minimize a total travel cost. Finally, we perform a numerical study using a real road
network and a real dataset. Our experimental analysis shows that our heuristics provide efficient performance
within short CPU times and improve participants cost-savings and matching rate compared to the classical
ridesharing.
1 INTRODUCTION
Several worldwide urban cities face mobility prob-
lems among which the insufficiency and the satura-
tion of the current offer of public transport, traffic
congestion and carbon emissions. Those problems
impact the environment and the quality of life of cit-
izens. The transportation activity is responsible for
a great part of carbon emissions. At least half of to-
tal carbon emissions is due to private vehicles (Metz
et al., 2005). Nowadays, governments begins to be
conscious of the urgency to conserve the environ-
ment by investing in more environmentally friendly
and safe modes of transportation like Electric vehicles
(Sassi and Oulamara, 2014) and ridesharing systems.
Ridesharing helps reducing the number of vehicles
since most private vehicle trips are made with only
one passenger occupancy. The total cost of single pas-
senger trips is quantified in (Hartwig and Buchmann,
2006). This study estimates that the cost of “empty
seats” in the world would be about 500 billion dollars
per year. Thus, a significant scope for reduction of
cost and the number of cars on the road requires in-
telligent usage of private vehicles. In that case, a ve-
hicle is considered as a means of mobility rather than
an ownership. In order to avoid empty seats during
trips, recent initiatives such as ridesharing services,
have been deployed with success.
A ridesharing service brings together users with
similar itineraries and time schedules. More pre-
cisely, a driver with his vehicle and a rider, traveling
from their individual starting locations to their desti-
nations, share a common part of their itinerary using
the driver’s vehicle as well as a part of vehicle-related
expenses.
The considerable progress in embedded and mo-
bile computing technologies such as smartphones,
along with the pervasive diffusion of online social net-
working tools and geolocation devices (Global Posi-
tioning System - GPS), facilitate the use of rideshar-
ing services. Thus, a new and innovative solution of
ridesharing service has emerged. It consists in an au-
tomatic and instant matching of riders through a net-
work service by using smartphones as both geolo-
cation and communication devices. This service is
called real-time ridesharing.
Several methods have been proposed in the liter-
ature to solve the simplest form of ridesharing, also
63
Aissat K. and Oulmara A..
A Posteriori Approach of Real-time Ridesharing Problem with Intermediate Locations.
DOI: 10.5220/0005256100630074
In Proceedings of the International Conference on Operations Research and Enterprise Systems (ICORES-2015), pages 63-74
ISBN: 978-989-758-075-8
Copyright
c
2015 SCITEPRESS (Science and Technology Publications, Lda.)
called classical ridesharing, see (Agatz et al., 2012).
In this simplest form, the driver picks up the rider at
his starting location, drops him off at his ending lo-
cation and then continues to his target location. This
method is the most implemented in ridesharing ser-
vices. Thus, users (drivers and riders) send their re-
quests (demands and offers of ridesharing) and the
system proposes the best matchings of offers and de-
mands regarding the itinerary of each user. However,
the matching opportunities of drivers and riders in the
classical ridesharing decrease when itineraries of rid-
ers and drivers are slightly different. In order to over-
come this lack of flexibilty, instead of allowing the
driver to go to a rider’s origin to pick him up and drop
him off at his destination, in this paper, we allow the
driver and the rider to meet and to separate at inter-
mediate locations, not necessarily at the rider’s origin
and rider’s destination (see Figure 1).
Specifically, the rider travels on his own to the first
intermediate location, where he is picked up by the
driver. He is then dropped off at the second interme-
diate location, where he will continue to his ending
location. Solving the problem of ridesharing with in-
termediate locations requires the development of effi-
cient algorithms that determine the optimal interme-
diate locations regarding the itineraries of riders and
drivers.
2 LITERATURE REVIEW
Depending on the form of the ridesharing in practice,
we distinguish the following optimization problems:
Slugging problem, Taxi-ridesharing problem and
Ridesharing problem.
Slugging Problem. High Occupancy Vehicle
(HOV) lanes are traffic lanes set aside for vehicles
with a minimum number of occupants. In order to
meet the occupancy requirements of HOV lanes,
users have developed a new way of travel, known as
slugging, that offers the benefits of traveling on an
HOV lane without forming classical ridesharing. In
slugging, the driver maintains his original route and
does not make any detour to pick-up or drop-off the
rider. Thus, the rider walks to the driver’s origin,
boards at the driver’s departure time, alights at the
driver’s destination, then walks from there to his own
destination. Authors in (Ma and Wolfson, 2013)
formalize and study this slugging problem. Variants
of the slugging problem that also consider the vehicle
capacity constraint and travel time delay, has been
proven to be the NP-complete and they propose
a quadratic algorithm to solve it optimally. They
(a)
(b)
Figure 1: Figure [a] represents the shortest path of driver
(green path) and the rider (red path) before matching, while
figure [b] represents the new path of the driver and the rider
after the matching with two new intermediate locations (in-
termediate meeting locations are pointed with two blue ar-
rows and the common path is represented with blue path).
also develop heuristics that have been evaluated on
real data. Another work on slugging problem is
considered in (Mote and Whitestone, 2011).
Taxi-ridesharing Problem. The problem of Taxi-
ridesharing consists in assigning taxi vehicles to rid-
ers requests which are spread over different locations
in a given zone. Several constraints can be considered
such as the vehicle capacity and time windows of rid-
ers. Thus, this problem concerns the assignment of a
time to each pickup and delivery event, within these
time windows.
In contrast to Slugging problem, the route of driver
trip (i.e. taxi driver) change to accommodate riders,
and the pick-up and drop-off locations for the riders
correspond to their origins and destinations, respec-
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
64
tively. Authors in (Ma et al., 2013) propose a practi-
cal taxi ridesharing service in which an organization
operates a dynamic taxi ridesharing service. In their
system, the taxi drivers can independently determine
when they join and leave the service. Thus, riders sub-
mit ride queries in real time via a mobile device, e.g.,
a smartphone. Each query indicates the origin and
destination locations of the trip, as well as the time
windows during which the rider wants to be picked up
and dropped off. Once a new query is received, the
system determines an appropriate taxi which is able
to satisfy both the new query and the trips of existing
riders who are already assigned to that taxi. The up-
dated schedules and routes will then be given to the
corresponding taxi driver and riders. Another work
on taxi-ridesharing problem is considered in (Varone
and Janilionis, 2014).
Classical Ridesharing Problem. The principle
is rather similar to Taxi-ridesharing. The main
differences are, (i) the classical ridesharing is based
on private cars in which the rider shares his trip
with a simple driver, while in taxi ridesharing the
presence of the taxi driver is obligatory, (ii) the taxi
ridesharing usually needs appropriate pricing mech-
anisms, generally more expensive than a classical
ridesharing, to incite taxi drivers. Several research
has been reported recently in the fields of ridesharing,
see (Agatz et al., 2012) and (Furuhata et al., 2013).
In ridesharing system, when a driver’s offer or rider’s
request arrives in the system, some options should
be specified. For instance, when the driver offers
a ride, he may specify if he is willing to take a
single rider or multiple riders. Similarly, when the
rider looks for a ride, he specifies if he wants to
ride with a single driver or may accept to ride with
multiple drivers and will be transferred from one
to another to reach his final destination. Thus, we
distinguish four variants, namely, single-driver and
single-rider (Geisberger et al., 2010), (Amey, 2011),
single-driver and multiple-riders (Baldacci et al.,
2004), (Herbawi and Weber, 2012), multiple-drivers
and single-rider (Drews and Luxen, 2013), and finally
multiple-drivers and multiple-riders (Herbawi and
Weber, 2012). In each variant, the matching between
riders and drivers depends on one or more objective
functions, such as the maximization of the number of
matchings, the maximization of the cost saving, the
maximization of distance saving, etc.
The ridesharing problem with intermediate lo-
cations can be seen as an extension of the slugging
problem and the classical ridesharing problem.
Firstly, the driver’s route can change to accommodate
riders compared to slugging problem. Secondly, in
contrast to the classical ridesharing problem, the
pick-up and drop-off locations are not necessarily the
origins and the destinations of rider, respectively.
The problem of ridesharing with intermediate lo-
cations is addressed in (Aissat and Oulamara, 2014b),
(Bit-Monnot et al., 2013) and (Aissat and Oulamara,
2014a). In (Aissat and Oulamara, 2014b), the authors
consider the round trip ridesharing problem with an
intermediate meeting location. The rider drives to the
intermediate meeting location using his private car
and parks it there, so in the return trip, he must be
dropped off at that location to get his car back. Thus,
for a given demand, the optimization system deter-
mines the best meeting location, the best driver in out-
going trip and the best driver in return trip passing via
the intermediate meeting location where the rider’s
car was left. Authors develop an efficient approach
where the objective is to minimize the total cost in
round trip. Their approach was validated by exper-
iments based on real data of ridesharing. The main
advantage of their approach is increasing the oppor-
tunity of matching between riders-drivers and then a
significant reduction of the total travel cost compared
to the classical approach of round trip ridesharing.
In (Bit-Monnot et al., 2013), the authors consider
the problem of ridesharing with intermediate loca-
tions, where the rider can use the public transportation
either in order to reach the meeting location from his
starting location, or to reach his ending location com-
ing from the separate location. The authors propose
an optimal method to find the pick-up and drop-off
locations in O(m·n
2
), where n is the number of nodes
and m is the number of edges in the graph, in which
the objective is to minimize the cumulated travel time
for both the driver and the rider. However, the time
complexity of this method prevents its use in real-
time ridesharing, and their model does not take into
account the detour time constraint (i.e., the total time
of the detour should be less than a given value fixed by
the driver (rider)) and detour cost constraint (i.e., the
incurred cost of the driver (rider) using ridesharing
mode is more attractive than the incurred cost when
they travel alone).
In this paper, we consider the problem of rideshar-
ing with intermediate locations. The objective func-
tion is to minimize the total travel cost in scenario in-
volving transportation modes with time-independent
arc costs, while ensuring that their detour costs and
times remain reasonable. Thus, for a given rider, we
determine the best driver, the best meeting and sepa-
rate locations that minimize the total travel cost under
constraints of time and cost detour of rider and driver.
We suggest some heuristic methods that reduce the
number of shortest paths computations, based on the
APosterioriApproachofReal-timeRidesharingProblemwithIntermediateLocations
65
exact pruning algorithm.
The remainder of the paper is structured as fol-
lows. Section 3 details the model of ridesharing with
two intermediate locations. Section 4 proposes two
solving approaches. Section 5 introduces an exact
method and an offer selection heuristic. Section 6
generalizes our approach by introducing some param-
eters. Section 7 analyses the performance of our al-
gorithms. Finally, concluding remarks and future re-
search are included in Section 8.
3 PROBLEM DESCRIPTION
A road network is represented by a weighted graph
G = (V, E), where V is the set of nodes, E the set
of edges. Nodes model intersections and edges de-
pict street segments. With each edge (i, j) E two
weights are associated. c
k
(i, j) depicts the traveling
cost and τ
k
(i, j) depicts the traveling time. A path in
a graph G is represented by a vector µ = (u, . . . , v) of
nodes in which two successive nodes are connected
by an edge of E. The cost c(µ) of path µ is given by
the sum of costs of all edges in µ. A shortest-path be-
tween a source node u and a target node v is a path
with minimal cost among all paths from u to v. In the
following, a shortest-path between node u and node v
will be represented by u v.
We consider an offer and a demand of rideshar-
ing represented by o = (s,t, [t
min
o
,t
max
o
],
o
) and d =
(s
0
,t
0
, [t
min
d
,t
max
d
],
d
), respectively, where s and s
0
(t
and t
0
) are the starting (ending) locations of the driver
and the rider, respectively, [t
min
o
,t
max
o
] ([t
min
d
,t
max
d
]) is
the departure time window of the driver (rider),
o
(
d
) is the maximal detour time that can be accepted
by the driver (rider), i.e. the extra-time that the driver
(rider) can accept additionally to the travel time cor-
responding to his shortest path.
An edge (i, j) of G has a nonnegative traveling
cost c
k
(i, j) depending on the fact that the edge is used
by a driver (k = o) or by a rider (k = d).
A basic way to implement the ridesharing (also
called classical ridesharing) is the case where the
driver picks up the rider at his starting location, drops
him off at his ending location and the driver continues
to his target location. Thus, an offer o is matched with
a demand d, if and only if there exists a shortest-path
γ
od
= s s
0
t
0
t in graph G, such that the driver’s
detour cost (c
o
(γ
od
)c
o
(s t)), remains reasonable,
i.e.,
c
o
(γ
od
) c
o
(s t) ε ·c
o
(s
0
t
0
) (1)
where ε in (1) is a detour factor (Geisberger et al.,
2010). The term ε ·c
o
(s
0
t
0
) is the reward that
rider provides to driver. Specifically, it represents the
maximal detour cost that still guarantee an incentive
to the driver to pick-up the rider at his starting
location s
0
and to drop him off at his ending location
t
0
. Clearly, if c
o
(γ
od
) c
o
(s t) > ε ·c
o
(s
0
t
0
),
the driver does not accept the demand d. Authors in
(Geisberger et al., 2010) show that the reasonable
choice of ε is at most 0.5.
However, in order to get more opportunities of
ridesharing, a rider can accept two different inter-
mediate locations, one for pick-up and another for
the drop-off. Especially, the rider travels by his
own to the first intermediate location r
1
with a cost
c
d
(s
0
r
1
), where he will be picked up by the driver
and dropped off at the second intermediate location
r
2
, then continue his journey from r
2
to t
0
on his own.
Thus, the driver and the rider will share the common
travel cost c
o
(r
1
r
2
). If the rider rewards the driver
with the amount ε ·c
o
(r
1
r
2
), then the cost of rider
is c
d
(s
0
r
1
) + ε ·c
o
(r
1
r
2
) + c
d
(r
2
t
0
).
Depending on how the value of ε is set, we dis-
tinguish two cases, (i) A priori approach in which
the user (driver and/or rider) fixe the detour factor ε,
for instance, the rider wants to share equitably the
common path cost with the driver, i.e. ε = 0.5, (ii) A
posteriori approach in which the user (driver/rider)
does not set the detour factor ε in advance, but the
system calculates the most attractive value of ε that
guarantees the best matching between the rider and
the driver.
The a priori approach is adressed in (Aissat and
Oulamara, 2014a). Given a fixed value of ε, the
authors developed efficient heuristics that determine
the best matching between the driver and the rider,
while ensuring that the detour cost of the rider and the
driver remains reasonable. Their objective function is
to minimize the total traveling cost.
In this paper, we address the a posteriori ap-
proach of a ridesharing with intermediate locations,
while considering additional constraints, namely, the
time windows, detour time and the desired minimum
cost-saving of users. More formally, we consider the
general problem of ridesharing with two intermediate
locations r
1
and r
2
in which driver picks up the rider
at the intermediate pick-up location r
1
and drops him
off at the intermediate drop-off location r
2
. The rider
travels on his own from s
0
to r
1
and from r
2
to t
0
(see
Figure 2).
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
66
s
t
r
1
r
2
s
0
t
0
Figure 2: The solid lines symbolize the path of the driver
and the rider in order to form a joint trip, whereas, the
dashed ones stand for the shortest paths of the driver and
the rider.
The objective is to minimize the total travel cost,
while ensuring the cost and time detour constraint for
the driver and the rider.
3.1 Matching Constraints
In our problem, a matching between a driver and a
rider can be established only under timing constraint
of the ride (Definition 1), and the travel cost constraint
(Definition 2).
Definition. 1. (Time Synchronization)
We say that an offer o and a demand d form a time
synchronization at location v if and only if β 0,
where
β=min
(
t
max
o
+ τ
o
(s v) (t
min
d
+ τ
d
(s
0
v)) (2a)
t
max
d
+ τ
d
(s
0
v) (t
min
o
+ τ
o
(s v)) (2b)
Equation (2a) guarantees that if the rider leaves
his origin location s at t
min
d
to reach the intermediate
pick-up location v, he must arrive no later than
the latest arrival time of the driver at v. The same
argument is applied to the driver in equation (2b).
Thus, if β 0, the propagation of the departure
time windows of the driver and the rider at the
intermediate pick-up location v will coincide. So,
they can meet each other at the earliest at this location
at time max
t
min
d
+ τ
d
(s
0
v),t
min
o
+ τ
o
(s v)
.
Definition. 2. (Reasonable Fit)
We say that an offer o = (s, t, [t
min
o
,t
max
o
],
o
) and a
demand d = (s
0
,t
0
, [t
min
d
,t
max
d
],
d
) form a reasonable
fit if and only if there exist two intermediate locations
r
1
and r
2
(r
2
6= r
1
) such that, o and d form a time
synchronization at location r
1
and
c
o
(s t) + c
d
(s
0
t
0
) (c
o
(s r
1
) +
c
d
(s
0
r
1
) + c
o
(r
1
r
2
) + c
o
(r
2
t) +
c
d
(r
2
t
0
)) 0 (3)
τ
o
(s r
1
) + τ
o
(r
1
r
2
)+
τ
o
(r
2
t) τ
o
(s t) +
o
(4)
τ
d
(s
0
r
1
) + τ
o
(r
1
r
2
)+
τ
d
(r
2
t
0
) τ
d
(s
0
t
0
) +
d
(5)
The inequality (3) represents the cost-saving of
matching the offer o with the demand d. The cost-
saving is defined as the difference between the travel
cost of the driver and the rider when each of them
travels alone without ridesharing and the total travel
cost of the driver and the rider with a shared path be-
tween r
1
and r
2
.
The term (τ
o
(s t) +
o
) in (4) (resp. τ
d
(s
0
t
0
) +
d
in (5)) allows to limit the amount of time that
the driver (resp. rider) passes in traveling. We ignore
any extra-time during pick-up or drop-off of riders.
In the following lemma, we show that if the gener-
ated cost-saving is positive, then it is always possible
to allocate the cost-saving among the driver and the
rider so that each of them has an individual benefit.
Lemma. 1. If an offer o = (s, t, [t
min
o
,t
max
o
],
o
) and a
demand d = (s
0
,t
0
, [t
min
d
,t
max
d
],
d
) form a reasonable
fit, then there exists a detour factor ε [0, 1] such that
the gains of the rider and the driver are positive.
Proof. Assume that an offer o and a demand d form
a reasonable fit. From definition (2), there exist two
intermediate locations r
1
and r
2
, such that o and d
form a time synchronization at location r
1
and
c
o
(s t) + c
d
(s
0
t
0
) (c
o
(s r
1
) +
c
d
(s
0
r
1
) + c
o
(r
1
r
2
) + c
o
(r
2
t) +
c
d
(r
2
t
0
)) 0
Assume that there exists a detour factor ε [0, 1] in
which the common trip cost of the driver and the rider
is shared according to ε, i.e., the rider rewards the
driver with amount ε ·c
o
(r
1
r
2
).
On the one hand, the driver can accept to share a ride
with the rider, only if his total cost using ridesharing
modality is less than his cost if he travels alone, i.e.,
c
o
(s r
1
) + (1 ε) ·c
o
(r
1
r
2
) + c
o
(r
2
t)
c
o
(s t) (6)
From (6) we obtain, ε ε
1
, where
ε
1
=
c
o
(s r
1
) + c
o
(r
1
r
2
) + c
o
(r
2
t) c
o
(s t)
c
o
(r
1
r
2
)
On the other hand, the rider accepts to be picked up
and dropped off by the driver in intermediate loca-
tions, only if his total cost using ridesharing modality
is less than his cost if he travels alone, i.e.,
c
d
(s
0
r
1
) + ε ·c
o
(r
1
r
2
) + c
d
(r
2
t
0
)
c
d
(s
0
t
0
) (7)
From (7) we obtain, ε ε
2
, where
ε
2
=
c
d
(s
0
t
0
) c
d
(s
0
r
1
) c
d
(r
2
t
0
)
c
o
(r
1
r
2
)
APosterioriApproachofReal-timeRidesharingProblemwithIntermediateLocations
67
Furthermore, it is easy to see that the existence of the
solution is constrained by ε
1
ε ε
2
.
In order to satisfy the constraint (3), the ε must be
in the interval [ε
1
, ε
2
]. Thus, any value of ε in the
interval [ε
1
, ε
2
] satisfies the constraints of matching
between the rider and the driver. A reasonable value
of ε might be the average value of the interval [ε
1
, ε
2
],
i.e. ε =
ε
1
+ε
2
2
.
3.2 Objective of Ridesharing System
As in (Aissat and Oulamara, 2014a), we use the term
global-path (s, s
0
, r
1
, r
2
,t, t
0
) to describe the concate-
nation of paths s r
1
, s
0
r
1
, r
1
r
2
, r
2
t
and r
2
t
0
. i.e. (s, s
0
, r
1
, r
2
,t, t
0
) = (s r
1
s
0
r
1
r
1
r
2
r
2
t r
2
t
0
). A shortest global-
path between source nodes s, s
0
and target nodes t, t
0
is a global-path with minimal cost c(s, s
0
, r
1
, r
2
,t, t
0
)
among any global-path from s, s
0
to t, t
0
, where
c(s, s
0
, r
1
, r
2
,t, t
0
) = c
o
(s r
1
) + c
d
(s
0
r
1
)
+c
o
(r
1
r
2
) + c
o
(r
2
t)
+c
d
(r
2
t
0
) (8)
Thus, the objective of the ridesharing system is to de-
termine the best intermediate locations r
1
and r
2
that
minimize the shortest global-path such that the offer
o and a demand d form a reasonable fit.
4 PROPOSED APPROACH
The proposed methods are based on computing sev-
eral shortest paths. Shortest path algorithms have
been extensively studied, since they are used in almost
all real cases of transportation problems. Efficient
algorithms are especially needed when geographical
information systems (GIS) are involved. The well-
known algorithm to find the shortest path is the Di-
jkstra algorithm (Dijkstra, 1959). In (Sanders and
Schultes, 2007), the authors note that the Dijkstra al-
gorithm can in theory be used to find the shortest path
on a road network, but for large networks it would be
far too slow. Different speed-up techniques, such as
bidirectional search, goal direction, etc., can be used
to improve performance. An overview of such tech-
niques is available in (Sanders and Schultes, 2007).
4.1 Search Space of Potential
Intermediate Locations
The matching constraints defined in section 3.1 allows
us to limit the search space of intermediate locations.
In the following, we provide characteristics of poten-
tial intermediate locations.
Definition. 3. (Potential Intermediate Nodes).
Let N
(s), N
(s
0
), N
(t) and N
(t
0
) be defined as
N
(s) = {v V | c
o
(s v) c
o
(s t)
τ
o
(s v) + τ
o
(v t) τ
o
(s t) +
o
}
N
(t) = {v V | c
o
(v t) c
o
(s t)
τ
o
(s v) + τ
o
(v t) τ
o
(s t) +
o
}
N
(s
0
) = {v V |c
d
(s
0
v) c
d
(s
0
t
0
)
τ
d
(s
0
v) +
ˆ
τ(v t
0
) τ
d
(s
0
t
0
) +
d
}
N
(t
0
) = {v V | c
d
(v t
0
) c
d
(s
0
t
0
)
ˆ
τ(s
0
v) + τ
d
(v t
0
) τ
d
(s
0
t
0
) +
d
}
N
(s) represents the set of potential pick-up loca-
tions of the driver. Indeed, if v is the pick-up location,
the best situation for the driver is to share the cost
c
o
(v t) with the rider as long as v satisfies the trav-
eling time constraint τ
o
(s v) + τ
o
(v t) τ
o
(s
t) +
o
. Thus, if a node v does not respect the cost
and the traveling time constraints, then v cannot be an
pick-up location. Set N
(t) represents the potential
drop-off locations of the driver. The same reasoning
as for the set N
(s) is applied to N
(t).
On the other hand, the sets N
(s
0
) and N
(t
0
) rep-
resent the potential pick-up and drop-off locations of
the rider, respectively.
Remark that in the traveling time constraint of set
N
(s
0
) (resp. N
(t
0
)), we use
ˆ
τ(v t
0
) (resp.
ˆ
τ(s
0
v)), i.e., the traveling time corresponding to the esti-
mated distance between two locations v and t
0
(resp. s
0
and v) using Haversine formula, instead of the short-
est traveling time τ
d
(v t
0
) (resp. τ
d
(s
0
v)).
In fact, for a given node v, if τ
d
(s
0
v)+τ
d
(v t
0
) >
τ
d
(s
0
t
0
) +
d
, we can’t deduce that v cannot be a
pick-up location. This is due to the fact that there may
be another node v
0
, where v
0
is a potential drop-off lo-
cation and t
o
(v v
0
) +t
d
(v
0
t
0
) < τ
d
(v t
0
).
The Haversine formula estimates the distance be-
tween two locations based on their latitude/longitude.
This formula uses a spherical model to estimate the
distance between two points on the earth surface.
Specifically, given two locations x = (θ
1
, λ
1
) and
y = (θ
2
, λ
2
) where θ
i
, i = 1, 2, is the latitude and λ
i
,
i = 1, 2, is the longitude. The distance between x
and y is given by
ˆ
d(x, y) = 2 ×R ×arcsin(
a) where
R 6371(km) is the earth’s radius in kilometers, and
a = sin
2
(
θ
2
θ
1
2
) + cos(θ
1
) × cos(θ
2
) × sin
2
(
λ
2
λ
1
2
).
Thus, the estimated smallest duration from x to y is
noted by
ˆ
τ(x y) =
ˆ
d(x,y)
v
max
, such that v
max
is the max-
imal speed among all used modality of the driver and
the rider.
The following lemma simultaneously character-
izes the set of potential intermediate locations for both
driver and rider.
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
68
Lemma. 2. A node v V is a potential intermediate
node if and only if v C = C
1
C
2
where C
1
= N
(s)
N
(s
0
) and C
2
= N
(t) N
(t
0
).
4.2 Solving Methods
In this section, we propose two solving methods for
our model. The first method is based on bidirectional
search, and the second method is based on one-to-all
shortest path. Both methods are based on the modifi-
cation of the graph G.
Once the potential intermediate locations class
C has been determined, we add to the graph G two
dummy nodes S
?
and T
?
. The node S
?
is connected
to each node v, v C
1
with an arc (S
?
, v) and the cost
c(S
?
, v) = c
o
(s v) + c
d
(s
0
v). The node T
?
is
connected to each node v, v C
2
with an arc (v, T
?
)
and the cost c(v, T
?
) = c
o
(v t) + c
d
(v t
0
). The
arc (S
?
, v) represents the driver and the rider moves
out from their starting locations to the pick-up node
v. The arc (v, T
?
) represents the driver and the rider
moves out from the drop-off node v to their ending
locations. In the following, we describe our methods.
Bidirectional Search Algorithm - BSA. The
BSA Algorithm works with two simultaneous
searches of the shortest path, one from the source
node S
?
and the second from the target node T
?
at
the same time, until ”the two search frontiers meet”.
More precisely, BSA Algorithm maintains two
priority queues, one for the search from the source
S
?
denoted by Q
1
, as in simple Dijkstra Algorithm,
and one for the backward search from the target
T
?
denoted by Q
2
, which is a forward search in the
reversed graph G
1
, in which each arc (u, v) of G is
replaced by (v, u) in G
1
.
In each iteration, we settle the node with the smallest
overall tentative cost, either from the source S
?
or to
the target T
?
. In order to do this, a simple comparison
of the minima of the two priority queues Q
1
and Q
2
suffices. Once we settle a node v in one queue that
is already settled in the other queue, we get the first
tentative cost of a shortest path from S
?
to T
?
. Its cost
is the cost of the path found by the forward search
from S
?
to v, plus the cost of the path found by the
backward search from v to T
?
.
Even when the two parts of the tentative solution of
the forward and the backward meet each other, the
concatenated solution path is not necessarily optimal.
To guarantee optimality, we must continue until the
tentative cost of the current minima of the queues is
above the current tentative shortest path cost (which
then corresponds to the cost of the shortest path).
Thus, at each iteration when the tentative cost of a
shortest path from S
?
to T
?
is updated, we check
the feasibility of constraints (3), (4) and (5), and
finally we keep the admissible path that minimizes
the global-path.
In the BSA Algorithm, when a node v is settled,
then for each outgoing arc (v, u) from the node v, we
check whether via this arc the node u can be reached
with a cost less than or equal to the current cost of
u. If yes, then the cost of u is updated to the new
lower cost. This procedure is called relaxing an arc.
The difference with the traditional relaxing an arc
procedure of the literature is simply on updating the
cost of the node even if the new cost is equal to the
current cost of the node. Indeed, this modification
allows us to ensure that if the shortest path from
S
?
to T
?
contains only one intermediate node i.e.,
S
?
arc
r
1
arc
T
?
, then the driver and rider will never
be able to form a reasonable fit. Specifically, the
constraint (3) will never be satisfied.
Finally, in the found shortest path S
?
T
?
(i.e.
S
?
arc
r
?
1
r
?
2
arc
T
?
), we recover the best pick-up
location r
?
1
and the best drop-off location r
?
2
that
correspond to the successor of S
?
and the predecessor
of T
?
, respectively.
Shortest Path One-to-All - SPOA. In this method,
instead of computing one shortest path from S
?
to T
?
,
we compute for each node v in C
2
the shortest path
S
?
v. This approach allows us to find all paths that
satisfy constraint (3). Once shortest paths satisfying
the constraint of cost-saving have been enumerated,
we select the global-path with minimal cost that
satisfies constraints (4) and (5).
The main advantage of the first method (BSA) lies
in the fact that its running-time is less important than
the second method (SPOA), which requires to com-
pute all shortest paths to each node in class C
2
. On
the other hand, the second method has a greater con-
trol over the constraints of time detour for the driver
and the rider. We note that the relaxing arc procedure
applied in this method is the same as that described
above.
5 THE BEST MATCHING
SELECTION
The approach developed above and in (Aissat and
Oulamara, 2014a) correspond to the case where an
offer and a demand are already fixed. However, in
ridesharing system, several demands and offers arrive
in the system. Thus, in this section, we consider the
APosterioriApproachofReal-timeRidesharingProblemwithIntermediateLocations
69
problem of the best driver selection. Especially, given
a set of offers already in the system, when a demand
request d arrives in the system, the objective is to se-
lect the offer candidate which is able to fulfill the ride
request.
Given a demand request d, we start by determin-
ing the two sets N
(s
0
) and N
(t
0
) of potential inter-
mediate pick-up and drop-off locations, respectively.
(see Definition 3).
The selection rule of the best offer requires the
storage of some informations for each offer: when
an offer o
i
is added to the system, we store all
possible intermediate locations for this offer. Thus,
we determine the costs c
o
(s
i
v) and c
o
(v t
i
).
The procedure of storage is detailed below.
Informations Storage: We denote by M
(s
i
) and
M
(t
i
) the f orward search space from a source s
i
and the backward search space from target t
i
, re-
spectively. A forward search space M
(s
i
) is a set
of triplets (v, c
s
i
, τ
s
i
), where (v, c
s
i
, τ
s
i
) means that the
shortest path from s
i
to v has a cost c
s
i
and a travel
time τ
s
i
. A backward search space M
(t
i
) is a set
of triplets (v, c
t
i
, τ
t
i
) where (v, c
t
i
, τ
t
i
) means that the
shortest path from v to t
i
has a cost c
t
i
and a travel
time τ
t
i
.
Using detour time constraint (4) of the driver, we
limit the search space. Then the triplets (node, cost,
time) are stored in M
(s
i
) and M
(t
i
) without consid-
ering any demand.
In order to determine the sets M
(t
i
) and M
(s
i
),
we use a modified A
?
algorithm (Hart et al., 1968).
Firstly, we determine the set M
(t
i
) using reverse A
?
algorithm from the destination t
i
toward the origin lo-
cation s
i
. Then, we determine the set M
(s
i
) using
A
?
algorithm from the origin s
i
toward the destina-
tion t
i
. Recall that in A
?
algorithm, the nodes are re-
trieved from the priority queue by the sum of their ten-
tative cost from the origin to the nodes and the value
of the heuristic function from the nodes to the des-
tination. Thus, for a given node v, the cost function
used in the first A
?
Algorithm to determine M
(t
i
) is
ˆ
τ(s
i
v)+τ
o
(v t
i
), whereas in the second A
?
Algo-
rithm that determines M
(s
i
), we use the cost function
τ
o
(s
i
v) + τ
o
(v t
i
).
Remark that in the second A
?
algorithm, we use
τ
o
(v t
i
) instead of the estimation duration
ˆ
τ(v t
i
),
since it is already calculated in the first A
?
algorithm.
We note that the traditional A
?
algorithm stops after
the destination has been reached. However, our A
?
algorithm used to determine M
(t
i
) (resp. M
(s
i
))
continues even when the destination s
i
(resp. t
i
) is
reached. The algorithm stops once all nodes with cost
function less than τ
o
(s
i
t
i
) +
i
are labeled.
Furthermore, we define the bucket B
o
(v) as the set
which stores all drivers’ trips which can pass via this
location without violating the constraint of time de-
tour. Then, in the second algorithm A
?
, when a node
v is labeled, we add the entries in
B
o
(v) := B
o
(v) {(i, c
s
i
, τ
s
i
, c
t
i
, τ
t
i
)}. (9)
5.1 Exact Offer Selection
Let σ
?
be the cost of the optimal global-path, ini-
tially σ
?
= +. After constructing the sets N
(s
0
)
and N
(t
0
), we scan the nodes of N
(s
0
). For each
potential intermediate location v
1
in the set N
(s
0
),
we calculate c
o
(v
1
v
2
) using the forward one-to-
all Dijkstra algorithm for all v
2
N
(t
0
). For each
offer o
i
such that (i, d
s
i
, τ
s
i
, d
t
i
, τ
t
i
) B
o
(v
1
), we scan
each node v
2
in the set N
(t
0
). Then, if i is in the set
B
o
(v
2
) such that o
i
and d form a reasonable fit with
v
1
(v
2
) as an intermediate pick-up (drop-off) location,
and the cost of the global path c(s, s
0
, v
1
, v
2
,t, t
0
) is less
than σ
?
, then we update the optimal global-path σ
?
to
c(s, s
0
, v
1
, v
2
,t, t
0
). The detail of the procedure is given
in Algorithm 1.
Algorithm 1: Exact offer selection.
Require: Demand d, sets N
(s
0
), N
(t
0
), and B
o
(v), v G.
Ensure: The best driver i
?
, global-path σ
?
.
1: Initialization, i
?
1, σ
?
+.
2: for all v
1
in N
(s
0
) do
3: Using the forward one-to-all Dijkstra Algorithm,
compute the cost c
o
(v
1
v
2
), v
2
N
(t
0
).
4: for all i in B
o
(v
1
) do
5: if i and d form a time synchronization at location
v
1
then
6: for all v
2
in N
(t
0
) do
7: if i B
o
(v
2
) and driver i and rider d form a
reasonable fit with v
1
as intermediate pick-
up location and v
2
as intermediate drop-off
location then
8: if σ
?
> c(s
i
, s
0
, v
1
, v
2
,t
i
,t
0
) then
9: i
?
i
10: σ
?
c(s
i
, s
0
, v
1
, v
2
,t
i
,t
0
)
11: end if
12: end if
13: end for
14: end if
15: end for
16: end for
Note that the runtime of Dijkstra’s Algorithm us-
ing Fibonacci Heaps is bounded by O(|V |log |V |+
|E|). So, the two sets N
(s
0
), N
(t
0
) can be computed
in O(2 ·(|V |log |V |+ |E|)). Furthermore, Algorithm
1 runs in O(|N
(s
0
)|(|V |log|V | + |E|) + |N
(t
0
)| ·
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
70
v
1
N
(s
0
)
|B
o
(v
1
)|)-time. Hence, the worst-case com-
plexity of the Exact offer selection is O((|N
(s
0
)|+
2)(|V |log|V | + |E|) + |N
(t
0
)| ·
v
1
N
(s
0
)
|B
o
(v
1
)|)-
time.
5.2 Offer Selection Heuristic
Even if the exact offer selection method provides a so-
lution in polynomial time, the computation time can
be too long for large instances with real road net-
work. In particular, when the proposed method is
used in real time ridesharing system, in which a so-
lution should be provided in a few seconds. In this
section, we propose an heuristic method with a lower
time complexity, that allows us to select the best offer
that will be matched with the demand d.
Algorithm 2: Scan the set N
(s
0
).
Require:Demand d, set N
(s
0
), set N
(t
0
) and B
o
(v),v G.
Ensure: The best driver i
?
, global-path σ
?
.
1: Initialization, i
?
1, σ
?
.
2: Using backward one-to-all Dijkstra Algorithm, com-
pute the cost c
o
(v
1
t
0
), v
1
N
(s
0
).
3: for all v
1
in N
(s
0
) do
4: for all i in B
o
(v
1
) do
5: if i and d form a time synchronization at location
v
1
then
6: if i B
o
(t
0
) and τ
d
(s
0
v
1
) + τ
o
(v
1
t
0
)
(τ
d
(s
0
t
0
) +
d
) and τ
o
(s
i
v
1
) + τ
o
(v
1
t
0
) + τ
o
(t
0
t
i
) (τ
o
(s
i
t
i
) +
o
i
) and
c
o
(s
i
t
i
)+ c
d
(s
0
t
0
)c(s
i
, s
0
, v
1
,t
0
,t
i
,t
0
)
0 then
7: if σ
?
> c(s
i
, s
0
, v
1
,t
0
,t
i
,t
0
) then
8: i
?
i
9: σ
?
c(s
i
, s
0
, v
1
,t
0
,t
i
,t
0
)
10: end if
11: end if
12: if τ
d
(s
0
v
1
) + τ
o
(v
1
t
i
) + τ
d
(t
i
t
0
)
(τ
d
(s
0
t
0
) +
d
) and τ
o
(s
i
v
1
) + τ
o
(v
1
t
i
) (τ
o
(s
i
t
i
) +
o
i
) and c
o
(s
i
t
i
) +
c
d
(s
0
t
0
) c(s
i
, s
0
, v
1
,t
i
,t
i
,t
0
) 0 then
13: if σ
?
> c(s
i
, s
0
, v
1
,t
i
,t
i
,t
0
) then
14: i
?
i
15: σ
?
c(s
i
, s
0
, v
1
,t
i
,t
i
,t
0
)
16: end if
17: end if
18: end if
19: end for
20: end for
The offer selection heuristic is provided by Algo-
rithm 4 composed of Algorithms 2 and 3.
Algorithm 2 allows us to determine an offer that min-
imizes the global-path, by considering the nodes of
the set N
(s
0
) as potential pick-up locations, while the
drop-off location is fixed at the rider (and driver) des-
tination. Steps 6 and 12 of Algorithm 2 check the ad-
Algorithm 3: Scan the set N
(t
0
).
Require:Demand d, set N
(s
0
), set N
(t
0
) and B
o
(v),v G.
Ensure: The best driver i
?
, global-path σ
?
.
1: Initialization, i
?
1, σ
?
.
2: Using forward one-to-all Dijkstra algorithm, compute
the cost c
o
(s
0
v
2
), v
2
N
(t
0
).
3: for all v
2
in N
(t
0
) do
4: for all i in B
o
(v
2
) do
5: if i and d form a time synchronization at location
s
0
then
6: if i B
o
(s
0
) and τ
o
(s
0
v
2
) + τ
d
(v
2
t
0
)
(τ
d
(s
0
t
0
) +
d
) and τ
o
(s
i
s
0
) + τ
o
(s
0
v
2
) + τ
o
(v
2
t
i
) (τ
o
(s
i
t
i
) +
o
i
) and
c
o
(s
i
t
i
) + c
d
(s
0
t
0
) c(s
i
, s
0
, s
0
, v
2
,t
i
,t)
0 then
7: if σ
?
> c(s
i
, s
0
, s
0
, v
2
,t
i
,t
0
) then
8: i
?
i
9: σ
?
c(s
i
, s
0
, s
0
, v
2
,t
i
,t
0
)
10: end if
11: end if
12: end if
13: if i and d form a time synchronization at location
s
i
then
14: if τ
d
(s
0
s
i
) + τ
o
(s
i
v
2
) + (τ
d
(v
2
t
0
)
(τ
d
(s
0
t
0
) +
d
) and τ
o
(s
i
v
2
) + τ
o
(v
2
t
i
) (τ
o
(s
i
t
i
) +
o
i
) and c
o
(s
i
t
i
) +
c
d
(s
0
t
0
) c(s
i
, s
0
, s
i
, v
2
,t
i
,t
0
) 0 then
15: if σ
?
> c(s
i
, s
0
, s
i
, v
2
,t
i
,t
0
) then
16: i
?
i
17: σ
?
c(s
i
, s
0
, s
i
, v
2
,t
i
,t
0
)
18: end if
19: end if
20: end if
21: end for
22: end for
missibility of the found path based on the maximum
detour time allowed by the driver and the rider, as well
as the generated cost-saving.
On the other hand, Algorithm 3 determines the best
offer that minimizes the global-path, by considering
the nodes of the set N
(t
0
) as potential intermediate
drop-off locations, while the pick-up location of the
ride is fixed to the origin location of the driver (and
rider). Finally, the best offer i
is given by the best
result of Algorithms 2 and 3. In order to improve the
cost of the global-path of matching (i
, d), we use the
method described in section 4.2 to find the best in-
termediate locations. The detail of the procedure is
given in Algorithm 4.
Algorithm 2 and Algorithm 3 run in respectively,
O(|V |log|V | + |E| +
v
1
N
(s
0
)
|B
o
(v
1
)|)-time and
O(|V |log|V | + |E| +
v
2
N
(t
0
)
|B
o
(v
2
)|)-time, re-
spectively. Then, having the sets N
(s
0
), N
(t
0
) and
the best offer i
?
, the step 4 in the Algorithm 4 can be
APosterioriApproachofReal-timeRidesharingProblemwithIntermediateLocations
71
Algorithm 4: Offer selection heuristic.
Require:Demand d, set N
(s
0
), set N
(t
0
) and B
o
(v),v G.
Ensure: The best driver i
?
, global-path σ
?
.
1: Find the best driver i
?
1
in N
(s
0
) using Algorithm 2.
2: Find the best driver i
?
2
in N
(t
0
) using Algorithm 3.
3: Select between the two drivers i
?
1
and i
?
2
the driver i
?
with shortest global-path σ
?
= min(σ
?
1
, σ
?
2
).
4: Find the best intermediate locations r
1
and r
2
between
driver i
?
and demand d using method described in sec-
tion 4.2.
done in O((|V |log|V| + |E|) + |N
(s
0
)| + |N
(t
0
)|)-
time. Finally, the offer selection heuristic
method allows us to reduce the complexity to
O(5 · (|V |log |V | + |E|) + |N
(s
0
)| + |N
(t
0
)| +
v
1
N
(s
0
)
|B
o
(v
1
)|+
v
2
N
(t
0
)
|B
o
(v
2
)|).
6 REWARD CONSIDERATION
In our a posteriori approach, the user (driver and/or
rider) does not set the detour factor ε in advance,
and the system calculates the most attractive value
of ε that guarantee the best matching between the
rider and the driver. However in some cases, ei-
ther the driver or the rider may ask for a minimum
rate of the saved cost in his trip. For instance, the
driver requires at least 10% of the saved cost rela-
tive to his initial travel cost. In that case, we ex-
tend model to take into account that requirement.
More precisely, an offer and a demand of ridesharing
will be represented by o = (s,t, [t
min
o
,t
max
o
],
o
, σ
o
) and
d = (s
0
,t
0
, [t
min
d
,t
max
d
],
d
, σ
d
), respectively, where σ
o
(σ
d
) is the minimum percentage of cost-saving fixed
by the driver (rider) relative to his shortest path. Con-
straint 3 of the definition 2 is modified as follow.
c
o
(s t) + c
d
(s
0
t
0
) (c
o
(s r
1
) +
c
d
(s
0
r
1
) + c
o
(r
1
r
2
) + c
o
(r
2
t) +
c
d
(r
2
t
0
)) σ
o
·c
o
(s t) + σ
d
·c
d
(s
0
t
0
) (10)
The values of ε
1
and ε
2
of lemma 2 are modified in
order to consider a constraint (10).
7 COMPUTATIONAL RESULTS
In this section, we provide experimental results us-
ing the proposed methods, i.e, the two heuristics BSA
and SPOA, the exact method (EM) and the classical
ridesharing (CR).
Environment. The proposed methods were imple-
mented in C# Visual Studio 2010. The experiments
were done on an Intel Xeon E5620 2.4 Ghz processor,
with 8 GB RAM memory.
Offers-demands Data. In our experiments, we
use real data provided by Covivo company
1
. These
data concern employees of Lorraine region trav-
eling between their homes and their work places.
The real data instance is composed of 1513 partici-
pants. Among them, 756 are willing to participate in
ridesharing service only as drivers. The rest of par-
ticipants (i.e, 757) are willing to use other modes in
order to reach the intermediate pick-up location from
their origins, as well as from the intermediate drop-off
location to their destinations. However, given the lack
of available data of others transportation modes in the
French region Lorraine, we assume that the driver and
the rider have the same cost (i.e, each rider owns a
private car that he might use during a part of his trip,
either in order to reach the intermediate pick-up loca-
tion coming from his origin, or/and reaching his des-
tination coming from the intermediate drop-off loca-
tion). Thus, the data instance is composed of 756 of-
fers and 757 demands. The smallest and the greatest
trip’s distances are 2 km and 130 km, respectively.
The set of offers and demands are filtered such
that we can never find a driver’s offer and a rider’s
demand which have either the same starting or ending
locations. This way will allow us to test the flexibility
of our approach compared to the classical ridesharing
approach. The time window for each trip is fixed as
follows. The early departure time and the latest de-
parture time are fixed at 7:30 a.m. and at 8:00 a.m,
respectively. The time detour of the driver (rider) is
fixed to at most 20% of his initial trip duration.
Road Network. Several geographical maps are
available for geolocalised applications. The most fa-
mous ones are Google Maps, Bing Maps, Nokia Maps
and OpenStreetMap
2
(OSM). Our road network of the
French region Lorraine was derived from the publicly
available data of OpenStreetMap (OSM) and was pro-
vided by GeoFabrik
3
. It consists of 797830 nodes
and 2 394 002 directed edges. Each node in the road
network can be an intermediate pick-up (resp. drop-
off) location in which the driver and the rider can meet
(resp. separate). OSM is used in several projects and
it facilitates the map integration or exploitation. For
instance, OsmSharp is an open-source mapping tool
designed to work with OpenStreetMap-data. In our
experiments, we use OsmSharp’s routing and OSM
data processing library to test our shortest path com-
putation on real data set.
1
http://www.covivo.fr
2
http://www.openstreetmap.org
3
http://www.geofabrik.de/
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
72
Figure 3: Map visualization of offers of ridesharing. Red
and blue points are the geocoded home and work locations,
respectively.
Computational Results. Two computational ex-
periments were conducted. In the first experiment,
a demand and an offer of ridesharing were fixed, and
we evaluate the performance of four methods (BSA,
SPOA, EM and CR) in terms of cost-saving, number
of matchings and running-time (see Table 1). In this
first experiment, two scenarios were tested. In the first
scenario, the driver’s detour time was limited to 20%,
and in the second scenario, the time detour is limited
to 10%. In each scenario, several instances were gen-
erated as follow: we scan all demands and for each
demand we randomly select 10 offers, then 7570 in-
stances (757 (demands) × 10 (offers)) were tested.
For each method, the following results are reported:
Gap: the deviation of algorithms with respect to the
optimal solution, Time: the required CPU time in sec-
onds, Match(M ): the percentage of number matching
found. In Columns Gap and Time, the average values
on the 7570 instances are reported. In the row (|C |),
the average number of nodes contained in potential in-
termediate locations (class C ) over the 7570 instances
is reported.
As we can see, the proposed heuristics (BSA and
SPOA) detect all matchings and provide exact re-
sults for all instances when the detour time is less
than 20%. Whereas, when the detour time is less
than 10%, the Match(M ) of BSA method decreases
to 94% and SPOA method decreases to 97%. On the
other hand, the CR approach detects at most 55.7%
when the detour time is less than 20% and decreases
Table 1: Performance of our algorithm with fixed offer.
Detour time 0.2 Detour time 0.1
Gap M Time Gap M Time
(%) (%) (s) (%) (%) (s)
EM - - 844 - - 620
BSA 0 100 1.78 0.4 94 1.22
SPOA 0 100 2.10 0.2 97 1.58
CR 27 55.7 0.92 34 15 0.83
|C | 450 742
more sharply to 15% with detour time less than 10%.
The Gap of CR can be considered as the additional
cost-saving generated by using methods with interme-
diate locations. The running time in BSA method is
less than in SPOA method, this is due to the one-to-all
Dijkstra algorithm used in SPOA compared to BSA.
In the second experiment, we evaluate the heuris-
tic selection of offers. This allows us to know in prac-
tice, if the selected offer found using one intermediate
location (either pick-up or drop-off location) is gen-
erally the same selected offer found using two inter-
mediate locations (see Table 2). The column “Time”
represents the running-time of the whole algorithm,
whereas the row “Same offer (SA)” represents the
success rate in which the selected offer in the step 3
(Algorithm 4) is the same offer selected by the exact
method (EM).
Table 2: Performance of the whole process.
Detour time 0.2 Detour time 0.1
Gap SA Time Gap SA Time
(%) (%) (s) (%) (%) (s)
EM - - 9409 - - 7803
BSA 0.7 91 3.79 2.1 83 2.64
SPOA 0.3 91 5.22 1.4 83 3.87
vC
|B(v)| 113836 84742
From Table 2, we can see that 83% (resp. 91%
when detour time 0.2) of selected offers found us-
ing one intermediate location are the same with se-
lected offers found using the two intermediate loca-
tions. Furthermore, when detour time 0.2, in BSA
(resp. SPOA) method, the solution is found in about
3 seconds (resp. 5 seconds) compared to 9409 sec-
onds for the exact method (EM). The Gap between
the two heuristics does not exceed 2.1% in both cases
of detour time values.
8 CONCLUSION
In this paper, we considered the problem of rideshar-
ing with intermediate locations. We proposed solu-
tion methods that allow us to determine the interme-
APosterioriApproachofReal-timeRidesharingProblemwithIntermediateLocations
73
diate pick-up and drop-off locations that minimize the
total travel cost of rider and driver. The particular in-
terest of our work is in making the service of rideshar-
ing more flexible and efficient. Our approach is sim-
ple to use and allows to reduce the driver’s detour by
using intermediate locations, and to increase the sav-
ings for both drivers and riders compared to the clas-
sical ridesharing.
REFERENCES
Agatz, N., Erera, A., Savelsbergh, M., and Wang, X. (2012).
Optimization for dynamic ride-sharing: A review. Eu-
ropean Journal of Operational Research, 223:295–
303.
Aissat, K. and Oulamara, A. (2014a). Dynamic ridesharing
with intermediate locations. In proceedings of SSCI
2014.
Aissat, K. and Oulamara, A. (2014b). Round trip rideshar-
ing with an intermediate meeting location. In proceed-
ings of MOSIM 2014.
Amey, A. (2011). Proposed methodology for estimating
rideshare viability within an organization: Applica-
tion to the mit community. In Transportation Research
Board Annual Meeting, pages pp. 11–25.
Baldacci, R., Maniezzo, V., and Mingozzi, A. (2004). An
exact method for the car pooling problem based on
lagrangean column generation. Operations Research,
52:422–439.
Bit-Monnot, A., Artigues, C., Huguet, M.-J., and Killi-
jian, M.-O. (2013). Carpooling: the 2 synchronization
points shortest paths problem. In OASIcs-OpenAccess
Series in Informatics, volume 33. Schloss Dagstuhl-
Leibniz-Zentrum fuer Informatik.
Dijkstra, E. (1959). A note on two problems in connexion
with graphs. Numerische Mathematik, 1:269–271.
Drews, F. and Luxen, D. (2013). Multi-hop ride sharing. In
Proceedings of the Sixth Annual Symposium on Com-
binatorial Search, pages 71–79,.
Furuhata, M., Dessouky, M., Brunet, F. O. M., Wang, X.,
and Koenig, S. (2013). Ridesharing: The state-of-
the-art and future directions. Transportation Research
Part B: Methodological, 57:28–46.
Geisberger, R., Luxen, D., Neubauer, S., Sanders, P., and
Volker, L. (2010). Fast detour computation for ride
sharing. In 10th Workshop on Algorithmic Approaches
for Transportation Modelling, Optimization, and Sys-
tems - ATMOS’10, pages pp. 88–99. Th. Erlebach, M.
Lubbecke.
Hart, P., Nilsson, N., and Raphael, B. (1968). A formal
basis for the heuristic determination of minimum cost
paths. IEEE Trans. on Sys. Sci. and Cyb, 4:100–107.
Hartwig, S. and Buchmann, M. (2006). Empty seats trav-
eling: next-generation ridesharing and its potential to
mitigate traffic-and emission problems in the 21st cen-
tury. NOKIA Research Center.
Herbawi, W. and Weber, M. (2012). The ridematching
problem with time windows in dynamic ridesharing:
a model and a genetic algorithm. In Proceedings
ACM Genetic and Evolutionary Computation Confer-
ence (GECCO), pages 1–8.
Ma, S. and Wolfson, O. (2013). Analysis and evaluation
of the slugging form of ridesharing. In Proceedings
of the 21st ACM SIGSPATIAL International Confer-
ence on Advances in Geographic Information Sys-
tems, pages 64–73. ACM.
Ma, S., Zheng, Y., and Wolfson, O. (2013). T-share: A
large-scale dynamic taxi ridesharing service. In Data
Engineering (ICDE), 2013 IEEE 29th International
Conference on, pages 410–421. IEEE.
Metz, B., Davidson, O., De Coninck, H., Loos, M., and
Meyer, L. (2005). Ipcc special report on carbon
dioxide capture and storage. prepared by working
group iii of the intergovernmental panel on climate
change. IPCC, Cambridge University Press: Cam-
bridge, United Kingdom and New York, USA, 4.
Mote, J. E. and Whitestone, Y. (2011). The social context
of informal commuting: Slugs, strangers and struc-
turation. Transportation Research Part A: Policy and
Practice, 45(4):258–268.
Sanders, P. and Schultes, D. (2007). Engineering fast route
planning algorithms. In Experimental Algorithms,
pages 23–36. Springer.
Sassi, O. and Oulamara, A. (2014). Joint scheduling and op-
timal charging of electric vehicles problem. In Com-
putational Science and Its Applications–ICCSA 2014,
pages 76–91. Springer.
Varone, S. and Janilionis, V. (2014). Insertion heuristic
for a dynamic dial-a-ride problem using geographical
maps. In proceedings of MOSIM 2014.
ICORES2015-InternationalConferenceonOperationsResearchandEnterpriseSystems
74