Freesteel Blog » Triangular train journey blues

Triangular train journey blues

Saturday, January 30th, 2010 at 11:09 pm Written by:

The week began with a few days getting ScraperWiki more into shape, and then I had to go to Cheltenham on Wednesday morning (following a business breakfast) to help my old programming pals in Vero with their desperate constant scallop stepover bug that had been in the code since I left them with it in NC Graphics back in 2002 (eight years ago) in a set of undocumented functions nobody understood, that just worked — except when it didn’t.

It really did take two days of the three of us (me and the two fellows in Vero) of hard going at it to finally identify the problem, helped by various recollections of the way the algorithm worked that came to my mind during the hours of grind. The code was nowhere near as rough as I thought I’d left it, which was interesting. It was very educational because we chased the bug back through almost every stage of the algorithm from the point of the crash to the source where it joined a six-way cell in an invalid manner that was almost impossible to notice due the encoding of vertical segments using duplicate coordinates. Now they know everything about the algorithm they can extend it properly to various N-way cells to get rid of many of the remaining glitches caused by a design that originally intended only to handle 4-way cells because I mistakenly guessed that every case could be simplified by subdividing it tighter.

Now, according to the rules of corporate capitalism, I should never have been there in the first place, because it is in my interests for a competitor’s software to be unnecessarily buggy, with their programmers frustrated and unproductive, in order that their customers suffer enough costly consequences to consider switching to a rival system like the one I now work on. But this is just another of those specific bitter consequences ingrained into the system of institutionalized selfishness that seems to go unrecognized by our ideologically bent scholars. In actual fact I wasn’t losing anything because, (a) I know that CADCAM systems don’t actually compete on toolpath quality and innovation (because if they did I’d now be rich and in demand), and (b) I am trying to set an example that programmers should be on good terms with programmers in competitive companies because that’s where the jobs are.

Anyways, on Thursday night I caught the train back to Birmingham — using part of my Liverpool to Cheltenham return ticket — and bought another return ticket from Birmingham to London for the Hacks & Hackers Hack Day (sponsored by ScraperWiki). Francis joined me on Friday, and we spent the night with Earl, another friend in London, getting back to Euston station at around 13:30 on Saturday. Francis required a dosa, and I humoured him with a curry buffet, and we got back at 14:15 whereupon he bought a train ticket to Liverpool because he had no return ticket.

Francis’s ticket from London to Liverpool cost £65 if it was a single, and £66 if it was a return. So he bought the return and will once again wind up out-of-phase back in London without a ticket to Liverpool sometime in the next month.

This pricing has always pissed me off. All I can find to acknowledge it is this note in the Delivering a Sustainable Railway – 2007 White Paper CM 7176:

10.32 The Government has also reviewed the case for changing the regulation of ‘Saver’ return fares. These fares were regulated at privatisation, even though there was no particular justification on grounds of competition. The consequence is that passengers can be faced with a ‘Saver’ single fare of £69 and a ‘Saver’ return of £70, neither of which is actually the ideal fare for the journey they want to make. Focus groups show that most long-distance passengers would prefer an approach more in line with airlines’ practice of quoting ‘single-leg’ fares for the outward and return legs of a journey.

So that explains it: The rail monopoly prices on unregulated tickets are the highest they logically can be, which means that single tickets are basically the same price as regulated return tickets.

If, instead, they had chosen to regulate the cost of a single ticket, then return tickets would be exactly double the price of a single ticket, and the system would function as part of an integrated service where people who were able to take the opportunity of a lift on another form of transport one way could do the other way on the train without getting totally screwed for a price that was the same as having used the train both ways.

And that’s why I was attempting to optimize my ticketing by buying a return train ticket from Liverpool to Cheltenham (via Birmingham) for £60.50, going back to Birmingham, and then taking a return ticket from Birmingham to London for £41.90, which meant that I would have to return to Liverpool via Birmingham rather than take the direct train and use fewer train resources overall.

Francis didn’t believe me, and we parted company so we could both get some work done.

I got busted by the ticket inspector on the Birmingham to London train because the stamp on my ticket from the Cheltenham to Birmingham part of the journey was two days old.

I had been told in an earlier incident that while I could not break the outward train journey, I could break the return journey, and this was what I did. The ticket inspector said, Not for longer than 24 hours. I said, How am I supposed to know that limitation when all I was told was that I could break the journey? He said it’s perfectly clear in the rules, and you have to enforce a line to stop people using the same ticket over and over again for the whole month. I said, Do you have a copy of these rules? No he didn’t, but it says on every ticket:

Travel is subject to National Rail Conditions of Carriage (NRCoc) and to the conditions of carriage of other operators on whose services this ticket is valid. Copies of the NRCoC can be obtained from any staffed national rail station of from website:

As a consequence, he would now have to sell me a single ticket from Birmingham to Liverpool. This is always the policy gleefully announced on all train services because they know that single tickets are such an awesome rip-off they don’t need to complicate the situation with a further penalty fine.

I refused and bailed out onto the platform in Wolverhampton. I tried to get a bus, but they were all local. Eventually I had to go back into the train station to buy a single ticket from Wolverhampton to Liverpool. It was the only way home. “Are you sure you want a single? You are not coming coming back?” the lady asked. “No,” I said calmly as I handed over £25.50. She didn’t have a copy of the National Rail Conditions of Carriage, and it didn’t exist among all the crappy leaflets and fliers dotted around the station where it could have served to warn anyone attempting to optimize their triangular journeys in the way that I had.

Now… can anyone guess what document is not linked from the front page of the website in spite of being mentioned on every single one of billions of tickets, when they could have made it accessible on a domain such as

On the front page there is one link to something known as Terms and conditions, which begins:

Terms and Conditions for using the National Rail Enquiries website (the “Web Site”) . For the purposes of these Terms & Conditions the term Web Site also includes the web services, XML and any other data source supplying the Web Site

The Conditions of Carriage page is number 3 when you search for conditions of carriage.

From the front page, this important document is available by clicking on Train times & tickets, followed by Tickets & fares, followed by the 16th link in the column of links where it is positioned as though it is a subset of “Traveling around London”, from where you can download the 30 page 450kB NRCOC pdf document in handy clear-as-mud legalese, where it explains:

16. Starting, breaking or ending a journey at intermediate stations

You may start, or break and resume, a journey (in either direction in the case of a return ticket) at any intermediate station, as long as the ticket you hold is valid for the trains you want to use. You may also end your journey (in either direction in the case of a return ticket) before the destination shown on the ticket. However, these rights may not apply to some types of tickets for which a break of journey is prohibited, in which case the relevant Train Companies will make this clear in their notices and other publications.

For the purposes of this Condition and Condition 11, you will be treated as breaking your journey if you leave a Train Company’s or Rail Service Company’s stations after you start your journey other than:
(i) to join a train at another station, or
(ii) to stay in overnight accommodation when you cannot reasonably complete your journey within one day, or
(iii) to follow any instructions given by a member of a Train Company’s staff.

So what gives? There are absolutely no further “notices and publications” available on the London Midland train website.

To London Midlands
Dear sir,

This week I used the train to travel Liverpool->Cheltenham, and Cheltenham->London (where I stayed for two nights), and then London->Liverpool.

Unfortunately, it is evidently the policy to price (unregulated) single fares at around the same cost as a (regulated) return fare, so I chose to purchase a Liverpool->Cheltenham return, and a Birmingham->London return, which required me to travel back from London via Birmingham.

However, this broke the rules and I was put off from the Birmingham->Liverpool train by the inspector due to my ticket having a stamp from two days before (when I used it to travel from Cheltenham->Birmingham on my way to London). He told me that the limit was 24 hours.

Having obtained a copy of the National Rail Conditions of Carriage, I note that Condition 16 says:

“You may start, or break and resume, a journey (in either direction in the case of a return ticket) at any intermediate station, as long as the ticket you hold is valid for the trains you want to use.”

There is no reference to any time limit in these Conditions, and my return ticket was valid on both trains. Nor can I find any statement of any further rules on the London Midlands website.

Can you point me to a clear statement of the rules for which I was put off the train, so that I (and others) can ensure that I do not again get caught out by them when attempting to complete a non-standard journey at a reasonable price?

To National Rail feedback:

This is a question about website design. Every single ticket issued states that “Copies of the NRCoC can be obtained… from the website”

In view of this, do you think it would be reasonable to have a link to it from the front page, rather than buried four deep among the navigation toolbars?

Is it possible I have found something the millions of train nerds in this country have failed to scrutinize?

PS For all you guys using the NCG source code what I wrote, but which made some other people millionaires:

The error is in PSsubcell.cpp, line 869:
bool SetLinksAsBestLinkData(const PSCpairboundparams& pscparams, PSsubcell& scell)
where near the bottom in the loop following the comment
// Set the pointers to make the connections.
setting the back-pointers across the cell according to the best connection, we found that it was able in a 6-way cell to connect 0->3, 2->5, 4->1 because the function (using this Link Data) didn’t take account of whether the connections crossed one another.

The function is irreparable. The quick fix is to detect when there is a crossing condition, and return false if there is so it drops back into the less sophisticated PSsubcell::SetLinksAsBest() function which will give you a result that doesn’t have self-crossing. Then in the medium term you need to code the 4-way and 6-way cells independently and properly considering all the alternatives. It’s not possible to get the right answer by picking the single “best” connection first, because it’s the the gaps between the connecting passes that make it good or bad.

Drop me a line of this helped.


  • 1. Sym replies at 31st January 2010, 9:45 am :

    Interestingly in Norfolk we just have our tickets punched – rather than stamped – so they have no way of telling when you travelled on it.

    In the passed I have got around the stamping problem (gaming outwards journeys when I was a reckless and poor teenager) by licking my thumb just before giving it to the inspector and smudging the ink when it’s handed back to me. I might start doing this by default from now on.

  • 2. Matthew replies at 4th February 2010, 12:34 pm :

    As far as I’m aware, what you did with your Cheltenham-Liverpool ticket was perfectly fine. e.g. – so I hope you hear back from London Midland.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>