neo4j-contrib / neo4j-graph-algorithms

Efficient Graph Algorithms for Neo4j
https://github.com/neo4j/graph-data-science/
GNU General Public License v3.0
769 stars 195 forks source link

Betweenness Centrality procedure returned different results for same data using different modes #881

Open Joshua-Yu opened 5 years ago

Joshua-Yu commented 5 years ago

The results of the below 2 queries should be the same as the only difference is the type, i.e. heavy and cypher:

1) CALL algo.betweenness.stream( '城市', '铁路连接|公路连接', {direction:'both'} ) YIELD nodeId, centrality RETURN algo.asNode(nodeId).name AS node, centrality ORDER BY centrality DESC

2) CALL algo.betweenness.stream( 'MATCH (n:城市) RETURN id(n) AS id', 'MATCH (n:城市) -[:铁路连接|公路连接]-> (n1) RETURN id(n) AS source, id(n1) AS target', {graph:'cypher',direction:'both'} ) YIELD nodeId, centrality RETURN algo.asNode(nodeId).name AS node, centrality ORDER BY centrality DESC

Both have returned 151 records but with quite different ordering and scores.

What did I miss?