The Neo4j Graph Data Science (GDS) library is a Neo4j plugin for graph analysis. It provides more than 50 algorithms, including community detection, centrality, node embedding, and link prediction, for questions such as how connected a network is, which nodes are influential, and where tightly connected groups occur. section 5.2 section 5.1
GDS algorithms run on a projected in-memory graph rather than directly on the stored database graph. This separate, optimized structure supports scalable parallel execution and lets an analysis use only the nodes, relationships, and properties relevant to a question. section 5.2
Use this workflow diagram to follow the path from database data through an in-memory projection to graph-algorithm results. section 5.2
A typical GDS workflow is:
- Project a subgraph into memory and give it a graph name. section 5.2 section 5.2.1
- Run one or more algorithms against that named graph. section 5.2
- Choose how results are handled: stream records, return statistics, mutate the in-memory graph, or write results to the database. section 5.6
- Release the projected graph from memory when analysis is complete. section 5.6
Native projection selects data by node labels and relationship types and is the preferred high-performance option because it reads directly from Neo4j storage. Cypher projection can select or filter a more specific subgraph, but is slower and better suited to exploration. section 5.2
Project a follower network
Create a named in-memory graph from User nodes and FOLLOWS relationships with `CALL gds.graph.project('follower-network', 'User', 'FOLLOWS')`. The name identifies the projection for later algorithm calls; relationships are included only when both adjacent nodes are part of the node projection. section 5.2.1
For a follower network, GDS supports topology-focused analysis: connected-component algorithms identify disconnected parts, clustering measures describe local interconnectedness, and PageRank highlights nodes with influence over information flow. These outputs help characterize network structure before deeper investigation. section 5.3 section 5.6
