apoc.algo.allSimplePaths

This procedure is not considered safe to run from multiple threads. It is therefore not supported by the parallel runtime (introduced in Neo4j 5.13). For more information, see the Cypher Manual → Parallel runtime.

Details

Syntax

apoc.algo.allSimplePaths(startNode, endNode, relTypesAndDirections, maxNodes) :: (path)

Description

Runs a search algorithm to find all of the simple paths between the given RELATIONSHIP values, up to a max depth described by maxNodes. The returned paths will not contain loops.

Input arguments

Name

Type

Description

startNode

NODE

The node to start the search from.

endNode

NODE

The node to end the search on.

relTypesAndDirections

STRING

The relationship types to restrict the algorithm to. Relationship types are represented using APOC’s rel-direction-pattern syntax; [<]RELATIONSHIP_TYPE1[>]|[<]RELATIONSHIP_TYPE2[>]|…​.

maxNodes

INTEGER

The max depth (in terms of nodes) the algorithm will explore.

Return arguments

Name

Type

Description

path

PATH

The path result.