pub fn trim_tagged_branch<R: Resource + Eq>(
    graph: &mut Graph,
    template: R
) -> Vec<Branch>