1
0
Fork 0
arangodb/Documentation/DocuBlocks/JSF_aql_general_graph_eccen...

2.0 KiB

GRAPH_ECCENTRICITY (graphName, options)

The GRAPH_ECCENTRICITY function returns the normalized eccentricity of the graphs vertices

The complexity of the function is described here.

Parameters

  • graphName : The name of the graph as a string.
  • options (optional) : An object containing the following options:
    • direction : The direction of the edges as a string. Possible values are outbound, inbound and any (default).
    • algorithm : The algorithm to calculate the shortest paths as a string. Possible values are Floyd-Warshall (default) and Dijkstra.
    • weight : The name of the attribute of the edges containing the length as a string.
    • defaultWeight : Only used with the option weight. If an edge does not have the attribute named as defined in option weight this default is used as length. If no default is supplied the default would be positive Infinity so the path and hence the eccentricity can not be calculated.

@EXAMPLES

A route planner example, the eccentricity of all locations.

@EXAMPLE_ARANGOSH_OUTPUT{generalGraphEccentricity1} var examples = require("@arangodb/graph-examples/example-graph.js"); var g = examples.loadGraph("routeplanner"); db._query("RETURN GRAPH_ECCENTRICITY('routeplanner')").toArray(); ~ examples.dropGraph("routeplanner"); @END_EXAMPLE_ARANGOSH_OUTPUT

A route planner example, the eccentricity of all locations. This considers the actual distances.

@EXAMPLE_ARANGOSH_OUTPUT{generalGraphEccentricity2} var examples = require("@arangodb/graph-examples/example-graph.js"); var g = examples.loadGraph("routeplanner"); | db._query("RETURN GRAPH_ECCENTRICITY('routeplanner', {weight : 'distance'})" ).toArray(); ~ examples.dropGraph("routeplanner"); @END_EXAMPLE_ARANGOSH_OUTPUT