Adding degree centrality function - #1145
Adding degree centrality function#1145Karthikeyan Muthu (TheMLEngineer) wants to merge 1 commit into
Conversation
|
|
1 similar comment
|
|
Ivan Carvalho (IvanIsCoding)
left a comment
There was a problem hiding this comment.
This still needs quite a bit of work. You can start by writing the tests at https://github.com/Qiskit/rustworkx/blob/main/tests/graph/test_centrality.py, the current tests pass because you never called the function you added
| /// | ||
| /// Returns: | ||
| /// A `Vec<f64>` containing the degree centrality of each node in the graph. | ||
| pub fn degree_centrality<G>(graph: G) -> Result<Option<Vec<f64>>, E> |
There was a problem hiding this comment.
This does not compile because you never defined E
| graph: &digraph::PyDiGraph, | ||
| ) -> PyResult<CentralityMapping> { | ||
| // Convert Python object to Rust type | ||
| let graph_rust = match graph.extract::<SomeRustGraphType>() { |
There was a problem hiding this comment.
This also will not compile
|
Hi Ivan Carvalho (@IvanIsCoding) , Thanks for the review comments , will check and update |
|
Hello, any news about this feature ? |
|
Paul Cibier (@Paulo-21) this Pull Request currently does not build. However, contributions are welcome and I believe #1129 would be fairly straightforward if you want to send a PR implementing it |
Test :

As this is my first pull request on this repo , if any more testing need to be done please let me know. Thanks.