-
Notifications
You must be signed in to change notification settings - Fork 153
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 edge betweenness centrality #799
Conversation
Pull Request Test Coverage Report for Build 4374721255
💛 - Coveralls |
Thanks for the contribution! But I think including something like a "See also" like this would be useful. |
For example, computing the edge betweenness centrality for all edges in a 5x5 | ||
grid graph and using that to color the edges in a graph visualization: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, computing the edge betweenness centrality for all edges in a 5x5 | |
grid graph and using that to color the edges in a graph visualization: | |
For example, the following computes the edge betweenness centrality for all edges in a 5x5 | |
grid graph and uses the result to color the edges in a graph visualization: |
- | | ||
Added a new function to rustworkx-core ``edge_betweenness_centrality`` to | ||
the ``rustworkx_core:centrality`` module which computes the edge betweenness | ||
centrality of all edges in a given graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There are several lines above that consist only of whitespace. This should be removed (only a single newline for each such line.)
- There should be a newline at the end of the file.
- | | ||
Added a new function to rustworkx-core ``edge_betweenness_centrality`` to | ||
the ``rustworkx_core:centrality`` module which computes the edge betweenness | ||
centrality of all edges in a given graph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File needs a newline.
src/centrality.rs
Outdated
@@ -326,3 +326,119 @@ pub fn digraph_eigenvector_centrality( | |||
))), | |||
} | |||
} | |||
|
|||
/// Compute the edge betweenness centrality of all edges in a :class:`~PyGraph`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The edge and vertex centrality functions should be next to each other in this file, as they are more closely related to each other than to the eigenvector centrality... unless there is another good reason for the current order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, thanks for pushing this! (and sorrt for the delay in final review)
Related to #441
Added edge betweenness centrality to rustworkx and rustworkx-core. It is mostly based on betweenness centrality with some modifications.