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

Add O(m+n) Adjacency Lists Sorting Algorithm #2972

Closed

Conversation

hungz23
Copy link

@hungz23 hungz23 commented May 12, 2018

In this pull request, I add an O(m+n) Algorithm for sorting all adjacency lists of a graph G.
It can be useful for some Greedy Algorithm in Graph Theory.

Base automatically changed from master to main March 4, 2021 18:20
@MridulS
Copy link
Member

MridulS commented Feb 4, 2023

Thanks for this @hungz23 sorry for the delay in getting this reviewed!

NetworkX has made a bunch of changes in the last 5 years and this function can be now rewritten with just something like

{i: list(G.adj[i]) for i in order}

So if anyone requires this in an implementation of any algorithm they should be able to use this one liner.

@MridulS MridulS closed this Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants