pub fn simplify_paths(
from: &[usize],
to: &[usize],
n_nodes: usize,
) -> Vec<Vec<usize>>Expand description
Find simplified chains: every maximal path of interstitial (degree-2) nodes
between two endpoints. Each chain is returned once as an ordered vector of
node indices [endpoint, ..interstitial.., endpoint].