Flight Metric

Daniel Erenrich
2 min readJun 27, 2015

--

It always bothers me how flight distances only loosely correlate with prices. I do most of my travel by plane and so airfare prices are the most useful distance metrics.

It occurred to me, what if someone made a warped map of the US where distance corresponds to airfares? What would it look like? Would JFK be close to LGA?

To that end I wrote a script to scrape the airfares for all pairs of major airports across the country. I used an undocumented Google Flights API and then networkx to visualize the graphs.

The results are hard to parse but interesting nonetheless.

Most obviously Buffalo airport is really expensive to get to. In fact, I had to remove airports like Honolulu because they were so expensive to get to that they ruined the graph. More interestingly we see Denver, Chicago, Houston and SFO all clustered at the top of the graph. They are all roughly in the Western United States and are all United Airlines hubs.

Now a plot like this cannot hope to fully capture the original ticket prices. It’s only an approximation. One way to improve this would be to increase the number of dimensions.

--

--

Responses (1)