eccentricity {igraph} | R Documentation |
Eccentricity of the vertices in a graph
Description
The eccentricity of a vertex is its shortest path distance from the farthest other node in the graph.
Usage
eccentricity(
graph,
vids = V(graph),
...,
weights = NULL,
mode = c("all", "out", "in", "total")
)
Arguments
graph |
The input graph, it can be directed or undirected. |
vids |
The vertices for which the eccentricity is calculated. |
... |
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 |
Details
The eccentricity of a vertex is calculated by measuring the shortest distance from (or to) the vertex, to (or from) all vertices in the graph, and taking the maximum.
This implementation ignores vertex pairs that are in different components. Isolate vertices have eccentricity zero.
Value
eccentricity()
returns a numeric vector, containing the
eccentricity score of each given vertex.
Related documentation in the C library
igraph_eccentricity_dijkstra()
.
References
Harary, F. Graph Theory. Reading, MA: Addison-Wesley, p. 35, 1994.
See Also
radius()
for a related concept,
distances()
for general shortest path calculations.
Other paths:
all_simple_paths()
,
diameter()
,
distance_table()
,
graph_center()
,
radius()
Examples
g <- make_star(10, mode = "undirected")
eccentricity(g)