1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/paths.R
\name{radius}
\alias{radius}
\title{Radius of a graph}
\usage{
radius(graph, mode = c("all", "out", "in", "total"))
}
\arguments{
\item{graph}{The input graph, it can be directed or undirected.}
\item{mode}{Character constant, gives whether the shortest paths to or from
the given vertices should be calculated for directed graphs. If \code{out}
then the shortest paths \emph{from} the vertex, if \code{in} then \emph{to}
it will be considered. If \code{all}, the default, then the corresponding
undirected graph will be used, edge directions will be ignored. This
argument is ignored for undirected graphs.}
}
\value{
A numeric scalar, the radius of the graph.
}
\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
}
\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.
}
\examples{
g <- make_star(10, mode="undirected")
eccentricity(g)
radius(g)
}
\references{
Harary, F. Graph Theory. Reading, MA: Addison-Wesley, p. 35,
1994.
}
\seealso{
\code{\link{eccentricity}} for the underlying
calculations, code{\link{distances}} for general shortest path
calculations.
}
|