-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Revisit ParallelGraph implementation and maybe add graph object as the attibute #4
Comments
There are a few options for this:
These mean different handling by the functions in nx-parallel. The first requires the function would extract the original graph via the attribute. The second would allow treating the input as the original graph (which it is). The second seems nicer for nx-parallel developers because you can just treat the input object as a graph. But some users might get confused by having one object. We could tell them to set or remove the I'm going to play a little with these two formulations -- and maybe something else will come up. Any thoughts about advantages or disadvantages? G = nx.path_graph(4000)
nx_result = nx.betweenness_centrality(G)
G.__networkx_plugins__ = "parallel" # or G = nx_parallel.parallelize(G)
parallel_result = nx.betweenness_centrality(G) |
Looks like the second approach doesn't play nicely with calling networkx functions directly (we already knew that from Kasvish's experience, but I had "recovered my innocense" about that issue -- so re-learned it today. If we call the parallel version of It seems that either gluing a mixin class to the original input graph or manually setting That's what this PR originally suggested and I'm re-learning why that is a good approach. |
Done in #9 |
instead of subclassing Graph.
The text was updated successfully, but these errors were encountered: