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
Weighted graph methods built for dynamic community detection #89
Conversation
cpp/mg_utility/mg_graph.hpp
Outdated
@@ -279,6 +333,9 @@ class Graph : public GraphView<TSize> { | |||
|
|||
std::vector<std::vector<TSize>> adj_list_; | |||
std::vector<std::vector<TNeighbour>> neighbours_; |
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.
Do neighbours_ contains both in and out neighbours or just out? If so make it explicit
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.
Due to the way neighbours_
is initialized, with directed graphs it only contains the out-neighbors.
Keeping in mind that in- and out-neighbors are identical for undirected graphs, I’m reluctant to rename the vector, but I’ll clarify this with a comment. Does this sound good to you?
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.
Yes, that sound ok for now. But I would definitely think about separating different versions of Graph, since now you have directed/undirected/weighted in the same class, and that causes undirected to have properties it doesn't use. What do you think about this @jmatak ?
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.
If we decide to separate them, undirected graphs would still have to implement certain interfaces because of generality. For example, if an algorithm requires the out-neighbors, we should be able to call OutNeighbours
without having to check whether the graph is directed. Of course, for undirected graphs, OutNeighbours
would just default to calling Neighbours
.
Does the above make sense? I believe we should definitely take it into account if it’s a valid suggestion.
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.
aha, so we are speaking in the context of algorithms running on both undirected and undirected graphs (sorry for the late response)?
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.
Right @jbajic!
Co-authored-by: Jure Bajic <jure.bajic94@gmail.com>
Co-authored-by: Jure Bajic <jure.bajic94@gmail.com>
Co-authored-by: Jure Bajic <jure.bajic94@gmail.com>
Weighted graph methods for MAGE’s dynamic community detection query module (#66), transcluded into separate PR for easier review per Matak’s suggestion.