RedisGraph - ranking or pagerank timeout

Hello Redisfolks,
For the demo, I am trying to find the most connected nodes or most ranked nodes, but both ways timeout:

  1. Order by
GRAPH.QUERY cord19medical  "MATCH (e:entity)-[:related]->(t:entity) RETURN e.id,e.name, t.id, t.name ORDER BY e.rank LIMIT 5"
  1. pagerank
GRAPH.QUERY cord19medical: CALL algo.pageRank('entity','related')

Nodes are simple Node label=entity, id, name, rank
cord19medical: MATCH (e:entity)-[:related]->(t:entity) RETURN e.id,e.name, t.id, t.name LIMIT 5

e.id e.name t.id t.name
C2139136 laser_suite_retina_treatment_consisted_of C5188658 computerized_adaptive_testing_depression_inventory_CAT_DI_

the number of nodes:
entity_count
11450886

Single instance Redis from https://github.com/RedisLabs/redismod

What is your timeout?
How would you define most connected nodes? is that the node with the maximum number of incoming and outgoing edges?

Are you looking for the nodes with the most relationships? If so, that’s the degree of the node. You can access the degree of any node with the indegree and outdegree functions. Here’s a quick example I whipped up that I think is what you are trying to do:

MATCH
  (n)
RETURN
  id(n),
  indegree(n) + outdegree(n) AS degree
ORDER BY
  degree DESC
LIMIT 5

Let me know if this works for ya!

1 Like

Thank you for your answers. Indegree and outdegree at least completed successfully.
I thought this was the whole point of PageRank algorithm, in Neo4j I would do:

CALL algo.pageRank.stream('%s', 'related', {iterations:20, dampingFactor:0.85})
YIELD nodeId, score
RETURN algo.asNode(nodeId).ename AS page, score
ORDER BY score DESC