-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Supporting a Topological sort function could be useful.
I've seen an implementation having this signature in some other code:
/// <summary>
/// Topological Sorting (Kahn's algorithm)
/// </summary>
/// <remarks>https://en.wikipedia.org/wiki/Topological_sorting</remarks>
/// <typeparam name="T"></typeparam>
/// <param name="nodes">All nodes of directed acyclic graph.</param>
/// <param name="edges">All edges of directed acyclic graph.</param>
/// <returns>Sorted node in topological order.</returns>
public static List<T>? TopologicalSort<T>(HashSet<T> nodes, HashSet<Tuple<T, T>> edges) where T : IEquatable<T>Not sure if this is a fit for SuperLinq, but maybe worth considering.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request