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.

How to run PageRank of community using weighted PageRank and Louvain algorithm?

I need to set weights as property and calculate PageRank by community without NEuler.

1 REPLY 1

Check out the documentation for PageRank and Louvain. If you've already assigned community IDs, using NEuler, you can use a cypher projection to execute PageRank only on a specific community. You can set the weight property using the weightProperty parameter.

For example, borrowing from the docs page and assuming you've already run Louvain and written your communities to a communityId property, you could do something like this:

CALL algo.pageRank(
  'MATCH (p:Page) WHERE p.communityId=1 RETURN id(p) as id',
  'MATCH (p1:Page)-[r:LINKS]->(p2:Page) WHERE p1.communityId=1 AND p2.communityId=1 RETURN id(p1) as source, id(p2) as target, r.weight as weight',
  {graph:'cypher', weightProperty:'weight', write: true}
)