Learn R Programming

DiagrammeR (version 0.8.4)

get_graph_diameter: Get the graph diameter

Description

Get the graph diameter, which is the maximum eccentricity.

Usage

get_graph_diameter(graph)

Arguments

graph
a graph object of class dgr_graph.

Value

the graph diameter as a single-length vector.

Examples

Run this code
# Get the graph diameter for a randomly-created
# graph
get_graph_diameter(
  create_random_graph(
    5, 7,
    fully_connected = TRUE,
    set_seed = 20))
#> [1] 4

Run the code above in your browser using DataLab