title: Functions for pruning a NetworkX graph?
body: <p>I am using NetworkX to generate graphs of some noisy data. I'd like to "clean up" the graph by removing branches that are spurious, and hope to avoid re-inventing the wheel.</p>
  
  <p>For example, the linked picture shows a sample set of graphs, as colored nodes connected by gray lines. I'd like to prune the nodes/edges indicated by the white boxes: <a href="http://www.broadinstitute.org/~mbray/example_tree.png" rel="noreferrer">http://www.broadinstitute.org/~mbray/example_tree.png</a></p>
  
  <p>Essentially, the nodes/edges to be removed are branches typically only a few nodes (&lt; 3) in length. By removing them, I hope to have a tree with a minimum of branching but the branches that do remain are "suitably" long.</p>
  
  <p>Before I start crafting code to examine subtrees for removal, are there NetworkX functions that can be used for this purpose?</p>