5.1. Syntax overview

This section describes the general syntax for running algorithms in the Neo4j Graph Data Science library, including execution modes and common configuration parameters.

The general algorithm syntax comes in two variants:

Each syntax variant additionally provides different execution modes. These are the supported execution modes:

Finally, an execution mode may be estimated by appending the command with estimate.

Only the production-quality tier guarantees availability of all execution modes and estimation procedures.

Including all of the above mentioned elements leads to the following syntax outlines:

Syntax composition for the named graph variant: 

CALL gds[.<tier>].<algorithm>.<execution-mode>[.<estimate>](
  graphName: String,
  configuration: Map

Syntax composition for the anonymous graph variant: 

CALL gds[.<tier>].<algorithm>.<execution-mode>[.<estimate>](
  configuration: Map

The detailed sections in this chapter include concrete syntax overviews and examples.

5.1.1. Configuration parameters

All algorithms allow adjustment of their runtime characteristics through a set of configuration parameters. Although some of the parameters are algorithm-specific, many are shared between algorithms and execution modes.

To learn more about algorithm specific parameters and to find out if an algorithm supports a certain parameter, please consult the algorithm-specific documentation page.

List of the most commonly accepted configuration parameters
concurrency - Integer
Controls the parallelism with which the algorithm is executed. By default this value is set to 4. For more details on the concurrency settings and limitations please see Section 2.5.2, “CPU” of the System Requirements.
relationshipTypes - String[]
If the graph, on which the algorithm is run, was created with multiple relationship type projections, this parameter can be used to select only a subset of the projected types. The algorithm will then only consider relationships with the selected types.
nodeWeightProperty - String
In algorithms that support node weights this parameter defines the node property that contains the weights.
relationshipWeightProperty - String
In algorithms that support relationship weights this parameter defines the relationship property that contains the weights.
maxIterations - Integer
For iterative algorithms this parameter controls the maximum number of iterations.
tolerance - Float
Many iterative algorithms accept the tolerance parameter. It controls the minimum delta between two iterations. If the delta is less than the tolerance value, the algorithm is considered converged and stops.
seedProperty - String
Some algorithms can be calculated incrementally. This means that results from a previous execution can be taken into account, even though the graph has changed. The seedProperty parameter defines the node property that contains the seed value. Seeding can speed up computation and write times.
writeProperty - String
In write mode this parameter sets the name of the node or relationship property to which results are written. If the property already exists, existing values will be overwritten.
writeConcurrency - Integer
In write mode this parameter controls the parallelism of write operations. The Default is concurrency