neo4j-contrib / neo4j-graph-algorithms

Efficient Graph Algorithms for Neo4j
https://github.com/neo4j/graph-data-science/
GNU General Public License v3.0
767 stars 196 forks source link

How to get a connected subgraph which contains a certain set of nodes using neo4j? #917

Closed 1160300420 closed 4 years ago

1160300420 commented 4 years ago

I want to generate a connected subgraph from a big graph. And the subgraph contains a set of nodes which i have selected and the other nodes which make the subgraph connected. How can I do it by using neo4j?

AliciaFrame commented 4 years ago

You can use a Cypher query to select specific nodes and relationships, and export that data into a CSV or other format.

If you're trying to run graph algorithms on a subgraph, you can leverage the graph loaders to select the appropriate subgraph to run over - see https://neo4j.com/docs/graph-algorithms/current/projected-graph-model/