Shields.Graphs/Graph.cs
/// <summary>
/// Sorts the nodes of a graph in topological order.
/// </summary>
/// <typeparam name="TNode">The type of a node.</typeparam>
/// <typeparam name="TKey">The type of a node key.</typeparam>
/// <param name="nodes">The set of nodes.</param>
/// <param name="descriptor">The object describing how to navigate the graph.</param>
/// <returns>The topologically sorted nodes.</returns>
/// <exception cref="Shields.Graphs.GraphCycleException">This exception is thrown if the graph contains a cycle.</exception>
Sorts the nodes of a graph in topological order.
Sorts the nodes of a graph in topological order .
public static IEnumerable<TNode> OrderTopologically<TNode, TKey>(
            this IEnumerable<TNode> nodes,
            IGraphDescriptor<TNode, TKey> descriptor)
        {
            return OrderTopologically(nodes, descriptor.Key, descriptor.Next);
        }
public static IEnumerable < TNode > OrderTopologically < TNode , TKey > ( this IEnumerable < TNode > nodes , IGraphDescriptor < TNode , TKey > descriptor ) { return OrderTopologically ( nodes , descriptor . Key , descriptor . Next ) ; }
Sorts the nodes of a graph in topological order.
Sorts the nodes of a graph in topological order .
The topologically sorted nodes.
The topologically sorted nodes .
This exception is thrown if the graph contains a cycle.
This exception is thrown if the graph contains a cycle .
IEnumerable<TNode>
this
descriptor
IGraphDescriptor<TNode, TKey>
The object describing how to navigate the graph.
The object describing how to navigate the graph .
nodes
The set of nodes.
The set of nodes .
typeparam
The type of a node.
The type of a node .
typeparam
The type of a node key.
The type of a node key .