title: Recursively search networkx graph
body: <p>A question about recursion (and tangentially the graphing library networkx): I have an directed graph with node that have edges that have an attribute ["value"] that can be 0 or 1 (effectively edge weights). </p>
  
  <p>I want to be able to examine a node's neighbor recursively until a neighbor's node fails a certain threshold. For example:</p>
  
  <pre><code>def checkAll(x):
      for neighbor in graph.neighbors(x):
           if neighbor is bad:
               fail
           else:
              checkAll(neighbor)
           #add all good neighbors here? This isn't working!
  </code></pre>
  
  <p>I'm failing at recursion, basically, I think because of the way the "for" loop is done. Can I get some help? (I looked at <a href="https://stackoverflow.com/questions/3278481/list-of-all-paths-from-source-to-sink-in-directed-acyclic-graph">this other SO post</a> but it didn't seem particularly relevant?)</p>
  
  <p>Thank you!</p>