Search code examples
neo4jgraph-theoryconnected-components

Connected Component on Neo4j


I want to understand how Neo4j's Connected component function unionFind works ? in the documentation i found that it returns : unionFind 's return so i am asking what are this two integer ?


Solution

  • The nodeId is the native node ID assigned by the DB to each node. You can gat a node's native ID via the Cypher function ID().

    The setId is a connected subgraph's "Partition ID". All the nodes in the same connected subgraph will share the same Partition ID.