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

Faster Graph::transpose #386

Merged
merged 2 commits into from
Sep 3, 2019
Merged

Conversation

manpen
Copy link
Contributor

@manpen manpen commented Jul 24, 2019

The current Graph.transpose function uses a GraphBuilder to copy the input graph into a transposed instance. By doing so it loses edge indices.

The new variant use the new awesome preallocateDirected and addPartial*Edge interface to directly create the new graph -- in parallel, without random I/O, and preserving edge ids. In one instance with ~110k nodes and ~60M edges to runtime decreased from 356s to just under 6s.

The PR also removes the Graph.cpp -> GraphBuilder.hpp dependency and adds a unit test for the Python interface.

@manpen manpen changed the title Feature/faster transpose Faster Graph::transpose Jul 24, 2019
@hmeyerhenke
Copy link

Sounds great, Manuel!

networkit/test/test_graph.py Outdated Show resolved Hide resolved
@angriman
Copy link
Member

Apart from a minor comment in the Python tests, LGTM.

@manpen
Copy link
Contributor Author

manpen commented Aug 20, 2019

Thanks for your feedback again. I'm now back from vacation and implemented your comments.

@angriman
Copy link
Member

Thank you, there is a conflict the the test_graph.py, maybe this is because of the new removeMultiEdges test.

@avdgrinten avdgrinten merged commit 555e0f0 into networkit:Dev Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants