iflow-mcp_neo4j-contrib-gds-agent
v0.5.1Neo4j GDS MCP Server
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
count_nodes
Count the number of nodes in the graph
get_node_properties_keys
Get all node properties keys in the database
get_relationship_properties_keys
Get all relationship properties keys in the database
get_node_labels
Get all node labels in the database
get_relationship_types
Get relationship types in the database.
article_rank
Calculate ArticleRank for nodes in the graph. ArticleRank is similar to PageRank but normalizes by the number of outgoing references.
| Parameter | Type | Description |
|---|---|---|
dampingFactor | number | The damping factor of the ArticleRank calculation. Must be in [0, 1). |
maxIterations | integer | Maximum number of iterations for ArticleRank |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run the article rank on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node to filter return the ArticleRank for. |
relTypes | array | The relationships types used to project and run article rank on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Property of the relationship to use for weighting. If not specified, all relationships are treated equally. |
scaler | string | The name of the scaler applied for the final scores. Supported values are None, MinMax, Max, Mean, Log, and StdScore. To apply scaler-specific configuration, use the Map syntax: {scaler: 'name', ...}. |
sourceNodes | array | The nodes to use for computing Personalized Article Rank. |
tolerance | number | Minimum change in scores between iterations. |
articulation_points
Find all the articulation points. Given a graph, an articulation point is a node whose removal increases the number of connected components in the graph.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Articulation points on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Articulation Points on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
betweenness_centrality
Calculate betweenness centrality for nodes in the graph. Betweenness centrality is a measure of the number of times a node acts as a bridge along the shortest path between two other nodes.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Betweenness Centrality on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter betweenness centrality results for. |
relTypes | array | The relationships types used to project and run Betweenness Centrality on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Property of the relationship to use for weighting. If not specified, all relationships are treated equally. |
samplingSize | integer | The number of source nodes to consider for computing centrality scores. |
bridges
Find all the bridges in the graph. A bridge is an edge whose removal increases the number of connected components in the graph.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Bridges on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Bridges on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
CELF
Calculate the Cost-Effective Lazy Forward (CELF) algorithm for influence maximization in the graph. For a given k, the algorithm finds the set of k nodes that maximize the expected spread of influence in the network.
| Parameter | Type | Description |
|---|---|---|
seedSetSize * | integer | The number of nodes that maximize the expected spread in the network. |
monteCarloSimulations | integer | The number of Monte Carlo simulations to run for estimating the expected spread. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run CELF on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
propagationProbability | number | The probability of propagating influence from a node to its neighbors. |
relTypes | array | The relationships types used to project and run CELF on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
closeness_centrality
Calculate closeness centrality for all nodes in the graph. The closeness centrality of a node measures its average farness (inverse distance) to all other nodes. Nodes with a high closeness score have the shortest distances to all other nodes.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run closeness centrality on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter closeness centrality results for. |
relTypes | array | The relationships types used to project and run closeness centrality on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
useWassermanFaust | boolean | If true, uses the Wasserman-Faust formula for closeness centrality. |
degree_centrality
Calculate degree centrality for all nodes in the graph
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Degree Centrality on. This is used to filter the graph to run the algorithm on. Nodes with other node labels will be hidden and ignored. Include all node labels… |
nodes | array | List of node names to filter degree centrality results for. |
orientation | string | The orientation used to compute node degrees. Supported orientations are NATURAL (for out-degree), REVERSE (for in-degree) and UNDIRECTED (for both in-degree and out-degree) |
relTypes | array | The relationships types used to project and run Degree Centrality on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Property of the relationship to use for weighting. If not specified, all relationships are treated equally. |
eigenvector_centrality
Calculate eigenvector centrality for all nodes in the graph. Eigenvector Centrality is an algorithm that measures the transitive influence of nodes. Relationships originating from high-scoring nodes contribute more to the score of a node than connections from low-scoring nodes. A high eigenvector score means that a node is connected to many nodes who themselves have high scores. The algorithm computes the eigenvector associated with the largest absolute eigenvalue. To compute that eigenvalue, the algorithm applies the power iteration approach. Within each iteration…
| Parameter | Type | Description |
|---|---|---|
maxIterations | integer | Maximum number of iterations for Eigenvector Centrality |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run eigenvector centrality on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter eigenvector centrality results for. |
relTypes | array | The relationships types used to project and run eigenvector centrality on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Property of the relationship to use for weighting. If not specified, all relationships are treated equally. |
scaler | string | The name of the scaler applied for the final scores. Supported values are None, MinMax, Max, Mean, Log, and StdScore. To apply scaler-specific configuration, use the Map syntax: {scaler: 'name', ...}. |
sourceNodes | array | The nodes to use for computing Personalized Eigenvector Centrality. |
tolerance | number | Minimum change in scores between iterations. If all scores change less than the tolerance value the result is considered stable and the algorithm returns. |
pagerank
Calculate PageRank for all nodes in the graph
| Parameter | Type | Description |
|---|---|---|
dampingFactor | number | The damping factor of the Page Rank calculation. Must be in [0, 1). |
maxIterations | integer | Maximum number of iterations for PageRank |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run PageRank on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter PageRank results for. |
relTypes | array | The relationships types used to project and run PageRank on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
sourceNodes | array | The nodes to use for computing Personalized PageRank. |
tolerance | number | Minimum change in scores between iterations. If all scores change less than the tolerance value the result is considered stable and the algorithm returns. |
harmonic_centrality
Calculate harmonic centrality for all nodes in the graph. Harmonic centrality is a variant of closeness centrality that is more robust to disconnected graphs.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run harmonic centrality on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter harmonic centrality results for. |
relTypes | array | The relationships types used to project and run harmonic centrality on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
HITS
Calculate HITS (Hyperlink-Induced Topic Search) scores for nodes in the graph. The Hyperlink-Induced Topic Search (HITS) is a link analysis algorithm that rates nodes based on two scores, a hub score and an authority score. The authority score estimates the importance of the node within the network. The hub score estimates the value of its relationships to other nodes.
| Parameter | Type | Description |
|---|---|---|
authProperty | string | The name of the auth property to use. |
hitsIterations | integer | The number of hits iterations to run. The number of pregel iterations will be equal to hitsIterations * 4. |
hubProperty | string | The name of the hub property to use. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run hits on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | List of node names to filter HITS results for. |
partitioning | string | The partitioning scheme used to divide the work between threads. Available options are AUTO, RANGE, DEGREE. |
relTypes | array | The relationships types used to project and run hits on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
conductance
Calculate the conductance metric for all communities
| Parameter | Type | Description |
|---|---|---|
communityProperty * | string | The node property that holds the community ID as an integer for each node. Note that only non-negative community IDs are considered valid and will have their conductance computed. |
nodeLabels | array | The node labels used to project and run conductance on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run conductance on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | The relationship property that holds the weight of the relationships. If not provided, all relationships are considered to have a weight of 1. |
HDBSCAN
Perform HDBSCAN clustering on the graph. HDBSCAN, which stands for Hierarchical Density-Based Spatial Clustering of Applications with Noise, is a clustering algorithm used to identify clusters of similar data points within a dataset. It builds upon the DBSCAN algorithm but adds a hierarchical structure, making it more robust to varying densities within the data. Unlike DBSCAN, HDBSCAN does not require tuning a specific density parameter; instead, it runs DBSCAN over a range of parameters, creating a hierarchy of clusters. This hierarchical approach allows HDBSCAN to find clusters of varying de…
| Parameter | Type | Description |
|---|---|---|
nodeProperty * | string | A node property corresponding to an array of floats used by HDBSCAN to compute clusters |
leafSize | integer | The number of leaf nodes of the supporting tree data structure. |
minClusterSize | integer | The minimum number of nodes that a cluster should contain. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run HDBSCAN on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
samples | integer | The number of neighbours to be considered when computing the core distances of a node. |
k_core_decomposition
The K-core decomposition constitutes a process of separates the nodes in a graph into groups based on the degree sequence and topology of the graph. The term i-core refers to a maximal subgraph of the original graph such that each node in this subgraph has degree at least i. The maximality ensures that it is not possible to find another subgraph with more nodes where this degree property holds. The nodes in the subgraph denoted by i-core also belong to the subgraph denoted by j-core for any j<i. The converse however is not true. Each node u is associated with a core value which denotes the la…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run K Core decomposition on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run K Core decomposition on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
k_1_coloring
The K-1 Coloring algorithm assigns a color to every node in the graph, trying to optimize for two objectives: 1. To make sure that every neighbor of a given node has a different color than the node itself. 2. To use as few colors as possible. Note that the graph coloring problem is proven to be NP-complete, which makes it intractable on anything but trivial graph sizes. For that reason the implemented algorithm is a greedy algorithm. Thus it is neither guaranteed that the result is an optimal solution, using as few colors as theoretically possible, nor does it always produce a correct result w…
| Parameter | Type | Description |
|---|---|---|
maxIterations | integer | The maximum number of iterations to run the coloring algorithm. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run K-1 Coloring on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run K-1 Coloring on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
k_means_clustering
K-Means clustering is an unsupervised learning algorithm that is used to solve clustering problems. It follows a simple procedure of classifying a given data set into a number of clusters, defined by the parameter k. The Neo4j GDS Library conducts clustering based on node properties, with a float array node property being passed as input via the nodeProperty parameter. Nodes in the graph are then positioned as points in a d-dimensional space (where d is the length of the array property). The algorithm then begins by selecting k initial cluster centroids, which are d-dimensional arrays (see sec…
| Parameter | Type | Description |
|---|---|---|
nodeProperty * | string | A node property corresponding to an array of floats used by K-Means to cluster nodes into communities. |
computeSilhouette | boolean | If set to true, the silhouette scores are computed once the clustering has been determined. Silhouette is a metric on how well the nodes have been clustered. |
deltaThreshold | number | Value as a percentage to determine when to stop early. If fewer than 'deltaThreshold * |nodes|' nodes change their cluster , the algorithm stops. Value must be between 0 (exclusive) and 1 (inclusive). |
initialSampler | string | The method used to sample the first k centroids. 'uniform' and 'kmeans++', both case-insensitive, are valid inputs. |
k | integer | The number of clusters to create. |
maxIterations | integer | The maximum number of iterations the algorithm will run. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run K-Means on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
numberOfRestarts | integer | Number of times to execute K-Means with different initial centers. The communities returned are those minimizing the average node-center distances. |
seedCentroids | array | Parameter to explicitly give the initial centroids. It cannot be enabled together with a non-default value of the numberOfRestarts parameter. |
label_propagation
The Label Propagation algorithm (LPA) is a fast algorithm for finding communities in a graph. It detects these communities using network structure alone as its guide, and doesn't require a pre-defined objective function or prior information about the communities. LPA works by propagating labels throughout the network and forming communities based on this process of label propagation.
| Parameter | Type | Description |
|---|---|---|
consecutiveIds | boolean | Flag to decide whether component identifiers are mapped into a consecutive id space (requires additional memory). |
maxIterations | integer | The maximum number of iterations to run. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Label Propagation on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodeWeightProperty | string | The name of a node property that contains node weights. |
relTypes | array | The relationships types used to project and run Label Propagation on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
seedProperty | string | The name of a node property that defines an initial numeric label. |
leiden
The Leiden algorithm is an algorithm for detecting communities in large networks. The algorithm separates nodes into disjoint communities so as to maximize a modularity score for each community. Modularity quantifies the quality of an assignment of nodes to communities, that is how densely connected nodes in a community are, compared to how connected they would be in a random network. The Leiden algorithm is a hierarchical clustering algorithm, that recursively merges communities into single nodes by greedily optimizing the modularity and the process repeats in the condensed graph. It modifies…
| Parameter | Type | Description |
|---|---|---|
gamma | number | Resolution parameter used when computing the modularity. Internally the value is divided by the number of relationships for an unweighted graph, or the sum of weights of all relationships otherwise. |
includeIntermediateCommunities | boolean | Indicates whether to write intermediate communities. If set to false, only the final community is persisted. |
maxLevels | integer | The maximum number of levels in which the graph is clustered and then condensed. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Leiden on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Leiden on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
seedProperty | string | Used to set the initial community for a node. The property value needs to be a non-negative number. |
theta | number | Controls the randomness while breaking a community into smaller ones. |
tolerance | number | Minimum change in modularity between iterations. If the modularity changes less than the tolerance value, the result is considered stable and the algorithm returns. |
local_clustering_coefficient
The Local Clustering Coefficient algorithm computes the local clustering coefficient for each node in the graph. The local clustering coefficient Cn of a node n describes the likelihood that the neighbours of n are also connected. To compute Cn we use the number of triangles a node is a part of Tn, and the degree of the node dn. The formula to compute the local clustering coefficient is as follows: Cn = 2 * Tn / (dn * (dn - 1))As we can see the triangle count is required to compute the local clustering coefficient. To do this the Triangle Count algorithm is utilised. Additionally, the algorith…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Local Clustering Coefficient on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | Optional list of node names to filter results. Only nodes whose names (based on nodeIdentifierProperty) contain any of these values will be included in the results. Requires nodeIdentifierProperty to… |
relTypes | array | The relationships types used to project and run Local Clustering Coefficient on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
triangleCountProperty | string | Node property that contains pre-computed triangle count. |
louvain
The Louvain method is an algorithm to detect communities in large networks. It maximizes a modularity score for each community, where the modularity quantifies the quality of an assignment of nodes to communities. This means evaluating how much more densely connected the nodes within a community are, compared to how connected they would be in a random network. The Louvain algorithm is a hierarchical clustering algorithm, that recursively merges communities into a single node and executes the modularity clustering on the condensed graphs.
| Parameter | Type | Description |
|---|---|---|
consecutiveIds | boolean | Flag to decide whether component identifiers are mapped into a consecutive id space (requires additional memory). Cannot be used in combination with the includeIntermediateCommunities flag. |
includeIntermediateCommunities | boolean | Indicates whether to write intermediate communities. If set to false, only the final community is persisted. |
maxIterations | integer | The maximum number of iterations that the modularity optimization will run for each level. |
maxLevels | integer | The maximum number of levels in which the graph is clustered and then condensed. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Louvain on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Louvain on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
seedProperty | string | Used to set the initial community for a node. The property value needs to be a non-negative number. |
tolerance | number | Minimum change in modularity between iterations. If the modularity changes less than the tolerance value, the result is considered stable and the algorithm returns. |
modularity_metric
Modularity is a metric that allows you to evaluate the quality of a community detection. Relationships of nodes in a community C connect to nodes either within C or outside C. Graphs with high modularity have dense connections between the nodes within communities but sparse connections between nodes in different communities.
| Parameter | Type | Description |
|---|---|---|
communityProperty * | string | The node property that holds the community ID as an integer for each node. Note that only non-negative community IDs are considered valid and will have their modularity score computed. |
nodeLabels | array | The node labels used to project and run Modularity on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Modularity on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
modularity_optimization
The Modularity Optimization algorithm tries to detect communities in the graph based on their modularity. Modularity is a measure of the structure of a graph, measuring the density of connections within a module or community. Graphs with a high modularity score will have many connections within a community but only few pointing outwards to other communities. The algorithm will explore for every node if its modularity score might increase if it changes its community to one of its neighboring nodes.
| Parameter | Type | Description |
|---|---|---|
consecutiveIds | boolean | Flag to decide whether component identifiers are mapped into a consecutive id space (requires additional memory). |
maxIterations | integer | The maximum number of iterations to run. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run modularity optimization on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run modularity optimization on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
seedProperty | string | Used to define initial set of labels. |
tolerance | number | Minimum change in modularity between iterations. If the modularity changes less than the tolerance value, the result is considered stable and the algorithm returns. |
strongly_connected_components
The Strongly Connected Components (SCC) algorithm finds maximal sets of connected nodes in a directed graph. A set is considered a strongly connected component if there is a directed path between each pair of nodes within the set. It is often used early in a graph analysis process to help us get an idea of how our graph is structured.
| Parameter | Type | Description |
|---|---|---|
consecutiveIds | boolean | Flag to decide whether component identifiers are mapped into a consecutive id space (requires additional memory). |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run SCC on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run SCC on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
triangle_count
The Triangle Count algorithm counts the number of triangles for each node in the graph. A triangle is a set of three nodes where each node has a relationship to the other two. In graph theory terminology, this is sometimes referred to as a 3-clique. The Triangle Count algorithm in the GDS library only finds triangles in undirected graphs. Triangle counting has gained popularity in social network analysis, where it is used to detect communities and measure the cohesiveness of those communities. It can also be used to determine the stability of a graph, and is often used as part of the computati…
| Parameter | Type | Description |
|---|---|---|
maxDegree | integer | If a node has a degree higher than this it will not be considered by the algorithm. The triangle count for these nodes will be -1. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Triangle Count on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
nodes | array | Optional list of node names to filter results. Only nodes whose names (based on nodeIdentifierProperty) contain any of these values will be included in the results. Requires nodeIdentifierProperty to… |
relTypes | array | The relationships types used to project and run Triangle Count on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
weakly_connected_components
The Weakly Connected Components (WCC) algorithm finds sets of connected nodes in directed and undirected graphs. Two nodes are connected, if there exists a path between them. The set of all nodes that are connected with each other form a component. In contrast to Strongly Connected Components (SCC), the direction of relationships on the path between two nodes is not considered. For example, in a directed graph (a)→(b), a and b will be in the same component, even if there is no directed relationship (b)→(a). WCC is often used early in an analysis to understand the structure of a graph. Usin…
| Parameter | Type | Description |
|---|---|---|
consecutiveIds | boolean | Flag to decide whether component identifiers are mapped into a consecutive id space (requires additional memory). |
minComponentSize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run WCC on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run WCC on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
seedProperty | string | Used to set the initial component for a node. The property value needs to be a number. |
threshold | number | The value of the weight above which the relationship is considered in the computation. |
approximate_maximum_k_cut
A k-cut of a graph is an assignment of its nodes into k disjoint communities. So for example a 2-cut of a graph with nodes a,b,c,d could be the communities {a,b,c} and {d}. A Maximum k-cut is a k-cut such that the total weight of relationships between nodes from different communities in the k-cut is maximized. That is, a k-cut that maximizes the sum of weights of relationships whose source and target nodes are assigned to different communities in the k-cut. Suppose in the simple a,b,c,d node set example above we only had one relationship b → c, and it was of weight 1.0. The 2-cut we outlined…
| Parameter | Type | Description |
|---|---|---|
iterations | integer | The number of iterations the algorithm will run before returning the best solution among all the iterations. |
k | integer | The number of disjoint communities the nodes will be divided into. |
minCommunitySize | integer | Only nodes inside communities larger or equal the given value are returned. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run Max-K-Cut on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Max-K-Cut on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | If set, the values stored at the given property are used as relationship weights during the computation. If not set, the graph is considered unweighted. |
vnsMaxNeighborhoodOrder | integer | The maximum number of nodes VNS will swap when perturbing solutions. |
speaker_listener_label_propagation
The Speaker-Listener Label Propagation Algorithm (SLLPA) is a variation of the Label Propagation algorithm that is able to detect multiple communities per node. The GDS implementation is based on the SLPA: Uncovering Overlapping Communities in Social Networks via A Speaker-listener Interaction Dynamic Process publication by Xie et al. The algorithm is randomized in nature and will not produce deterministic results. To accommodate this, we recommend using a higher number of iterations.
| Parameter | Type | Description |
|---|---|---|
maxIterations | integer | Maximum number of iterations to run. |
minAssociationStrength | number | Minimum influence required for a community to retain a node. |
nodeIdentifierProperty | string | The name of a node property to use as node identifier in the result. If provided, the result will include a 'nodeName' column with values from this property. |
nodeLabels | array | The node labels used to project and run SLLPA on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
partitioning | string | The partitioning scheme used to divide the work between threads. Available options are AUTO, RANGE, DEGREE. |
relTypes | array | The relationships types used to project and run SLLPA on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
find_shortest_path
Find the shortest path between two nodes using Dijkstra's algorithm
| Parameter | Type | Description |
|---|---|---|
end_node * | string | Name of the ending node |
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
start_node * | string | Name of the starting node |
nodeLabels | array | The node labels used to project and run Dijkstra on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Dijkstra on on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationship_property | string | Property of the relationship to use for path finding |
delta_stepping_shortest_path
The Delta-Stepping Shortest Path algorithm computes all shortest paths between a source node and all reachable nodes in the graph. The algorithm supports weighted graphs with positive relationship weights. To compute the shortest path between a source and a single target node, Dijkstra Source-Target can be used. In contrast to Dijkstra Single-Source, the Delta-Stepping algorithm is a distance correcting algorithm. This property allows it to traverse the graph in parallel. The algorithm is guaranteed to always find the shortest path between a source node and a target node. However, if multiple…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the source node to find shortest paths from. |
delta | number | The bucket width for grouping nodes with the same tentative distance to the source node. |
nodeLabels | array | The node labels used to project and run Delta-Stepping on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Delta-Stepping on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
dijkstra_single_source_shortest_path
The Dijkstra Shortest Path algorithm computes the shortest path between nodes. The algorithm supports weighted graphs with positive relationship weights. The Dijkstra Single-Source algorithm computes the shortest paths between a source node and all nodes reachable from that node. To compute the shortest path between a source and a target node, Dijkstra Source-Target can be used.
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the source node to find shortest paths from. |
nodeLabels | array | The node labels used to project and run Dijkstra on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Dijkstra on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
a_star_shortest_path
The A* (pronounced "A-Star") Shortest Path algorithm computes the shortest path between two nodes. A* is an informed search algorithm as it uses a heuristic function to guide the graph traversal. The algorithm supports weighted graphs with positive relationship weights. Unlike Dijkstra's shortest path algorithm, the next node to search from is not solely picked on the already computed distance. Instead, the algorithm combines the already computed distance with the result of a heuristic function. That function takes a node as input and returns a value that corresponds to the cost to reach the t…
| Parameter | Type | Description |
|---|---|---|
latitudeProperty * | string | The node property that stores the latitude value. |
longitudeProperty * | string | The node property that stores the longitude value. |
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the source node to find shortest path from. |
targetNode * | string | Name of the target node to find shortest path to. |
nodeLabels | array | The node labels used to project and run A* on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run A* on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
yens_shortest_paths
Yen's Shortest Path algorithm computes a number of shortest paths between two nodes. The algorithm is often referred to as Yen's k-Shortest Path algorithm, where k is the number of shortest paths to compute. The algorithm supports weighted graphs with positive relationship weights. It also respects parallel relationships between the same two nodes when computing multiple shortest paths. For k = 1, the algorithm behaves exactly like Dijkstra's shortest path algorithm and returns the shortest path. For k = 2, the algorithm returns the shortest path and the second shortest path between the same s…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the source node to find shortest paths from. |
targetNode * | string | Name of the target node to find shortest paths to. |
k | integer | The number of shortest paths to compute between source and target node. |
nodeLabels | array | The node labels used to project and run Yens on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Yens on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
minimum_weight_spanning_tree
The Minimum Weight Spanning Tree (MST) starts from a given node, finds all its reachable nodes and returns the set of relationships that connect these nodes together having the minimum possible weight. Prim's algorithm is one of the simplest and best-known minimum spanning tree algorithms. It operates similarly to Dijkstra's shortest path algorithm, but instead of minimizing the total length of a path ending at each relationship, it minimizes the length of each relationship individually. This allows the algorithm to work on graphs with negative weights. The MST algorithm provides meaningful re…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the starting source node. |
nodeLabels | array | The node labels used to project and run Prim on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
objective | string | If specified, the parameter dictates whether to find the minimum or the maximum weight spanning tree. By default, a minimum weight spanning tree is returned. Permitted values are 'minimum' and 'maximu… |
relTypes | array | The relationships types used to project and run Prim on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
minimum_directed_steiner_tree
Given a source node and a list of target nodes, a directed spanning tree in which there exists a path from the source node to each of the target nodes is called a Directed Steiner Tree. The Minimum Directed Steiner Tree problem asks for the steiner tree that minimizes the sum of all relationship weights in tree. The Minimum Directed Steiner Tree problem is known to be NP-Complete and no efficient exact algorithms have been proposed in the literature. The Neo4j GDS Library offers an efficient implementation of a well-known heuristic for Steiner Tree related problems. The implemented algorithm w…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the starting source node. |
targetNodes * | array | List of target node names to connect in the steiner tree. |
applyRerouting | boolean | If specified, the algorithm will try to improve the outcome via an additional post-processing heuristic. |
delta | number | The bucket width for grouping nodes with the same tentative distance to the source node. Look into the Delta-Stepping documentation for more information. |
nodeLabels | array | The node labels used to project and run Steiner-Tree on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Steiner-Tree on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
prize_collecting_steiner_tree
A spanning tree is a graph such that there is exactly one path between any two nodes in the set. A graph can have many possible spanning tree subsets depending on the set of nodes/relationships selected. Given a weighted graph where each node has a prize, the Prize-Collecting Steiner Tree problem asks for the spanning tree that satisfies the following conditions: 1. the sum of prizes for the nodes in the graph is maximized. 2. the sum of weights of relationships and prizes for nodes not in the tree is minimized. The two constraints can combined to form a single maximization problem by simply s…
| Parameter | Type | Description |
|---|---|---|
prizeProperty * | string | The name of node property that denotes a node's prize. |
nodeLabels | array | The node labels used to project and run Prize Collecting Steiner Tree on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Prize Collecting Steiner Tree on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
all_pairs_shortest_paths
The All Pairs Shortest Path (APSP) calculates the shortest (weighted) path between all pairs of nodes. This algorithm has optimizations that make it quicker than calling the Single Source Shortest Path algorithm for every pair of nodes in the graph. Some pairs of nodes might not be reachable between each other, so no shortest path exists between these pairs. In this scenario, the algorithm will return Infinity value as a result between these pairs of nodes. GDS includes functions such as gds.util.isFinite to help filter infinity values from results. Starting with Neo4j 5, the Infinity literal…
| Parameter | Type | Description |
|---|---|---|
nodeLabels | array | The node labels used to project and run APSP on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run APSP on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
random_walk
Random Walk is an algorithm that provides random paths in a graph. A random walk simulates a traversal of the graph in which the traversed relationships are chosen at random. In a classic random walk, each relationship has the same, possibly weighted, probability of being picked. This probability is not influenced by the previously visited nodes. The random walk implementation of the Neo4j Graph Data Science library supports the concept of second order random walks. This method tries to model the transition probability based on the currently visited node v, the node t visited before the curren…
| Parameter | Type | Description |
|---|---|---|
inOutFactor | number | Tendency of the random walk to stay close to the start node or fan out in the graph. Higher value means stay local. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Random Walk on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Random Walk on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights to influence the probabilities of the random walks. The weights need to be >= 0. If unspecified, the algorithm runs unweighted. |
returnFactor | number | Tendency of the random walk to return to the last visited node. A value below 1.0 means a higher tendency. |
sourceNodes | array | The list of nodes from which to do a random walk. |
walkBufferSize | integer | The number of random walks to complete before starting training. |
walkLength | integer | The number of steps in a single random walk. |
walksPerNode | integer | The number of random walks generated for each node. |
breadth_first_search
The Breadth First Search algorithm is a graph traversal algorithm that given a start node visits nodes in order of increasing distance, see https://en.wikipedia.org/wiki/Breadth-first_search. A related algorithm is the Depth First Search algorithm, Depth First Search. This algorithm is useful for searching when the likelihood of finding the node searched for decreases with distance. There are multiple termination conditions supported for the traversal, based on either reaching one of several target nodes, reaching a maximum depth, exhausting a given budget of traversed relationship cost, or ju…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the starting source node. |
maxDepth | integer | The maximum distance from the source node at which nodes are visited. |
nodeLabels | array | The node labels used to project and run BFS on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run BFS on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
targetNodes | array | Names of target nodes. Traversal terminates when any target node is visited. |
depth_first_search
The Depth First Search algorithm is a graph traversal that starts at a given node and explores as far as possible along each branch before backtracking, see https://en.wikipedia.org/wiki/Depth-first_search. A related algorithm is the Breadth First Search algorithm, Breadth First Search. This algorithm can be preferred over Breadth First Search for example if one wants to find a target node at a large distance and exploring a random path has decent probability of success. There are multiple termination conditions supported for the traversal, based on either reaching one of several target nodes,…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the starting source node. |
maxDepth | integer | The maximum distance from the source node at which nodes are visited. |
nodeLabels | array | The node labels used to project and run DFS on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run DFS on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
targetNodes | array | Names of target nodes. Traversal terminates when any target node is visited. |
bellman_ford_single_source_shortest_path
The Bellman-Ford Path algorithm computes the shortest path between nodes. In contrast to the Dijkstra algorithm which works only for graphs with non-negative relationship weights, Bellman-Ford can also handle graphs with negative weights provided that the source cannot reach any node involved in a negative cycle. A cycle in a graph is a path starting and ending at the same node. A negative cycle is a cycle for which the sum of the relationship weights is negative. When negative cycles exist, shortest paths cannot easily be defined. That is so because we can traverse a negative cycle multiple t…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNode * | string | Name of the starting source node. |
nodeLabels | array | The node labels used to project and run Bellman-Ford on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Bellman-Ford on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
longest_path
Finding the longest path that leads to a node in a graph is possible to do in linear time for the special case of DAGs, that is graphs which do not contain cycles. The GDS implementation for this problem is based on topological sort and operates in linear time. When the graph is not a DAG, any node that belongs to component containing at least one cycle will be excluded from the results. That is, the implementation will only give results for those components of the graph that form DAGs. You can use topological sort to make sure the graph is a DAG. The algorithm supports weighted and unweighted…
| Parameter | Type | Description |
|---|---|---|
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. Required when targetNodes is specified. |
nodeLabels | array | The node labels used to project and run longest path on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run longest path on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
targetNodes | array | List of target node names to filter results. Only paths ending at these nodes will be returned. |
max_flow
Given source nodes, target nodes and relationships with capacity constraints, the max-flow algorithm assigns a flow to each relationship to achieve maximal transport from source to target. The flow is a scalar property for each relationship and must satisfy 1) Flow into a node equals flow out of a node (preservation). 2) Flow is restricted by the capacity of a relationship
| Parameter | Type | Description |
|---|---|---|
capacityProperty * | string | Name of the relationship property that specifies the maximum flow capacity for each edge. |
nodeIdentifierProperty * | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
sourceNodes * | array | List of source node names from which flow originates. |
targetNodes * | array | List of target node names to which flow is sent. |
nodeLabels | array | The node labels used to project and run max flow on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run max flow on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
node_similarity
The Node Similarity algorithm compares a set of nodes based on the nodes they are connected to. Two nodes are considered similar if they share many of the same neighbors. Node Similarity computes pair-wise similarities based on the Jaccard metric, also known as the Jaccard Similarity Score, the Overlap coefficient, also known as the Szymkiewicz–Simpson coefficient, and the Cosine Similarity score. The first two are most frequently associated with unweighted sets, whereas Cosine with weighted input.Filters on source nodes, target nodes, or both can additionally be provided to compute results…
| Parameter | Type | Description |
|---|---|---|
bottomK | integer | Limit on the number of scores per node. The K smallest results are returned. This value cannot be lower than 1. |
bottomN | integer | Global limit on the number of scores computed. The N smallest total results are returned. This value cannot be negative, a value of 0 means no global limit. |
degreeCutoff | integer | Inclusive lower bound on the node degree for a node to be considered in the comparisons. This value can not be lower than 1. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run Node Similarity on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
relTypes | array | The relationships types used to project and run Node Similarity on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
relationshipWeightProperty | string | Name of the relationship property to use as weights. If unspecified, the algorithm runs unweighted. |
similarityCutoff | number | Lower limit for the similarity score to be present in the result. Values must be between 0 and 1. |
similarityMetric | string | The metric used to compute similarity. |
sourceNodeFilter | The source node filter to apply. Accepts a List of node names, or a single label. | |
targetNodeFilter | The target node filter to apply. Accepts a List of node names, or a single label. | |
topK | integer | Limit on the number of scores per node. The K largest results are returned. This value cannot be lower than 1. Use this instead of topN whenever the sourceNode consists of a single node, or it is spec… |
topN | integer | Global limit on the number of scores computed. The N largest total results are returned. This value cannot be negative, a value of 0 means no global limit. |
upperDegreeCutoff | integer | Inclusive upper bound on the node degree for a node to be considered in the comparisons. This value can not be lower than 1. |
useComponents | boolean | If enabled, Node Similarity will use components to improve the performance of the computation, skipping comparisons of nodes in different components. Set to false (Default): the algorithm does not use… |
k_nearest_neighbors
The K-Nearest Neighbors algorithm computes a distance value for all node pairs in the graph and creates new relationships between each node and its k nearest neighbors. The distance is calculated based on node properties. The input of this algorithm is a homogeneous graph; any node label or relationships type information in the graph is ignored. The graph does not need to be connected, in fact, existing relationships between nodes will be ignored - apart from random walk sampling if that that initial sampling option is used. New relationships are created between each node and its k nearest nei…
| Parameter | Type | Description |
|---|---|---|
nodeProperties * | object | The node properties to use for similarity computation along with their selected similarity metrics. Accepts a Map of property keys to metrics. For example: {embedding: 'COSINE',age: 'DEFAULT',lotteryN… |
deltaThreshold | number | Value as a percentage to determine when to stop early. If fewer updates than the configured value happen, the algorithm stops. Value must be between 0 (exclusive) and 1 (inclusive). |
initialSampler | string | The method used to sample the first k random neighbors for each node. "uniform" and "randomWalk", both case-insensitive, are valid inputs. |
maxIterations | integer | Hard limit to stop the algorithm after that many iterations. |
nodeIdentifierProperty | string | Property name to use for identifying nodes (e.g., 'name', 'Name', 'title'). Use get_node_properties_keys to find available properties. |
nodeLabels | array | The node labels used to project and run k-nearest neighbors on. Nodes with different node labels will be ignored. Do not specify to run for all nodes |
perturbationRate | number | The probability of replacing the least similar known neighbor with an encountered neighbor of equal similarity. |
randomJoins | integer | The number of random attempts per node to connect new node neighbors based on random selection, for each iteration. |
relTypes | array | The relationships types used to project and run k-nearest neighbors on. Relationship types of different type will be ignored. Do not specify to run for all relationship types |
sampleRate | number | Sample rate to limit the number of comparisons per node. Value must be between 0 (exclusive) and 1 (inclusive). |
seedTargetNodes | boolean | Enable seeding of target nodes. If seeded, every node picks some of the target nodes initially. This guarantees that for every node we can avoid empty result (when the algorithm did not find for it an… |
similarityCutoff | number | Filter out from the list of K-nearest neighbors nodes with similarity below this threshold. |
sourceNodeFilter | The source node filter to apply. Accepts a List of node names, or a single label. | |
targetNodeFilter | The target node filter to apply. Accepts a List of node names, or a single label. | |
topK | integer | The number of neighbors to find for each node. The K-nearest neighbors are returned. This value cannot be lower than 1. |