The notion of terminal used in this function is based on seminal work by J.
D. Nystuen and M. F. Dacey (Nystuen & Dacey, 1961), as well as on the follow
up variation from Rihll & Wislon (1987 and 1991). We assume given a square
flow matrix \((Y_{ij})_{1\leq i\leq n, 1\leq j\leq n}\). The incoming flow
at location \(j\) is given by
$$D_j=\sum_{j=i}^{p}Y_{ij},$$
and is used as a measure of importance of this location. Then in Nystuen &
Dacey (1961), location \(j\) is a "terminal point" (or a "central city") if
$$D_j \geq D_{m(j)},$$
where \(m(j)\) is such that
$$\forall l,\quad Y_{jl}\leq Y_{jm(j)}.$$
In words, \(j\) is a terminal if the location \(m(j)\) to which it sends
its largest flow is less important than \(j\) itself, in terms of incoming
flows. This is the definition used by the function when definition is
"ND".
Rihll & Wilson (1987) use a modified version of this definition described in
details in Rihll and Wilson (1991). With this relaxed version, location
\(j\) is a terminal if
$$\forall i,\quad D_j \geq Y_{ij}.$$
In words, \(j\) is a terminal if it receives more flows than it is sending
to each other location. It is easy to see that each Nystuen & Dacey terminal
is a Rihll & Wilson terminal, but the reverse is false in general. The
function use the Rihll & Wilson definition when definition is "RW"