How does neo4j browser pick the nodes to visualize?

When running a query to connect nodes and visualize them in neo4j browser, neo4j picks the nodes and edges automatically. I've ran the query several times and as it seems it returns the same network.

  • How does it make the decision?
  • Why does it pick the specific nodes to visualize?

Thanks.

Whichever nodes you return from a query will be visualized (up to the initial node display limit configured in the browser preferences).

If you have the "Connect result rows" option checked at the bottom of the browser preferences, then a second query will be issued under-the-hood to get all of the relationships between all of the nodes that were returned.

If that option is not checked, then only the relationships you return in the query (includes relationships present in returned paths) will be visualized along with the nodes.

You said "neo4j picks the nodes and edges automatically", so it sounds like you're referring to some other means of doing a query, probably one of the sample scripts. Can you give us more info on what you're doing, and the query generated?

Thank you for the reply.

I am working on the bitcoin transaction graph.

nodes: ~= 17.000.000
relationships ~= 36.000.000

I have connected source address to destination address via the following query:

MATCH (b:Address)-[:REDEEMED]->(ip:IncomingPayment)-[:INCOMING_PAYMENT]->(tx:Transaction)-[:SENT_COINS]->(:OutgoingPayment)-[:WAS_SENT_TO]->(c:Address)
CREATE (b)-[r:sent_money]->(c)
RETURN b, r, c
LIMIT 8000

Initial node display: 10000
Max neighbors: 10000
Max rows: 10000
connect result nodes is checked

The three values above were set randomly. I am not sure how I should go about it.

I ran the query setting LIMIT 1000, 3000, 5000, 8000... I never reach the limit, which I am trying to fix.

When I run the query with LIMIT 1000 let s say 3 times, the same structure will be returned. I guess neo4j performs graph sampling and returns a specific portion of the whole network?

If that's the case, how does the sampling work?

P.S. in case there are optimizations regarding this query that could be made, could you please point me to the right direction?

Could you include an image for this? I have been searching for a while but can't see this in the desktop app.

In that case I think you're looking in the wrong place. It's not in Desktop, it's in the Neo4j Browser, preferences, the checkbox at the bottom.

Also, there was a typo in my description, it's "Connect result nodes".