Shields.Graphs/Graph.cs
/// <summary>
/// Performs a breadth-first traversal of a graph or digraph.
/// </summary>
/// <typeparam name="TNode">The type of a node.</typeparam>
/// <typeparam name="TKey">The type of a node key.</typeparam>
/// <param name="sources">The set of nodes from which to start the traversal.</param>
/// <param name="descriptor">The object describing how to navigate the graph.</param>
/// <returns>The breadth-first traversal of nodes.</returns>
Performs a breadth-first traversal of a graph or digraph.
Performs a breadth - first traversal of a graph or digraph .
public static IEnumerable<TNode> BreadthFirstTraversal<TNode, TKey>(
            this IEnumerable<TNode> sources,
            IGraphDescriptor<TNode, TKey> descriptor)
        {
            return BreadthFirstTraversal(sources, descriptor.Key, descriptor.Next);
        }
public static IEnumerable < TNode > BreadthFirstTraversal < TNode , TKey > ( this IEnumerable < TNode > sources , IGraphDescriptor < TNode , TKey > descriptor ) { return BreadthFirstTraversal ( sources , descriptor . Key , descriptor . Next ) ; }
Performs a breadth-first traversal of a graph or digraph.
Performs a breadth - first traversal of a graph or digraph .
The breadth-first traversal of nodes.
The breadth - first traversal of nodes .
IEnumerable<TNode>
this
descriptor
IGraphDescriptor<TNode, TKey>
The object describing how to navigate the graph.
The object describing how to navigate the graph .
sources
The set of nodes from which to start the traversal.
The set of nodes from which to start the traversal .
typeparam
The type of a node.
The type of a node .
typeparam
The type of a node key.
The type of a node key .