Diameter of a simple graph #
This module defines the diameter of a simple graph, which measures the maximum distance between vertices.
Main definitions #
SimpleGraph.ediam
is the graph extended diameter.SimpleGraph.diam
is the graph diameter.
Todo #
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.