liveBook · Manning

Mutate execution mode

As explained in Graph Algorithms for Data Science

Mutate execution mode is a graph-algorithm execution mode that stores computed results in the projected in-memory graph.

Mutate is a Graph Data Science execution mode that writes an algorithm’s results into a projected in-memory graph. It requires a named graph in the graph catalog and is useful when a later algorithm should consume those results. section 5.2

Choose mutate when analysis needs to continue inside the same projected graph:

  • Use stream to return records without storing results. section 5.2
  • Use stats to return summary statistics without storing results. section 5.2
  • Use mutate to add algorithm results to the projected in-memory graph. section 5.2
  • Use write to store algorithm results in the Neo4j database graph. section 5.2

Adding betweenness centrality

After projecting the follower network and its existing node features, run `CALL gds.betweenness.mutate('knnExample', {mutateProperty:'betweenness'})`. The computed betweenness values become a node property in the projected graph and can support subsequent analysis. section 8.1.2

Building a similarity network

Run `gds.knn.mutate` with `mutateRelationshipType:'SIMILAR'`, `mutateProperty:'score'`, and `topK:65` to add qualifying similarity relationships and scores to the projected graph before community detection. section 8.2.2

Figure 5.8 Graph Data Science library workflow
05-08

Use the Graph Data Science workflow to see where projection, algorithm execution, mutation, and later analysis fit together. section 5.2

How Graph Algorithms for Data Science covers it

How deep it goes
Defines storage behavior, named-graph requirements, and chained use cases, but does not detail mutation internals.
Examples
Demonstrates mutating betweenness scores and similarity relationships in a follower-network graph.
What it assumes
Assumes a projected named in-memory graph and explains execution modes from their storage behavior.
What you can do after
Apply it via Neo4j Graph Data Science to pass algorithm outputs into later graph algorithms.
How it connects
Connects projected in-memory graphs with stream, stats, write, betweenness centrality, k-nearest neighbors, and community detection.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.