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.
Equations
- G.ediam = ⨆ (u : α), ⨆ (v : α), G.edist u v
Instances For
theorem
SimpleGraph.edist_le_ediam
{α : Type u_1}
{G : SimpleGraph α}
{u v : α}
:
G.edist u v ≤ G.ediam
theorem
SimpleGraph.ediam_le_of_edist_le
{α : Type u_1}
{G : SimpleGraph α}
{k : ℕ∞}
(h : ∀ (u v : α), G.edist u v ≤ k)
:
G.ediam ≤ k
theorem
SimpleGraph.ediam_eq_zero_of_subsingleton
{α : Type u_1}
{G : SimpleGraph α}
[Subsingleton α]
:
G.ediam = 0
theorem
SimpleGraph.nontrivial_of_ediam_ne_zero
{α : Type u_1}
{G : SimpleGraph α}
(h : G.ediam ≠ 0)
:
theorem
SimpleGraph.subsingleton_of_ediam_eq_zero
{α : Type u_1}
{G : SimpleGraph α}
(h : G.ediam = 0)
:
theorem
SimpleGraph.ediam_ne_zero_iff_nontrivial
{α : Type u_1}
{G : SimpleGraph α}
:
G.ediam ≠ 0 ↔ Nontrivial α
@[simp]
theorem
SimpleGraph.ediam_eq_zero_iff_subsingleton
{α : Type u_1}
{G : SimpleGraph α}
:
G.ediam = 0 ↔ Subsingleton α
theorem
SimpleGraph.ediam_eq_top_of_not_connected
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
(h : ¬G.Connected)
:
theorem
SimpleGraph.ediam_eq_top_of_not_preconnected
{α : Type u_1}
{G : SimpleGraph α}
(h : ¬G.Preconnected)
:
theorem
SimpleGraph.exists_edist_eq_ediam_of_ne_top
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
(h : G.ediam ≠ ⊤)
:
∃ (u : α) (v : α), G.edist u v = G.ediam
theorem
SimpleGraph.exists_edist_eq_ediam_of_finite
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
[Finite α]
:
∃ (u : α) (v : α), G.edist u v = G.ediam
theorem
SimpleGraph.ediam_anti
{α : Type u_1}
{G G' : SimpleGraph α}
(h : G ≤ G')
:
G'.ediam ≤ G.ediam
@[simp]
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.
Equations
- G.diam = G.ediam.toNat
Instances For
theorem
SimpleGraph.dist_le_diam
{α : Type u_1}
{G : SimpleGraph α}
(h : G.ediam ≠ ⊤)
{u v : α}
:
G.dist u v ≤ G.diam
theorem
SimpleGraph.nontrivial_of_diam_ne_zero
{α : Type u_1}
{G : SimpleGraph α}
(h : G.diam ≠ 0)
:
theorem
SimpleGraph.diam_eq_zero_of_not_connected
{α : Type u_1}
{G : SimpleGraph α}
(h : ¬G.Connected)
:
G.diam = 0
theorem
SimpleGraph.diam_eq_zero_of_ediam_eq_top
{α : Type u_1}
{G : SimpleGraph α}
(h : G.ediam = ⊤)
:
G.diam = 0
theorem
SimpleGraph.ediam_ne_top_of_diam_ne_zero
{α : Type u_1}
{G : SimpleGraph α}
(h : G.diam ≠ 0)
:
theorem
SimpleGraph.exists_dist_eq_diam
{α : Type u_1}
{G : SimpleGraph α}
[Nonempty α]
:
∃ (u : α) (v : α), G.dist u v = G.diam
theorem
SimpleGraph.diam_anti_of_ediam_ne_top
{α : Type u_1}
{G G' : SimpleGraph α}
(h : G ≤ G')
(hn : G.ediam ≠ ⊤)
:
G'.diam ≤ G.diam
@[simp]
@[simp]