cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Closeness Procedure doesn't work for me

Hey everyoe ,

I am using this query to show closeness :

MATCH (a:Attrib)
WITH collect(a) AS Attributaires
CALL apoc.algo.closeness(['SIMILARITY'],Attributaires,'BOTH') YIELD a , score
RETURN a, score
ORDER BY score DESC

but I am getting this error :

1 ACCEPTED SOLUTION

For future you could also try out the algorithms from the Graph Algorithms library - https://neo4j.com/docs/graph-algorithms/current/algorithms/closeness-centrality/

This can be added as a plugin (similar to APOC) and has parallel versions of a bunch of different algorithms.

View solution in original post

3 REPLIES 3

you need to use YIELD node, score - and not a here. The identifiers you can use in YIELD are predefined by the procedure. See APOC manual for this.

yes it works when I change "a" with "node" ! thanks Stefan 🙂

For future you could also try out the algorithms from the Graph Algorithms library - https://neo4j.com/docs/graph-algorithms/current/algorithms/closeness-centrality/

This can be added as a plugin (similar to APOC) and has parallel versions of a bunch of different algorithms.