QuACN (version 1.8.0)

diameter: Diameter

Description

This method calculates the diameter of a given graph.

Usage

diameter(g, dist = NULL)

Arguments

g
a graph as a graphNEL object.
dist
the distance matrix of the graph. If the parameter is empty the distance matrix will be calculated within the function.

Value

References

F. Harary, Graph Theory, Addison-Wesley series in mathematics, Perseus Books, 1994.

Examples


library(RBGL)
set.seed(123)
g <- randomGraph(1:8, 1:5, 0.36, weights=FALSE)

diameter(g)