There is a graph g. I'd like to DepthFirstScan it:
DepthFirstScan[g, 5, {"VisitedVertex" -> (G[#1, #2] &)}];
where G[x,y] := is some function that makes a change to the graph when a condition is fulfilled.
Then I'd like to stop the scan of the graph.
Can I stop the DFS by some control in G[x,y]?