Creating graphs

This section discusses creating named and anonymous graphs to be used for algorithm computation in the Neo4j Graph Data Science library.

In order for any algorithm in the GDS library to run, we must first create a graph to run on. The graph is created as either an anonymous graph or a named graph. An anonymous graph is created for just a single algorithm and will be lost after its execution has finished. A named graph is given a name and stored in the graph catalog. For a detailed guide on all graph catalog operations, see Graph Catalog.

Creating a named graph has several advantages:

  • it can be used by multiple algorithms

  • the creation is cleanly separated from the algorithm execution

  • the algorithm runtime can be measured in isolation

  • the configuration for creating the graph may be retrieved from the graph catalog

Using an anonymous graph has the advantage that a single query may be used for an entire algorithm computation. This can be especially useful in the development phase when the workflow is being set up and the graph projections are experimented with.