# radius: Radius of a graph In igraph: Network Analysis and Visualization

## Description

The eccentricity of a vertex is its shortest path distance from the farthest other node in the graph. The smallest eccentricity in a graph is called its radius

## Usage

 `1` ```radius(graph, mode = c("all", "out", "in", "total")) ```

## Arguments

 `graph` The input graph, it can be directed or undirected. `mode` Character constant, gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If `out` then the shortest paths from the vertex, if `in` then to it will be considered. If `all`, the default, then the corresponding undirected graph will be used, edge directions will be ignored. This argument is ignored for undirected graphs.

## 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

A numeric scalar, the radius of the graph.

## References

`eccentricity` for the underlying calculations, codedistances for general shortest path calculations.

## Examples

 ```1 2 3``` ```g <- make_star(10, mode="undirected") eccentricity(g) radius(g) ```

### Example output

```Attaching package: 'igraph'

The following objects are masked from 'package:stats':

decompose, spectrum

The following object is masked from 'package:base':

union

[1] 1 2 2 2 2 2 2 2 2 2
[1] 1
```

igraph documentation built on March 18, 2018, 1:24 p.m.