210 likes | 330 Views
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:
E N D
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 ITS 2007, Aalborg, Denmark
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 ITS 2007, Aalborg, Denmark
SMS: cab request [From/To addr.] [From/To coord.] SMS: fare info [cost, schedule] Txt. Msg. To: 1234 From addr. To addr. [From/To coord., uid] cabid, schedule Cab-share info … Cab-share info: [uids, cost shares] … Cab-sharing Engine … [uid, cost] Funds ok? Cab-scheduling / Cab-routing Engine Cab-Sharing Service Premium Cab-Sharing Service Geocoding Service User Accounts DB ITS 2007, Aalborg, Denmark
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. ITS 2007, Aalborg, Denmark
r2_dest d2’’ r1_dest r3_dest d3’’ d1 r3_orig d3’ r2_orig d2’ r1_orig A Lazy, Greedy Cab-sharing Algorithm • Wait with mandatory scheduling of requests until expiration time (more prob for a good cab-share) • Calculate pair-wise fractional extra cost (FEC ) between every pair of expiring and valid request • The best k-sized cab-share for an expiring request ri is composed of the first k requests with lowest FEC for ri. • Estimate the amortized cost (AC) of a cab-share as the normalized cumulative sum of FECs • Greedily schedule the “best”, maximum K-sized cab-share with minimum AC over all expiring requests • Remove scheduled requests from further consideration • Repeat 2-7 whilemin_saving requirement met • Remaining requests as single “cab-shares” FEC(r1,r2) = (d2’ + d2’’) / d1 FEC(r1,r3) = (d3’ + d3’’) / d1 AC({r1,r2,r3})= (1+FEC(r1,r2)+FEC(r1,r3)) / 3 ITS 2007, Aalborg, Denmark
Running Example 1883 10014 4581 2219 2000 2219 2000 1883 4581 10014 5 sample requests in the form of origin and destination pairs out of which two are expiring (10014, 2219) ITS 2007, Aalborg, Denmark
A Simple SQL Implementation in 4 Steps ITS 2007, Aalborg, Denmark
(rjxd,rjyd) (rixd,riyd) (rjxo,rjyo) (rixo,riyo) 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 • BEGIN • 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 ITS 2007, Aalborg, Denmark
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. ITS 2007, Aalborg, Denmark
self-join aggregation max_k = 4 STEP 2: Calculating Amortized Costs • 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 ITS 2007, Aalborg, Denmark
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 The best cab-share is {10014,1883,4581} with savings = 1-.6628 (=33.7%) ITS 2007, Aalborg, Denmark
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) ITS 2007, Aalborg, Denmark
The Best Cab-share ITS 2007, Aalborg, Denmark
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) ITS 2007, Aalborg, Denmark
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 ITS 2007, Aalborg, Denmark
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 ITS 2007, Aalborg, Denmark
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 ITS 2007, Aalborg, Denmark
Thank you for your attention!Question? ITS 2007, Aalborg, Denmark
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 • there are m>n valid requests to select the cab-shares from • 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. ITS 2007, Aalborg, Denmark
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) ITS 2007, Aalborg, Denmark