CAB–SHARING: AN EFFECTIVE,
DOOR–TO–DOOR, ON–DEMAND
TRANSPORTATION SERVICE
Győző Gidófalvi
Geomatic ApS
Center for Geoinformatik
Torben Bach Pedersen
Aalborg University
Motivation
Transportation is a problem in major cities
Pros and cons of existing transportation options:
By car
comfortable, door-to-door, fast, parking problem, stressful, not
too cheap
By public transportation
cheap, no parking, less stress, longer travel times, less
comfort, pre-adjusted schedules
By taxi / cab:
comfortable, door-to-door, fast, no parking, expensive for daily
use
19/6/2007
ITS 2007, Aalborg, Denmark
2
Idea
Share a cab to reduce the cost but keep the pros
Not a new idea: airport shuttles
Existing collective, personalized approaches:
are offered only for a limited # of origins and/or destinations
require manual grouping / scheduling of fares
requests need to be made well in advance
Proposed cab-sharing approach:
is offered for any origin-destination combination
automatically groups / schedules fares
serves requests on demand with fast response times
19/6/2007
ITS 2007, Aalborg, Denmark
3
Cab-Sharing Service
Txt. Msg.
To: 1234
From addr.
To addr.
SMS: fare info
[cost, schedule]
Cab-Sharing
Service
Cab-share info
cabid, schedule
…
…
…
SMS: cab request Premium
[From/To addr.]
Geocoding
[From/To coord.] Service
[From/To coord., uid]
Cab-share info:
[uids, cost shares]
Cab-sharing
Engine
Funds ok?
[uid, cost]
Cab-scheduling /
Cab-routing
Engine
User Accounts DB
19/6/2007
ITS 2007, Aalborg, Denmark
4
The Cab-sharing Problem
Given
a set of requests R,
a maximum cab-share size K, and
a minimum saving required to form a cab-share min_saving,
find a pair-wise disjoint partitioning of R (cab-shares),
such that
the number of requests in each cab-share is at most K,
and the total transportation cost of serving the requests is
minimized, or equivalently the savings is maximized.
The number of possible cab-shares scales factorially
with the number of requests.
Instead of enumerating all possibilities and selecting
the optimum, the proposed method uses a number of
heuristics to derive an near-optimal solution.
19/6/2007
ITS 2007, Aalborg, Denmark
5
A Lazy, Greedy Cab-sharing Algorithm
1. Wait with mandatory scheduling of requests until
expiration time (more prob for a good cab-share)
FEC(r1,r2) = (d2’ + d2’’) / d1
FEC(r1,r3) = (d3’ + d3’’) / d1
2. Calculate pair-wise fractional extra cost (FEC )
between every pair of expiring and valid request
AC({r1,r2,r3})=
(1+FEC(r1,r2)+FEC(r1,r3)) / 3
3. The best k-sized cab-share for an expiring request
ri is composed of the first k requests with lowest
FEC for ri.
r2_dest
4. Estimate the amortized cost (AC) of a cab-share
as the normalized cumulative sum of FECs
d3’’
5. Greedily schedule the “best”, maximum K-sized
cab-share with minimum AC over all expiring
requests
6. Remove scheduled requests from further
consideration
19/6/2007
ITS 2007, Aalborg, Denmark
r3_dest
d1
r3_orig
7. Repeat 2-7 while min_saving requirement met
8. Remaining requests as single “cab-shares”
d2’’
r1_dest
r2_orig
d3’
d2’
r1_orig
6
Running Example
1883
4581
2219
10014
2000
2219
2000
4581
10014
1883
5 sample requests
in the form of origin
and destination pairs
out of which two are
expiring (10014, 2219)
19/6/2007
ITS 2007, Aalborg, Denmark
7
A Simple SQL Implementation in 4 Steps
19/6/2007
ITS 2007, Aalborg, Denmark
8
Preliminaries
Store requests in an RDBMS as:R_q = <rid,tr,te,xo,yo,xd,yd>
Define a 2D distance function between two locations: d(x1,y1,x2,y2)
Define the FEC between origin and destination coordinates of two cab
requests as:
CREATE FUNCTION e(rixo FLOAT, riyo FLOAT, rixd FLOAT, riyd FLOAT,
rjxo FLOAT, rjyo FLOAT, rjxd FLOAT, rjyd FLOAT)
RETURNS FLOAT
(rjxd,rjyd)
BEGIN
(rixd,riyd)
DECLARE ri_dist, ed FLOAT
SET ri_dist = d(rixo, riyo, rixd, riyd)
SET ed = d(rjxo, rjyo, rixo, riyo) + d(rjxd, rjyd, rixd, riyd)
RETURN (ed / ri_dist)
END
(rjxo,rjyo)
19/6/2007
ITS 2007, Aalborg, Denmark
(rixo,riyo)
9
STEP 1: Calculating Fractional Extra Costs
Select the expiring cab requests from R_q based on te and the
current time into a table R_x
Create table E = <ri,rj,e> to store the pair-wise FEC
Calculate the pair-wise FEC between cab requests in R_x and R_q as:
INSERT INTO E (ri, rj, e)
SELECT x.rid ri, q.rid rj,
e(x.xo,x.yo,x.xd,x.yd,q.xo,q.yo,q.xd,q.yd)
FROM R_x x, R_q q
WHERE x.rid <> q.rid
AND e(x.xo,x.yo,x.xd,x.yd,q.xo,q.yo,q.xd,q.yd) <= 1
Pruning heuristic: avoid storing useless cab-share candidates.
19/6/2007
ITS 2007, Aalborg, Denmark
10
Create table AE = <ri,rj,ae,k> to store the AC of the
best k-sized cab-share for each request ri in R_x
Calculate the amortized costs using a self-join as:
INSERT INTO AE (ri, rj, ae, k)
SELECT a.ri, a.rj,
(SUM(b.e)+1)/(COUNT(*)+1) ae,
COUNT(*)+1 k
FROM E a, E b
WHERE a.ri = b.ri AND a.e >= b.e
GROUP BY a.ri, a.rj
HAVING COUNT(*)+1 <= max_k
ri
rj
ae k
2219 1883 0.7804 4
2219 2000 0.7181 2
2219 10014 0.7341 3
10014 1883 0.7291 2
10014 2000 0.6841 4
10014 4581 0.6628 3
19/6/2007
aggregation
max_k = 4
ITS 2007, Aalborg, Denmark
self-join
STEP 2: Calculating Amortized Costs
a_ri
a_rj
a_e
10014 1883 0.4582
10014 4581 0.5302
10014 4581 0.5302
10014 2000 0.7482
10014 2000 0.7482
10014 2000 0.7482
10014 2219 0.7627
10014 2219 0.7627
10014 2219 0.7627
10014 2219 0.7627
2219 2000 0.4363
2219 10014 0.7660
2219 10014 0.7660
2219 1883 0.9194
2219 1883 0.9194
2219 1883 0.9194
2219 4581 0.9677
2219 4581 0.9677
2219 4581 0.9677
2219 4581 0.9677
ri
rj
e
2219 2000 0.4363
2219 10014 0.7660
2219 1883 0.9194
2219 4581 0.9677
10014 1883 0.4582
10014 4581 0.5302
10014 2000 0.7482
10014 2219 0.7627
b_ri b_rj
b_e
10014 1883 0.4582
10014 1883 0.4582
10014 4581 0.5302
10014 1883 0.4582
10014 4581 0.5302
10014 2000 0.7482
10014 1883 0.4582
10014 4581 0.5302
10014 2000 0.7482
10014 2219 0.7627
2219 2000 0.4363
2219 2000 0.4363
2219 10014 0.7660
2219 2000 0.4363
2219 10014 0.7660
2219 1883 0.9194
2219 2000 0.4363
2219 10014 0.7660
2219 1883 0.9194
2219 4581 0.9677
11
STEP 3: Selection the Best Cab-Share
Create table CS = <sid,rid> to store the cab-shares
Select the best cab-share from AE and, conditionally on the savings,
store it in CS as:
SELECT ri, (1-ae), k INTO b_rid, b_savings, b_k
FROM AE ORDER BY ae LIMIT 1
INSERT INTO CS (sid, rid)
SELECT s sid, b_rid rid FROM AE
UNION
SELECT s sid, rj rid FROM AE WHERE k <= b_k AND ri = b_rid
ri
rj
ae k
2219 1883 0.7804 4
2219 2000 0.7181 2
2219 10014 0.7341 3
10014 1883 0.7291 2
10014 2000 0.6841 4
10014 4581 0.6628 3
The best cab-share is {10014,1883,4581} with savings = 1-.6628 (=33.7%)
19/6/2007
ITS 2007, Aalborg, Denmark
12
STEP 4: Pruning the Search Space
Discard requests of the best cab-share from further consideration by
deleting related records from table E as:
DELETE FROM E
WHERE ri IN (SELECT rid FROM CS WHERE sid = s)
OR rj IN (SELECT rid FROM CS WHERE sid = s)
ri
rj
e
2219 2000 0.4363
2219 10014 0.7660
2219 1883 0.9194
2219 4581 0.9677
10014 1883 0.4582
10014 4581 0.5302
10014 2000 0.7482
10014 2219 0.7627
19/6/2007
ITS 2007, Aalborg, Denmark
13
The Best Cab-share
19/6/2007
ITS 2007, Aalborg, Denmark
14
Periodic, Iterative Scheduling of Cab Requests
Find all cab-shares by iteratively executing STEPs 2-4, until either E is
empty or the best cab-share does not meet the min_saving
requirement
Assign remaining requests in R_x to their own “cab-shares”
Place STEPs in a stored procedure in the RDBMS, and periodically
(every minute), automatically execute as a scheduled task (cron in
Linux or Task Scheduler in Windows)
19/6/2007
ITS 2007, Aalborg, Denmark
15
Experimental Setup
Simulated movements of approx. 600,000 individuals in
Copenhagen, DK during the course of a day based on a
realistic Spatio-Temporal ACTivity Simulator (ST-ACTS)
Pool of 251,000 potential cab-requests with a minimum
length of 3 and average length of 4.95 kilometers
Experiments for:
Maximum cab-share sizes K = [2,8] (default 4)
Maximum wait times Δt = [1,20] min (default 15 min)
Minimum savings min_saving = 0.3
Cab request densities ρ = [500,30000] requests / day
Measuring:
Average savings
Service availability
Resource (cab space) utilization
Service delay
19/6/2007
ITS 2007, Aalborg, Denmark
16
Experimental Results
For 30,000 requests, Δt = 15min and K = 4, the cost of
97.5% of the cab fares can be reduced by two thirds
(66%) on average.
Savings come at the expense of some service delay
Avg. grouping time = 11.7 min
Avg. pickup time = 10.7% length increase or 0.8 min
Avg. additional travel time = 7.9% length increase or 0.6 min
Average total service delay = 12.1 +/- 7.9 min
19/6/2007
ITS 2007, Aalborg, Denmark
17
Conclusions and Future Work
Presented a Cab-Sharing System (CSS)
Formalized the cab-sharing problem
Gave a greedy cab-sharing algorithm along with a
simple but effective SQL implementation:
Web demo: http://www.cs.aau.dk/~gyg/CSS/
Extensive experiments show that CSS is a cost- and
resource-effective, door-to-door, on-demand,
transportation service
Future work will consider:
A parallel, high performance, stream-based implementation
Different optimization criteria and sharing models
Optimization of the Cab–Scheduling / Routing Engine based on
spatio-temporal cab request demand prediction
19/6/2007
ITS 2007, Aalborg, Denmark
18
Thank you for your attention!
Question?
19/6/2007
ITS 2007, Aalborg, Denmark
19
Problem Complexity
Given n cab requests, the number of exactly K-sized
disjoint partitionings are:
In case of n=100 and K=4, this number has 155 digits.
The complexity becomes even worse when
1. there are m>n valid requests to select the cab-shares from
2. smaller than K-sized cab-shares are also allowed
Testing all these possible solutions to find the optimum is
computationally unfeasible.
Instead, the presented method uses a number of heuristics
to derive an approximate answer.
19/6/2007
ITS 2007, Aalborg, Denmark
20
Algorithmic Complexity
n - # of expiring cab requests
m - # of valid cab requests
K – maximum cab-share size
K << n < m
e – cost of calculating the fractional extra cost between two requests
Cost of pair-wise fractional extra costs: O(n*m)
Cost of amortized costs: O(n*m2) (or O(n*m) with iteration)
Cost of selecting best cab-share: O(log(n*K)) (or O(n*K) w/o index)
Cost of grouping the n expiring requests in maximum K-sized groups:
O(n*m) + ceil(n/K) * [ O(n*m) + O(log(n*K)) ] = ceil(n/K) * O(n*m)
19/6/2007
ITS 2007, Aalborg, Denmark
21
© Copyright 2026 Paperzz