Large scale taxi routing in Julia

Online Routing Optimization
at a Very Large Scale
PATRICK JAILLET
EECS/LIDS/ORC
Joint work with Dimitris Bertsimas, Sloan ORC, and Sébastien Martin, ORC
Massachusetts Institute of Technology
Online Taxi Routing, Bertsimas, Jaillet, Martin
1
The taxi routing problem
Taxi 1
Customer 1
Customer 2
Taxi 2
Online Taxi Routing, Bertsimas, Jaillet, Martin
2
The taxi routing problem
Taxi Routing, Bertsimas, Jaillet, Martin
3
Motivation
“Wisdom” has been that such taxi routing problems leave very
little room for the use of optimization (e.g., Pillac et al., 2011):
• Online problem.
• Not enough control.
• Simple heuristics are good enough.
• Real world applications are untractable.
But with the growing on-demand ride matching platforms:
• Smartphone-based, more information is available
• Centralized: more “control” on vehicle actions
• In high-demand situations, simple heuristics are not
enough (“price surge”...),
and with optimization solvers ever more powerful, we
may revisit this ….
Online Taxi Routing, Bertsimas, Jaillet, Martin
4
Setting
Formally, we consider here a variant of the so-called dynamic
pick-up and delivery problem with time-windows, as first
described in (Savelsbergh, 95)
• Online setting: customers origin and destination
information is made available when they request the ride.
• The customers have to be picked-up within a timewindow.
• We control which taxi will pick-up which customer.
We study how we can use optimization to leverage prior
information, and improve the efficiency of the system (more
customers served, more revenue…).
Online Taxi Routing, Bertsimas, Jaillet, Martin
5
Roadmap
I. A network-flow formulation
II. Scaling to real-world problems
III. Application: NYC Yellow Cabs
Online Taxi Routing, Bertsimas, Jaillet, Martin
6
Re-optimization and offline problem
Rolling-horizon with re-optimization strategies have worked well in
practice when applied to online routing problems (Yang et al., 2004).
Known future
customers
OFFLINE SOLUTION
Current
Time
Time
horizon
Time
OFFLINE SOLUTION
update
30s
Online Taxi Routing, Bertsimas, Jaillet, Martin
7
The offline taxi-routing problem
Revenue
Travel–time
Customer c’
Customer c
Pick-up time and
time-window
Feasibility
Pick-up Decision
Maximize
Revenue
Online Taxi Routing, Bertsimas, Jaillet, Martin
8
Network flow formulation
No cycles (pick-up time-windows are typically smaller than the duration
of a ride)
Taxi 1 origin
Taxi 2 origin
Time
Online Taxi Routing, Bertsimas, Jaillet, Martin
9
Network flow formulation
• We add flow constraints to obtain the optimal solution:
Taxi 1 origin
Taxi 2 origin
Time
Online Taxi Routing, Bertsimas, Jaillet, Martin
10
What makes the problem hard
Large
Time-windows
Easy to solve: most taxis are
free, closest taxi gets customer
Combinatorial
Optimization
No time window = TSP,
NP-complete
High demand/supply
Low demand/supply
No Optimization
“Simple”
Optimization
Fixed-Pickup time = network
max-flow problem (Polynomial)
Small
Time-Windows
Online Taxi Routing, Bertsimas, Jaillet, Martin
11
What solver ?
Large
Time-windows
Optimal solvers
(MIP)
Low demand/supply
Simple
heuristics
Optimization local heuristics
(2-OPT…)
High demand/supply
Max-Flow
Formulation
(LP)
Small
Time-Windows
Online Taxi Routing, Bertsimas, Jaillet, Martin
12
New York City yellow cabs
• NYC Taxi & Limousine commission
• 2010-2016 : 1.4 billion rides.
• Pick-up and drop-off
time/coordinates, fares, timings, #
passengers…
• Instance of taxi – routing: 5000 cabs
• Demand on 04/15/16 12-1:30pm in
Manhattan: 26,109 customers.
LP
MIP
(without time windows)
(with time windows)
Online Taxi Routing, Bertsimas, Jaillet, Martin
13
Trimming the flow graph
Trimming the graph using time
and distance between
customers
Taxi 1 origin
Taxi 2 origin
Time
LP
(without time windows)
MIP
(with time windows)
Online Taxi Routing, Bertsimas, Jaillet, Martin
14
Finding the backbone
We use the tractable LP solver with random pick-up times within the time
window to provide “good solutions” and find the edges that are likely to be in
optimal solutions (backbone).
Taxi 1 origin
Taxi 2 origin
Time
LP
(without time windows)
MIP
(with time windows)
Online Taxi Routing, Bertsimas, Jaillet, Martin
15
Manhattan experiment
Online Taxi Routing, Bertsimas, Jaillet, Martin
16
Results
Online Taxi Routing, Bertsimas, Jaillet, Martin
17
Technical challenges that needed to be solved
• Creating the road network from map
data.
• Getting the real demand data and format
it.
• Estimating travel-times from taxi data.
• Writing a fast large-scale online routing
simulation tool.
• Using state-of-the-art MIP solvers to reoptimize the fleet actions.
• Making everything communicate and run
in real-time.
Online Taxi Routing, Bertsimas, Jaillet, Martin
18
The end ….
Thank you!
Online Taxi Routing, Bertsimas, Jaillet, Martin
19