Jump to content
  • Builtin Stored Procedures and Graph Algorithms


    Table of Contents

     

    Generic Parameters

    These parameters will always mean something like how they are specified, unless specifically stated otherwise in the stored procedure

    •  source: verbatim gremlin query or not specified (if not specified, gets the values from the graph context)
    •  target: verbatim gremlin query or not specified (changes how execution occurs as mentioned above)
    •  distance: string representing attribute name to base the edge length on or a constant floating point (if the later, it might only change the values of the scalars, but not their relationships).
    •  defaultDistance: the distance to use when the edge does not have the attribute name specified by the distance parameter (only used if distance is a string).
    •  edges: verbatim gremlin query returning a collection of edges or a string that is either ?BOTH?, ?OUT?, or ?IN? (used to specify the subgraph?s edges that the stored procedure executes on.)
    •  maxDistance: the maximum distance between two vertices that should be included into the output.
    •  includeEdges: whether to include the edges in any path.
    •  weight: string representing attribute name to base the edge?s weight on or a constant floating point (if the later, it should only change the values of the scalars, but not their relationships).
    •  defaultWeight: the weight to use when the edge does not have the attribute name specified by the distance parameter (only used if weight is a string).
    •  maxIterations: The maximum number of iterations to occur before the algorithm is halted (only a positive integer makes sense).

    Shortest Path

    Named "shortestPath" to execute this procedure.

    •  1 node for source/target - runs single source shortest path
    •  Multiple for source w/o target - runs all pairs shortest path
    •  Multiple source w/ multiple target - runs single source shortest path on each node in source to each node in target
    •  Parameters: source, target, distance, defaultDistance, edges, maxDistance, includeEdges

    PageRank

    Named "pageRank" to execute this procedure.

    • Determines a vertex's importance based on the importance of the nodes adjacent to it.
    •  Generic Parameters: source, weight, defaultWeight, maxIterations, edges
    •  Specific Parameters:
    • dampingFactor: a number determining the likelihood of choosing the next vertex based on the current vertex?s edges compared with a random jump to another vertex
    • epsilon: if the maximum difference between a vertex?s previous rank and that vertex?s new rank at the end of an iteration drops below epsilon, then the algorithm stops and returns the new PageRank values.

    Peer Pressure / Clustering

    Named "peerPressure" to execute this procedure.

    •  Computes a given nodes cluster by randomly assigning clusters to all nodes and giving each node a voting weight based off of the inverse of the sum of the outgoing edges? weights for that node, and then iteratively computing the next assignment for each node based off of the previous assignment of that node?s incoming nodes cluster, choosing which ever cluster has the highest weight for that node. The algorithm halts when no node?s clustering assignment changes, or maxIterations is reached
    •  Parameters: source, weight, defaultWeight, maxIterations, edges

    Connected Components

    Named "connectedComponents" to execute this procedure.

    •  Determines a set of connected components based on the edges between the vertices
    •  Parameters: source, edges

    Closeness Centrality/Betweenness Centrality

    Named "closenessCentrality" to execute the Closeness Centrality procedure or "betweennessCentrality" to execute the Betweenness Centrality procedure.

    •  Closeness: Computes centrality based on the total number of reachable nodes squared divided by the average distance to each node that can be reached and the total number of nodes in the graph
    •  Betweenness: Computes the centrality of a node based on the number of shortest paths running through the node divided by the total number of paths.
    •  Generic Parameters: source, distance, defaultDistance, edges
    •  Specific Parameters:
      •  target: a string query that specifies which node?s centrality score are desired for retrieval.

    TriangleCount

    Named "triangleCounts" to execute this procedure.

    •  Computes the total number of triangles (i.e. set of 3 vertices with edges between each pair of vertices in the set).
    •  Parameters: source, edges

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...