cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 1: replicate users.

Get subgraph with limiting nodes amount

armensanoyan
Node Clone

Hi. In my project I have lot of nodes and when I use neo4j desktop or bloom they both show only part of nodes. My question is is there an algorithm or function in cypher to get 500 nodes from bigger graph ?
I know that I can use LIMIT 500 but I don't know if it's the best idea and how it choses which nodes to show. If LIMIT is not returning random nodes could you explain how it works (the algorithm behind it)?
I assume there should be an algorithm to display nodes based on centrality. Thank you in advance!

2 REPLIES 2

ljutoo
Node

You can adjust the limit of nodes displayed in both Bloom and Browser to display more. I'd do it in Bloom as it's better at displaying more nodes.

Re: how are which nodes displayed when LIMIT is used - it'll be whatever is already might be in cache

Hi Lju! Thank you for replay. Now I see why LIMIT is so fast.
What I want is to get subgraph (with limited nodes), which shows most important nodes and relationships in my graph. I don't want to adjust with bloom and browser, I want to do get the subgraph by cypher.
So far I used functions/algorithms for subgraph

  1. gds.alpha.degree.stream
  2. gds.pageRank.stream
  3. LIMIT