-
Notifications
You must be signed in to change notification settings - Fork 34
Dynamic & static Katz centrality implementation #117
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
Conversation
antepusic
left a comment
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.
Code looks solid! 👍
Quick comment - are the separate empty files in /algorithm_online necessary? The algorithm as implemented has both offline and online functionality.
cpp/mg_utility/mg_utils.hpp
Outdated
| std::vector<std::uint64_t> GetEdgeIDsFromList(mgp_list *list) { | ||
| auto size = mgp::list_size(list); | ||
| auto edge_ids = std::vector<std::uint64_t>(size); | ||
| for (std::size_t i = 0; i < size; i++) { | ||
| auto edge = mgp::value_get_edge(mgp::list_at(list, i)); | ||
| auto edge_id = mgp::edge_get_id(edge).as_int; | ||
| edge_ids[i] = edge_id; | ||
| } | ||
| return edge_ids; | ||
| } | ||
|
|
||
| std::vector<std::uint64_t> GetVerticesFromList(mgp_list *list) { | ||
| auto size = mgp::list_size(list); | ||
| auto vertices = std::vector<std::uint64_t>(size); | ||
| for (std::size_t i = 0; i < size; i++) { | ||
| vertices[i] = mgp::vertex_get_id(mgp::value_get_vertex(mgp::list_at(list, i))).as_int; | ||
| } | ||
| return vertices; | ||
| } |
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.
I've implemented the GetNodeIDs and GetEdgeEndpointIDs utilities before; these may be redundant.
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 was done before these methods, I should use them now 😄
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.
My bad. It was here before, just didn't see it. Tnx
README.md
Outdated
| | [graph_analyzer](python/graph_analyzer.py) | Python | This Graph Analyzer query module offers insights about the stored graph or a subgraph. | | ||
| | [graph_coloring](python/graph_coloring.py) | Python | An algorithm for assigning labels to the graph elements subject to certain constraints. In this form, it is a way of coloring the graph vertices such that no two adjacent vertices are of the same color. | | ||
| | [json_util](python/json_util.py) | Python | A module for loading JSON from a local file or remote address. | ||
| | [katz_centrality](cpp/katz_centrality_module/katz_centrality_module.cpp.py) | C++ | Katz centrality is the centrality measurement that outputs the influence based on the number of shortest paths and their weighted length. |
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.
| | [katz_centrality](cpp/katz_centrality_module/katz_centrality_module.cpp.py) | C++ | Katz centrality is the centrality measurement that outputs the influence based on the number of shortest paths and their weighted length. | |
| | [katz_centrality](cpp/katz_centrality_module/katz_centrality_module.cpp.py) | C++ | Katz centrality is a centrality measurement that outputs a node's influence based on the number of shortest paths and their weighted length. |
Description
Implementation of Katz centrality algorithm which calculates the centrality corresponding to the numbers of paths flowing through the node, and their importance based on the walk length. Both static and dynamic algorithms are approximations but have the property that saves the centrality rankings in the final result. The algorithm is based on: Scalable Katz Ranking Computation in Large Static and Dynamic Graphs.
Pull request type
######################################
Reviewer checklist (the reviewer checks this part)
Module/Algorithm
######################################