Closeness Procedure doesn't work for me


(Mehdi Ajroud) #1

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

but I am getting this error :

(Stefan Armbruster) #2

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.

(Mehdi Ajroud) #3

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

(Mark Needham) #4

For future you could also try out the algorithms from the Graph Algorithms library -

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