graph_center | R Documentation |
The center of a graph is the set of its vertices with minimal eccentricity.
graph_center(graph, ..., weights = NULL, mode = c("all", "out", "in", "total"))
graph |
The input graph, it can be directed or undirected. |
... |
These dots are for future extensions and must be empty. |
weights |
Possibly a numeric vector giving edge weights. If this is
|
mode |
Character constant, gives whether the shortest paths to or from
the given vertices should be calculated for directed graphs. If |
The vertex IDs of the central vertices.
igraph_graph_center_dijkstra()
.
eccentricity()
, radius()
Other paths:
all_simple_paths()
,
diameter()
,
distance_table()
,
eccentricity()
,
radius()
tree <- make_tree(100, 7)
graph_center(tree)
graph_center(tree, mode = "in")
graph_center(tree, mode = "out")
# Without and with weights
ring <- make_ring(10)
graph_center(ring)
# Add weights
E(ring)$weight <- seq_len(ecount(ring))
graph_center(ring)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.