Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding a TopologicalSort function #628

Open
Treit opened this issue Feb 15, 2024 · 0 comments
Open

Consider adding a TopologicalSort function #628

Treit opened this issue Feb 15, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Treit
Copy link

Treit commented Feb 15, 2024

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.

@viceroypenguin viceroypenguin added the enhancement New feature or request label Feb 16, 2024
@viceroypenguin viceroypenguin self-assigned this Feb 22, 2024
@viceroypenguin viceroypenguin added this to the v6.1.0 milestone Apr 10, 2024
@viceroypenguin viceroypenguin modified the milestones: v6.1.0, v6.2.0, 6.3.0 Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants