Ryanair, Hamiltonian Cycles, and using graph theory to find cheap flights (2018)
blog.jonlu.ca
blog.jonlu.ca
We created some data structures that allow almost instant searching of such routes and we have scrapers running regularly on Ryanair, easyJet, wizzair, and Transavia. You can query the algorithm here: https://algo.tripchemy.com/routes/TSF?year=2020&month=02&day...
It's based on the following Open source project which my friend made back in the day https://github.com/Whazor/Roundtrip
It seems that easyJet has outsourced its anti-scraping protection to the company called "Distil Networks"[1].
I wonder how could they block screen scrapers using Chrome on Android with mobile IP addresses.
When searching for flights to or from London it's not clear which airport is which out of LTN, LGW and STN.
Screenshot: https://i.vgy.me/J1F0j1.png
Would it be possible to add the IATA code in brackets (after London) and possibly another item in the dropdown for all London Airports?
I fail to see how these are two different extremes. More like two sides of the same coin.
And you’d expect such a business to have high margins; i.e. to be charging a lot for a little, maximizing earnings at the expense of reputation.
But instead, Ryanair is extremely low margin. Which actually is surprising. (I mean, not in an economic sense; the greedy Ryanair would die, where the cheap Ryanair would, and does, live, serving a niche. But it’s still surprising in the sense that it means that the archetype you were expecting to apply—that of the greedy owner—probably doesn’t.)
Only if that business had a monopoly. As Ryanair has competition, and Ryanair doesn’t provide any service that others won’t or can’t, one would not expect high margins.
Edit: reread your last pp and obviously this isn’t news to you. I just don’t share the greed = margins expectation.
Costco, while blessed with a better reputation, is similar. The prices are low in large part because the experience of a Costco store is extremely barebones: limited variety of items, required to buy in bulk, everything is just on the pallets they came on, the store is literally a warehouse with a cement floor, customer service is very limited etc. That's not them being greedy either, it's fundamental to how their business works.
Costco employees are paid very well compared to other retail and warehouse employees. The average Costco shopper is also more affluent than a typical Walmart or Target shopper.
Costco customer service is not limited at all. It’s the best in the industry. They have notoriously generous return policies. As long as it’s not electronics, you can return basically anything at any time. The electronics section also tacks on another year warranty compared to other retailers.
Many items in Costco aren’t actually generally the best deal around. Again, they cater to high income families. Yes, the low-labor warehouse environment with very few SKUs reduces costs, but it not a low-end experience. Only bulk staple foods are truly great deals, many items in the middle section (home goods) and electronics can be found for cheaper elsewhere with little difference in quality.
The analogy you might be looking for is Amazon. They use contracted employees for deliveries and overworked, underpaid non-union warehouse employees. They have very little emphasis on delivering genuine goods and don’t mind selling off-brand stuff as long as it’s the cheapest option. They use market dominance as a replacement for decent service and products: who else can run their own delivery service?
As a consumer, I'm no longer loyal to one brand for almost anything (including such essentials as my laptop) because someone will come by and offer me cheaper service, but I don't want to enable the newcomer to take over the market because it'll come back to bite me. But people like me are more discerning than the normal consumer.
In the 90's, I can remember a pocket-sized, printed guide by a company called OAG. I used to call it "the OAG Guide". I can remember getting a copy of this for free. It listed every schedule for every route for every airline. I can also remember getting similar pocket-sized guides from certain airlines listing all their routes and schedules for each route.
When the task of planning routes comes up, I sometimes think of those old printed guides and wonder if this could be cited as an example where certain information was actually more easily accessible before the www became popular than after.
And if you wanted to analyse large numbers of routes for business purposes then back in the nineties, you'd have probably found it easier to buy OAG's analyser tool or an airline spreadsheet file than digitise thousands of route pairs from a paper timetable, which you can still do if you don't want to write a scraper.
I never tried to "analyse large numbers of routes for business purposes" using those free printed guides, but I did use them sometimes when planning trips, real or imaginary.
Rather than "can I go to Paris and Brussels and back to Venice again in three flights" what I wanted to know was "what airlines fly between cities 1, 2, 3, etc. and what are all of departure and arrival times for the flights they have on those routes."
Today I might use that information when deciding what to price information I want to scrape.
I wonder if today there is a digital source of that information, free for public access. Probably not.
Many people. Mostly business people who need to be somewhere on short notice. Until very recently, my wife was in this group.
Or does the airport ticketing desk have a later cutoff time?
In her situation, no. The phone would ring at 5am, she'd get dressed and grab her "go" bag and walk down to the subway, then buys her ticket (usually one-way) at the airport counter.
In theory she could try to book tickets on her phone on the train, but connectivity can be iffy on the train, and buying an expensive airline ticket is not the sort of thing you want to take unnecessary chances with. (Think double-purchases, false purchases, etc...)
Though timetable enthusiasts can still buy paper guides from OAG for a lot less than their data in usable-for-analysis form, apparently.
The official name was "Official Airline Guide," and it was considered an indispensable part of any office.
It first went online as OAGEE (Official Airline Guide Electronic Edition) on CompuServe. It was a massive driver of business accounts to CompuServe, and I believe the first place the average Joe could book airline tickets online.
Then the internet happened...
There was also an HN thread from 2012 discussing ITA's use of Lisp.[1]
[0] http://www.demarcken.org/carl/papers/ITA-software-travel-com...
"We couldn't find your trip."
Also, it's cities filter is doesn't seem to work. Try putting search above, but economy and inverse cities. It's going to be dominated by flights from London which you can deselect LHR as much as you want to. London sucks for transit if you are outside of UK.
Edit: Google Flights are no better here. Lots of carriers hide biz class prices from Google or take ages to load (some time out happens in Google) or straight up lie ("Ooops! the price has increased" since you last search 10 seconds ago - I'm looking at you Qatar) or mixes in some random Economy class flights out of nowhere...
The good news is that with business class fares, the problem space is smaller, so finding and learning the patterns is very doable.
The best I've found yet was one of the Chinese carriers Melbourne to Moscow return for 1650 euros...
Instead of finding all 6 hops from start and checking if it's the end find 3 hops from start, 3 hops from end and just intersect two sets.
It can easily solve 16 nodes in under 50ms by running in WebGL
The code is fairly trivial though - Cytoscape does most of the heavy lifting https://github.com/jonluca/blog/blob/master/js/ryanair-graph...
For example if you are wanting to travel from A->B, a flight that goes A->B->C may be cheaper than A->B if A->C is a competitive route.
I’m kinda curious what difference different lifestyle choices really make. Eg going vegan for a year vs no flights for a year vs getting green electricity.
""" Several scientific studies have shown that when people, especially those living in developed countries but more generally including all countries, wish to reduce their carbon footprint, there are a few key "high-impact" actions they can take such as: having one fewer child (58.6 tonnes), living car-free (2.4 tonnes), avoiding one round-trip transatlantic flight (1.6 tonnes), and eating a plant-based diet (0.8 tonnes). These differ significantly from much popular advice for "greening" one's lifestyle, which seem to fall mostly into the "low-impact" category. """
... although I have seen air travel clearly dominate car use in other sources. Obviously it depends on how you use the car and what type it is.
Also, not having children being so impactful seems to assume that emissions are proportional to population, which seems doubtful to me (haven't looked into the original sources though).
Like, how much difference does it make to do anything personally?
What's the lowest hanging fruit on corporate action?
Here's one that looks reasonable: https://www.carbonfootprint.com/calculator.aspx. The largest share of my emissions was from flights, making up 7 tons of my 14 ton total.
So you might think the best single change I could make would be to stop flying. But the same website quotes $8/ton to offset my carbon footprint. So an even better single change would be to donate $100/year to some initiative to upgrade cooking stoves in Africa, or whatever the current best-value project is.
You know where I got this? Gen. Groves. During the Manhattan project, asked if they should do one of two choices he said do both. This later paid back when it turned out thermal diffusion could pre enrich the feed for other techniques like the calutron and improve its efficiency.
A carbon tax would make that discussion moot though: It can be adjusted dynamically to follow a defined CO2 reduction schedule, and carbon savings would come from low hanging fruit first, and ultimately affect everything.
It seems like a lot of the small changes with small impacts could actually cause a larger ripple effect which might end up causing the larger changes. Perhaps small changes, once accumulated, could be the key?
Because of the altitude the emissions are worse than those emitted at sea level.
We have a lot more cars on the road than airplanes in the sky, so reducing their carbon footprint would have a bigger impact. But on an individual basis, flying is one of the most carbon intensive travel options.
Unless you can convince a large amount of passengers to not travel at all (and i meant not travel, rather than switch to a different mode of transport), there is no reducing carbon emissions.
At some point, less revenue = less flights. Even dropping demand by 200 people on a route would cause a reduction in flights. It's a long way off from making a huge impact, but individuals can decide how they want to vote with their dollar and every dollar and every reduction counts.
Sure, a huge reduction in carbon emissions will probably come from a technology breakthrough, but we can help accelerate the demand for that tech by reducing demand for current carbon emitting activities.
However annual carbon footprint of a regular citizen is completely meaningless in the greater scheme of things. Stop shifting the blame onto regular people, we're not going to give up on civilisation just because some monopolies are burning coal and gas.
I'm not, probably the opposite. I'm stating that if you choose to fly a ~5hr flight, you're contributing 11% more carbon than the average person does all year. In other words, by reducing the demand for flying you can have a greater impact on reducing emissions than the average person could.
We need to focus on interventions that will actually make a difference. Sadly, most of those are through government regulation, which most major economies are unwilling to do.
I think you overestimate the importance of flights to the world economy. If all flights ended tomorrow, the world economy would chug along and hardly notice. Banning trains, trucks or ships would be devastating to the world economy though.
> We need to focus on interventions that will actually make a difference. Sadly, most of those are through government regulation, which most major economies are unwilling to do.
Both those interventions would actually hurt the world economy.
Let me guess, you take a lot of flights every year? Can't defend flights under the false assumption it'll hurt the world economy and then support "interventions" that will actually hurt the world economy.
But all flights worldwide only account for 2% of all CO2.
Industrial output accounts for 22% and electricity 28%.
If we regulated all electricity to be carbon neutral, that would make electricity cost more and harm the economy, but it would have a huge effect on emissions.
Flying just isn't that important to climate change, but it is quite important to the economy. Not a lot of goods move by air, but people do. A lot of the world depends on tourism. For some countries, it is the main contributor to their GDP.
Yeah, I fly a few times a year, sometimes to the other side of the planet, for business. And also for tourism where I spend a bunch of money buying local goods.
I also use a lot of energy. I pay extra to make sure that energy all comes from carbon neutral sources. That makes a much bigger difference to climate change than using a plane.
Let's see if they propose the same argument if the banning was for driving, or some other form of carbon emission that affects them a lot more (like food, or heating).
This simply isn't true. More people use the NYC metro in one day than people fly in the entire US over an entire year. Comparatively speaking, hardly anyone flies compared to using trains, buses, cars and every other major form of transportation.
> A lot of the world depends on tourism.
No. The world depends on oil, gas, etc. The world depends on transportation of goods. The world depends on manufacturing and production. The world doesn't depend on flights.
> I also use a lot of energy. I pay extra to make sure that energy all comes from carbon neutral sources. That makes a much bigger difference to climate change than using a plane.
No. It makes no difference. Other than allowed privileged people to pat themselves on the back.
I agree with you that flights make up a tiny fraction of overall emissions. But you are completely wrong about the impact of flying on the world economy. Ending flights won't bring the "world economy to a grinding halt." Just like ending flights would have neglible effects on overall emissions, it'll have neglible effects on the world economy. But use whatever rationalization to fly if it helps you sleep at night.
https://www.icao.int/Meetings/wrdss2011/Documents/JointWorks...
Nice.
> is estimated at US$ 2,960 billion, equivalent to 8% of world Gross Domestic Product (GDP).
Doesn't this prove my point? And that's including every conceivable thing possibly related to aviation ( direct, indirect, induced and catalytic ). Not just flights. Not quite, "grind down to a halt" is it?
For the last time, if flights stopped, the world economy isn't going to grind down to a halt. Flights are luxuries more than anything. The world can survive without luxuries. The oil industry, gas industry, international shipping, railroads, trucks, etc can bring the world economy to a grinding halt. Not sure why you are still arguing when objectively, your statement was wrong.
Why not just say instead of "the world economy grinding to a halt", you meant to say "the world economy will be slightly inconvenienced"?