Overview
Projecting a Graph for GDS
GDS runs on an in-memory projection — pick the nodes, edges, properties you actually need.
Why it matters
Projections turn a Neo4j graph into a memory-resident structure suited to PageRank, Louvain, BFS — smaller is faster.
Going deeper
GDS algorithms run on an in-memory projection, not the stored graph, because the disk graph is optimized for transactional traversal, while algorithms need a compact array-based structure:
CALL gds.graph.project(
'rankGraph',
'Page',
{LINKS: {orientation: 'NATURAL'}}
);
CALL gds.pageRank.write('rankGraph', {writeProperty:'rank'});
Three projection decisions control cost and correctness:
- Scope — project only the labels/relationship types the algorithm needs; smaller graph, less memory, faster run.
- Orientation —
NATURAL,REVERSE, orUNDIRECTEDchanges the meaning of the result (PageRank on reversed edges answers a different question). - Properties — only project the relationship weights/node properties the algorithm actually consumes.
Budget the memory with gds.graph.project.estimate before projecting a huge graph; an over-broad projection is the most common GDS out-of-memory cause.
