So I’ve been travelling by train a lot recently, and have got very, very frustrated with the UK’s insane policy on train fares. Money Saving Expert points out that you can save a lot of money by buying split tickets. For instance, a ticket from Gloucester to Oxford might cost you 29 pounds; but buying two tickets for one journey (Gloucester-Swindon, Swindon-Oxford) will cost you a total of 16.10 - a saving of 45% on exactly the same journey, even using the same trains.
I don’t have time to pad through all the different possibilities, so I wrote software to do it for me. Here’s an example of going from Gloucester to Neath:
% perl -Ilib connections.pl GCR NTH Computing paths... Done Normal ticket: GCR->NTH: 33.10 * GCR NWP NTH: 10.20 + 12.80 = 23.00 (30% saving!) * GCR CDF NTH: 18.30 + 5.90 = 24.20 (26% saving!)
By buying a ticket from Gloucester to Newport, then Newport to Neath, you save ten pounds, another third.
Another example, Neath to Oxford:
% perl -Ilib connections.pl NTH OXF Computing paths... Done Normal ticket: NTH->OXF: 59.00 * NTH CDF OXF: 5.90 + 45.00 = 50.90 (13% saving!) * NTH CDF DID OXF: 5.90 + 41.00 + 4.90 = 51.80 (12% saving!) * NTH CDF BRI OXF: 5.90 + 9.30 + 17.70 = 32.90 (44% saving!) * NTH CDF BRI DID OXF: 5.90 + 9.30 + 17.70 + 4.90 = 37.80 (35% saving!) NTH DID OXF: 58.00 + 4.90 = 62.90 * NTH BRI OXF: 27.50 + 17.70 = 45.20 (23% saving!) * NTH BRI DID OXF: 27.50 + 17.70 + 4.90 = 50.10 (15% saving!)
You can save nearly 50% by buying split tickets through Swindon.
The software needs a lot of work, it has a lot of bugs, and currently you can’t tell it when you want to go. (It also doesn’t check that the connections make sense. Update: It does now.) Since you can save a lot of money with advance fares, this needs to be fixed. (This is a fairly simple interface change.)
When it’s all tidied up, I’ll release the backend Perl modules and put a web frontend onto it. Jamie suggests I should charge people 10% of the saving for using it, but that would be evil. Tempting, though.
Expect more on this later. Two problems I see already before releasing this, though:
- It could become huge and scalability will be a problem.
- I’m currently scraping the National Rail website and they’ll probably get annoyed with me.