Suppose you have several passenger stations, and want to ensure that passengers at any station can get to any other. How many order sets do you create? If each order set just sent trains back and forth between two stations, you'd need:

Stations Order sets
2 1
3 3
4 6
5 10
6 15
n n × (n−1) ÷ 2

This is already unmanageable, so why not have a single order set that not only visits every station, but also covers every arc from one station to another, in both directions? It will obviously need a lot of orders, but they will still only constitute one order set to be managed.

Five stations

How do we work out an order set? Let's consider all possible arcs in a table. For five stations, we'll make a 5×5 table, eliminating the arcs that connect a station to itself. We'll label the stations simply A, B, C, D and E. In practice, it might be a good idea to rename your stations so that they include these labels.

A B C D E
A 1
B
C
D
E

What we'll have to do is traverse all cells exactly once, and finish back where we started. We'll start at A and move to B (as already indicated as step 1).

To find the next step, move up or down to find the cross ✘, then move right until you find en empty cell. Wrap around to the left when you run out of cells. Here's the next step:

A B C D E
A 1
B 2
C
D
E

At first, we plot out the obvious sequence ABCDE:

A B C D E
A 1
B 2
C 3
D 4
E

Now to complete it:

A B C D E
A 1 6 11 16
B 20 2 9 13
C 15 19 3 7
D 10 12 18 4
E 5 8 14 17

Now, following each cell by number, read out the station of the cell's column: BCDEACEBDADBECAEDCBA.

Note that we started at A, and the first B is the first station you go to after A. Note also that the final step is to an A, where we started. Since this is a continuous sequence, we can start anywhere we like, so we can rotate the orders to ABCDEACEBDADBECAEDCB so that they start with the natural sequence ABCDE.

Six stations

What happens with six stations?

A B C D E F
A 1 7 10 15 22
B 30 2 13 17 25
C 21 29 3 8 19
D 14 24 28 4 11
E 9 16 18 27 5
F 6 12 20 23 26

This yields the sequence (rotated to start at A): ABCDEFACEADFBDAEBECFCAFDBFEDCB.

For five stations, we needed 4×5=20 orders. For six, we need 5×6=30. For n, we need (n−1)×n. That's the same number we'd need if we just had (n−1)×n÷2 order sets, each with two orders, so we're not really dealing with any extra orders.

Adding stations

What do we have to do when we want to include a new station in an existing order set? Let's compare the sequences for 5 and 6 stations:

ABCDEACEBDADBECAEDCB
ABCDEFACEADFBDAEBECFCAFDBFEDCB

If we space the shorter sequence out a bit, we might be able to see some similarities:

ABCDE ACE   BDADBE  CA    EDCB
ABCDEFACEADFBDAEBECFCAFDBFEDCB

We just need to insert an extra 5 orders for the new station F, and an extra order for each existing station, and move one of the orders around:

ABCDE ACE   BDA BE  CA    EDCB
          D←←←←↲
ABCDEFACEADFBDAEBECFCAFDBFEDCB

Some stations might require more than one order (e.g. waypoints), so the number of orders could be increased by a small factor.

This would be mitigated by having order macros/functions, which an order set could call into. The station would have nearby some sort of beacon representing the sequence of orders needed for certain classes of train to use it. A ctrl-click on that would add a call to that sequence as a single order in the main order set. (A plain click could just copy the orders, like a macro.)

Rather than trying to get every station connected to every other station this way, group nearby towns together, and add an extra destination which is a feeder (such as the Grand Through Feeder). Then consider how to connect several feeders up.