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

Expose graph_view method to count multi edges through C API and PLC #4426

Merged

Conversation

ChuckHastings
Copy link
Collaborator

@ChuckHastings ChuckHastings commented May 16, 2024

Python property graph class does some expensive dask calls to determine if a graph is a multi-graph.

This PR exposes to the C API and the PLC layer the graph_view method that counts the number of multi-edges in the graph. Specifically, the function returns the number of extra edges exist. So if the edge (u,v) exists k times, that edge contributes k-1 to the return value.

If the return value of this function is greater than 0 then the graph is a multi-graph. If the return value is 0 then while the graph might be labeled a multi-graph, there are no multi-edges so it could be treated as a graph.

Closes #2417

Note that the property graph python code would still need to be modified to use this function.

@ChuckHastings ChuckHastings self-assigned this May 16, 2024
@ChuckHastings ChuckHastings added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 16, 2024
@ChuckHastings ChuckHastings marked this pull request as ready for review May 16, 2024 21:47
@ChuckHastings ChuckHastings requested review from a team as code owners May 16, 2024 21:47
Copy link
Member

@alexbarghi-nv alexbarghi-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alexbarghi-nv
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit 78b380e into rapidsai:branch-24.06 May 17, 2024
131 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cuGraph improvement Improvement / enhancement to an existing function non-breaking Non-breaking change python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Expose count_multi_edges for cuGraph C++ graph_view_t to python
4 participants