# Graph data science

[Wiki](../README.md)

**On this page**

- [Run an analysis](#run-an-analysis)
- [Choose an algorithm](#choose-an-algorithm)
- [Articles](#articles)

GDS runs algorithms against named, in-memory graph projections. Create the
projection once, run analyses, then write selected results back. Use
[live graph algorithms](live-graph.md) or [Cypher paths](../cypher/paths.md)
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.

```cypher
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](projections.md#graph-catalogue).

## Choose an algorithm

| Task | Article |
|---|---|
| Create/filter projections or estimate their memory | [Projections](projections.md) |
| Pick stream, stats, mutate or write | [Algorithms and modes](algorithms.md) |
| Rank nodes or find communities | [PageRank, Label Propagation and Leiden](communities.md) |
| Produce structural embeddings | [FastRP](fastrp.md) |
| Compare neighbourhoods or projected property vectors | [Node Similarity and KNN](similarity.md) |
| Compare two vectors directly | [Scalar similarities](similarity-functions.md) |
| Find weighted projected paths (Dijkstra, A*, Yen, Hourglass) | [Pathfinding](pathfinding.md) |
| Schedule tasks on people, rooms and machines | [Native Scheduler](scheduling.md) |
| Copy a complete scheduling example | [Scheduling recipes](scheduling-recipes.md) |
| Set budgets, deadlines or workers | [Resources and cancellation](resources.md) |

GDB implements a documented subset of the GDS API. Unsupported options raise
errors. See [compatibility](../reference/compatibility.md#graph-data-science-and-apoc).

## Articles

- [GDS algorithms and execution modes](algorithms.md)
- [PageRank and community detection](communities.md)
- [FastRP embeddings](fastrp.md)
- [Live graph algorithms](live-graph.md)
- [Projected pathfinding](pathfinding.md)
- [Graph projections and catalogue](projections.md)
- [Native Scheduler](scheduling.md)
- [Scheduling recipes](scheduling-recipes.md)
- [GDS resources and cancellation](resources.md)
- [Pairwise similarity functions](similarity-functions.md)
- [Node Similarity and KNN](similarity.md)

## Related articles

[Graph projections and catalogue](projections.md) · [GDS algorithms and execution modes](algorithms.md) · [GDS resources and cancellation](resources.md)
