Graph data science
On this page
GDS runs algorithms against named, in-memory graph projections. Create the projection once, run analyses, then write selected results back. Use live graph algorithms or Cypher paths when a named projection is unnecessary.
Run an analysis
Run these statements in order in a disposable database, using Explorer or a driver that sends one statement at a time. This example creates its own data and avoids assuming numeric node IDs.
CREATE (a:WikiPerson {name:'Ada'})-[:WIKI_KNOWS {weight:1.0}]->(b:WikiPerson {name:'Bob'}),
(b)-[:WIKI_KNOWS {weight:1.0}]->(c:WikiPerson {name:'Cy'}),
(c)-[:WIKI_KNOWS {weight:1.0}]->(a);
CALL gds.graph.project('wikiPeople','WikiPerson',{
WIKI_KNOWS:{orientation:'UNDIRECTED',properties:['weight']}
});
CALL gds.leiden.stream('wikiPeople',{randomSeed:42})
YIELD nodeId,communityId
RETURN gds.util.asNode(nodeId).name AS name,communityId;
CALL gds.pageRank.write('wikiPeople',{writeProperty:'rank'});
MATCH (p:WikiPerson) RETURN p.name,p.rank ORDER BY p.rank DESC,p.name;
CALL gds.graph.drop('wikiPeople');
Dropping the projection releases its catalogue entry; the live nodes and written
rank properties remain. Projections disappear on reopen and do not track later
live changes. See projection lifecycle.
Choose an algorithm
| Task | Article |
|---|---|
| Create/filter projections or estimate their memory | Projections |
| Pick stream, stats, mutate or write | Algorithms and modes |
| Rank nodes or find communities | PageRank, Label Propagation and Leiden |
| Produce structural embeddings | FastRP |
| Compare neighbourhoods or projected property vectors | Node Similarity and KNN |
| Compare two vectors directly | Scalar similarities |
| Find weighted projected paths | Pathfinding |
| Set budgets, deadlines or workers | Resources and cancellation |
GDB implements a documented subset of the GDS API. Unsupported options raise errors. See compatibility.
Articles
- GDS algorithms and execution modes
- PageRank and community detection
- FastRP embeddings
- Live graph algorithms
- Projected pathfinding
- Graph projections and catalogue
- GDS resources and cancellation
- Pairwise similarity functions
- Node Similarity and KNN
Related articles
Graph projections and catalogue · GDS algorithms and execution modes · GDS resources and cancellation