Diameter of a simple graph #
This module defines the eccentricity of vertices, the diameter, and the radius of a simple graph.
Main definitions #
SimpleGraph.eccent
: the eccentricity of a vertex in a simple graph, which is the maximum distances between it and the other vertices.SimpleGraph.ediam
: the graph extended diameter, which is the maximum eccentricity. It isℕ∞
-valued.SimpleGraph.diam
: the graph diameter, anℕ
-valued version ofSimpleGraph.ediam
.SimpleGraph.radius
: the graph radius, which is the minimum eccentricity. It isℕ∞
-valued.SimpleGraph.center
: the set of vertices with eccentricity equal to the graph's radius.
The eccentricity of a vertex is the greatest distance between it and any other vertex.
Instances For
The extended diameter is the greatest distance between any two vertices, with the value ⊤
in
case the distances are not bounded above, or the graph is not connected.
Instances For
In a finite graph with nontrivial vertex set, the graph is connected
if and only if the extended diameter is not ⊤
.
See connected_of_ediam_ne_top
for one of the implications without
the finiteness assumptions
The diameter is the greatest distance between any two vertices, with the value 0
in
case the distances are not bounded above, or the graph is not connected.
Instances For
A finite and nontrivial graph is connected if and only if its diameter is not zero.
See also connected_iff_ediam_ne_top
for the extended diameter version.
The radius of a simple graph is the minimum eccentricity of any vertex.