Given a set of vertices and edges, removes all vertices that do not have
any edges and returned the new, minimal set of vertices. Also updates
each edge in "edges" to correspond to the new vertex numbering. (Note
that this method does *not* merge duplicate vertices, it simply removes
vertices of degree zero.)
The new vertex ordering is a subsequence of the original ordering,
therefore if the edges were lexicographically sorted before calling this
method then they will still be sorted after calling this method.
The extra argument "tmp" points to temporary storage used by this method.
All calls to this method from a single thread can reuse the same
temporary storage. It should initially point to an empty vector. This
can make a big difference to efficiency when this method is called many
times (e.g. to extract the vertices for different layers), since the
incremental running time for each layer becomes O(edges.size()) rather
than O(vertices.size() + edges.size()).
Given a set of vertices and edges, removes all vertices that do not have any edges and returned the new, minimal set of vertices. Also updates each edge in "edges" to correspond to the new vertex numbering. (Note that this method does *not* merge duplicate vertices, it simply removes vertices of degree zero.)
The new vertex ordering is a subsequence of the original ordering, therefore if the edges were lexicographically sorted before calling this method then they will still be sorted after calling this method.
The extra argument "tmp" points to temporary storage used by this method. All calls to this method from a single thread can reuse the same temporary storage. It should initially point to an empty vector. This can make a big difference to efficiency when this method is called many times (e.g. to extract the vertices for different layers), since the incremental running time for each layer becomes O(edges.size()) rather than O(vertices.size() + edges.size()).