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 of `SimpleGraph.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
theorem
SimpleGraph.exists_edist_eq_eccent_of_finite
{α : Type u_1}
{G : SimpleGraph α}
[Finite α]
(u : α)
:
theorem
SimpleGraph.eccent_eq_top_of_not_connected
{α : Type u_1}
{G : SimpleGraph α}
(h : ¬G.Connected)
(u : α)
:
theorem
SimpleGraph.eccent_eq_zero_of_subsingleton
{α : Type u_1}
{G : SimpleGraph α}
[Subsingleton α]
(u : α)
:
theorem
SimpleGraph.diam_eq_zero_of_subsingleton
{α : Type u_1}
{G : SimpleGraph α}
[Subsingleton α]
:
The diameter is the greatest distance between any two vertices. If the graph is disconnected,
this will be 0
.
theorem
SimpleGraph.nontrivial_of_diam_ne_zero'
{α : Type u_1}
{G : SimpleGraph α}
(h : G.diam ≠ 0)
:
The radius of a graph is the minimum eccentricity of its vertices. It's ⊤
for the empty
graph.
Instances For
theorem
SimpleGraph.exists_eccent_eq_radius_of_finite
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
[Finite α]
:
theorem
SimpleGraph.center_nonempty_of_finite
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
[Finite α]
: