Running betweenness centrality algorithm

Hello,

I have a co-authorship network on alias nodes

which have many components (see attached). There are other nodes and edges in the graph. The number of alias nodes is 100000.

My attempt to find betweenness scores for the nodes returned 0 for all nodes.

CALL algo.betweenness.stream('alias','co_authors',{direction:'BOTH'})
YIELD nodeId, centrality
WITH algo.asNode(nodeId) AS node, centrality
SET node.betweenness_coauthors = centrality

When I attempted to use graph projections, I get a null pointer exception:

CALL algo.betweenness.stream('MATCH (n:alias) RETURN id(n) AS id',
  'MATCH (n)-[:co_authors]-(m:alias) RETURN id(n) AS source, id(m) AS target',{graph:'cypher', direction:'BOTH'})
YIELD nodeId, centrality

Neo.ClientError.Procedure.ProcedureCallFailed

Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure algo.betweenness.stream: Caused by: java.lang.NullPointerException

What went wrong?

There's no need to use set -- just use the write mode of betweenness:

CALL algo.betweenness('alias','co_authors',{direction:'BOTH', write:true, writeProperty:'betweenness_coauthors'})

Please check out our documentation page for betweenness centrality; we have lots of examples that you can work off of: Betweenness Centrality - Neo4j Graph Data Science

Hi @alicia.frame,

Kindly refer to my post - I did attempt computing betweenness centrality using

CALL algo.betweenness.stream('alias','co_authors',{direction:'BOTH'})
YIELD nodeId, centrality
RETURN max(centrality)

resulted an answer of 0 (please see attached screenshot) - I find it hard to believe given that the graph has some edges and therefore not all nodes are isolated (please see attached screenshot). How do I troubleshoot this?

Thanks a lot.