I attach two files: the first deals the problem in a general manner; the second goes down in detail starting from the map of the German railway communications.
Given this excellent theory, and "automatic train control" it is especially awful to have news of the recent head to head collision on the German railway. As the models have shown, there should not even be two trains in the same direction contesting for the same track, never mind in opposite directions. That event reinforces the fact that this is a very serious business with no room for misunderstanding or ambiguity. We will have to wait for the report from the crash to know what happened of course.
Concerning the comment about the head collision in Germany I have to point out that:
- automatic train control is expensive, and therefore is used only on limited stretches of railway network, including all high speed lines, but absent on many local lines;
- timetabling and railway safety are very different in safety level requirements. Making timetabling responsible for collisions would contistute a strongly unnecessary obstacle to timetable optimisation. For example, sending one train after another on a track leading to an interchange station would generate a "danger", but is optimal for passengers changing trains. Safety of trains should therefore be provided by separate (and definitelly superior) from timetabling systems.