Method DepthFirstSearch
DepthFirstSearch<TNodeValue, TEdgeLabel>(Node<TNodeValue, TEdgeLabel>)
Traverses through all the directed graph nodes in depth-first order, starting from the specified node.
public static IEnumerable<Node<TNodeValue, TEdgeLabel>> DepthFirstSearch<TNodeValue, TEdgeLabel>(this Node<TNodeValue, TEdgeLabel> node)
Parameters
node
Node<TNodeValue, TEdgeLabel>The node from which to start the search.
Returns
- IEnumerable<Node<TNodeValue, TEdgeLabel>>
A sequence containing the set of all nodes reachable from
node
in depth-first order.
Type Parameters
TNodeValue
The type of the labels associated with graph nodes.
TEdgeLabel
The type of the labels associated with graph edges.
DepthFirstSearch<TNodeValue, TEdgeLabel>(DirectedGraph<TNodeValue, TEdgeLabel>)
Traverses through all the directed graph nodes in depth-first order.
public static IEnumerable<Node<TNodeValue, TEdgeLabel>> DepthFirstSearch<TNodeValue, TEdgeLabel>(this DirectedGraph<TNodeValue, TEdgeLabel> source)
Parameters
source
DirectedGraph<TNodeValue, TEdgeLabel>The source directed graph that will be traversed.
Returns
- IEnumerable<Node<TNodeValue, TEdgeLabel>>
A sequence containing the set of all graph nodes in depth-first order.
Type Parameters
TNodeValue
The type of the labels associated with graph nodes.
TEdgeLabel
The type of the labels associated with graph edges.