1
0
Fork 0
arangodb/Documentation/DocuBlocks/JSF_general_graph_radius.md

2.1 KiB

@brief Get the radius of a graph.

graph._radius(options)

The complexity of the function is described here.

@PARAMS

@PARAM{options, object, optional} An object defining further options. Can have the following values:

  • direction: The direction of the edges. Possible values are outbound, inbound and any (default).
  • algorithm: The algorithm to calculate the shortest paths, possible values are Floyd-Warshall and Dijkstra.
  • weight: The name of the attribute of the edges containing the weight.
  • 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 weight. If no default is supplied the default would be positive infinity so the path and hence the radius can not be calculated.

@EXAMPLES

A route planner example, the radius of the graph.

@EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleRadius1} var examples = require("@arangodb/graph-examples/example-graph.js"); var graph = examples.loadGraph("routeplanner"); graph._radius(); ~ examples.dropGraph("routeplanner"); @END_EXAMPLE_ARANGOSH_OUTPUT

A route planner example, the radius of the graph. This considers the actual distances.

@EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleRadius2} var examples = require("@arangodb/graph-examples/example-graph.js"); var graph = examples.loadGraph("routeplanner"); graph._radius({weight : 'distance'}); ~ examples.dropGraph("routeplanner"); @END_EXAMPLE_ARANGOSH_OUTPUT

A route planner example, the radius of the graph regarding only outbound paths.

@EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleRadius3} var examples = require("@arangodb/graph-examples/example-graph.js"); var graph = examples.loadGraph("routeplanner"); graph._radius({direction : 'outbound', weight : 'distance'}); ~ examples.dropGraph("routeplanner"); @END_EXAMPLE_ARANGOSH_OUTPUT