I've been reading Alfred Galichon's terrific new monograph on optimal transportation, and was
inspired over the fall break to look into his example in Section 8.4 on routes for the Paris metro.
Data for the London Underground was more easily accessible, so I made a toy tube router function
for R that takes an origin and destination and computes an "optimal" path by minimizing the
cumulative distance between stops. An example path is illustrated in the figure below with the
lines color coded, unfortunately my current data sources don't account for links that have multiple
lines, so the routes typically overstate the number of line changes. (It would be nice to penalize
line changes with a fixed cost, but this would have extended the project beyond the fall break.)
Data and code is available here:http://www.econ.uiuc.edu/~roger/research/OT/tube.tar.gz
It is all very simple, just a linear program, but it makes you think about how one might scale it
up to the scheme used by Google Maps.