You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few days ago a user posted an issue describing calculation's from NetworkX not matching against Graphblas's implementation on SO. Thought i'd pass on the details along as another kind gent has described where he believes the issue may be and I'm unable to verify if they're on the right track.
Thanks for the report and sharing the issue on StackOverflow @davidsilveiro!
In the example above G is directed (as is required for in_degree_centrality), and GG is undirected. So, to fix the example, change GG = ga.Graph.from_networkx(G) to GG = ga.DiGraph.from_networkx(G):
I would also suggest considering using the networkx API for dispatching:
nx.in_degree_centrality(GG)
or
nx.in_degree_centrality(G, backend="graphblas")
The latter converts the input graph G to a graphblas graph. This conversion can be cached in NetworkX 3.3 via first setting a configuration:
nx.config.cache_converted_graphs=True
Finally, ga.in_degree_centrality should probably raise if the input is an undirected graph, so this is a valid bug report. Using ga.nxapi.in_degree_centrality(GG) raises as expected if GG is undirected. I think having functions appear in both ga and ga.nxapi namespaces may be a little unclear, and it would be better if instead we moved the networkx backend API to e.g. nx_graphblas.
A few days ago a user posted an issue describing calculation's from NetworkX not matching against Graphblas's implementation on SO. Thought i'd pass on the details along as another kind gent has described where he believes the issue may be and I'm unable to verify if they're on the right track.
Original post: https://stackoverflow.com/questions/78383991/why-does-graphblas-return-different-results-as-networkx/78402677#78402677
The text was updated successfully, but these errors were encountered: