In all of these methods the graph is the delegate and 'it' in each closure is the vertex. This allows other methods in the graph to be used during traversal. For instance a user can get the inEdges or outEdges for the vertex in a DirecedGraph. This can be useful for finding vertices with certain input or output while traversing the graph.
eachBfs methods
Will include: eachBfs(Closure) and eachBfs(String,Closure)
starts at first vertex or vertex where name matches given string
run closure on each vertex in breadth first order
in keeping with groovy's each there is no way of returning early. For that behavior use find methods instead.
findBfs methods
Will include: findBfs(Closure) and findBfs(String,Closure)
Starts at first vertex or vertex where name matches given string
Should work like groovy's find and return the vertex if closure returns true otherwise returns null
findAllBfs methods
Will include: findAllBfs(Closure) and findAllBfs(String,Closure)
starts at first vertex or vertex where name matches given string
returns list of all matching vertices
injectBfs methods
Will include: injectBfs(Object,Closure) and injectBfs(String,Object,Closure)
starts at first vertex or vertex where name matches given string
Object is the first value passed into the first call to closure. The result of each call to closure are passed to the next call to closure.
the result of the final call to closure is returned from the method
collectBfs methods
Will include: collectBfs(Closure) and collectBfs(String,Closure)
starts at first vertex or vertex where name matches given string
calls inject with a list and a closure that calls the given closure adding the result to the list
traverseEdges
The above methods need a method that tells them which edges to follow during a traversal. In the past this was called adjacentEdges but that name doesn't fit well. This method needs to be modified when DirectedGraphPlugin is applied to only return outEdges. This method will be used in depth first search methods as well.
In all of these methods the graph is the delegate and 'it' in each closure is the vertex. This allows other methods in the graph to be used during traversal. For instance a user can get the inEdges or outEdges for the vertex in a DirecedGraph. This can be useful for finding vertices with certain input or output while traversing the graph.
eachBfs methods
findBfs methods
findAllBfs methods
injectBfs methods
collectBfs methods
traverseEdges
The above methods need a method that tells them which edges to follow during a traversal. In the past this was called adjacentEdges but that name doesn't fit well. This method needs to be modified when DirectedGraphPlugin is applied to only return outEdges. This method will be used in depth first search methods as well.