A ‘thread’ in a network is a subset of the edges of the network
which does not pass through any forks in the network.
Given a linear network X,
this function identifies the threads in X and assigns a label to each
edge (segment) of the network indicating which thread it belongs to.
Formally a thread is a set of edges joining successive
vertices \(v_1, \ldots, v_n\) of the network
such that
there is an edge of the network joining
\(v_i\) and \(v_{i+1}\) for each \(i\)
each of the intermediate vertices
vertices \(v_2, \ldots, v_{n-1}\)
has degree 2 (i.e. there are exactly 2 edges of the network which
end at the vertex)
the terminal vertices \(v_1\) and \(v_n\)
do not have degree 2, unless they are the same vertex.
Every edge (segment) of the network belomgs to a unique thread.
This algorithm assigns a label to each edge indicating which thread
it belongs to. If what="labels" (the default), the result is a
factor of length equal to nsegments(X) giving the
classification of segments.
If what="tessellation", the result is a tessellation of
X (object of class "lintess") in which the tiles of the
tessellation are the threads.