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
[GraphIndex] Detects duplicate edges on simple graphs #340
Conversation
How about let's hold this for a while, wait for the immutable graph PR? |
Sure. Closing this for now. |
Reopening this since immutable graph is merged. |
so there isn't performance impact? |
EDIT: updating with a reference implementation of maintaining an STL Modifying an existing graph of 1M nodes and 5M edges is significantly slower:
Adding edges to an empty graph:
Checking whether an edge exist between two nodes for 5% of all edges
STL |
What do you think of the solution in #419 ? namely having |
Sure. What if someone wants to add edges batch by batch while keeping it a simple graph (in the case of streaming graphs)? Just a theoretical question though - I don't know which situation is more common |
That's good consideration. For streaming graph, my guess is some new solution is needed. We may need to read some papers about streaming graph for some solutions. For the time being, let's use a naive solution. |
Agreed. |
Description
Detects and fails on duplicate edges when adding to simple graphs (fixes #112). The solution comes from igraph where the successor vertex IDs are always sorted.
The performance for the original and proposed implementation is in https://hackmd.io/lVM6zI6VRIOq4-fzE8vuNw?both
If the performance is not satisfactory then I can try using hashmaps instead.
EDIT: also fixes compiler warnings