Documentation

Mathlib.Combinatorics.SimpleGraph.Diam

Diameter of a simple graph #

This module defines the diameter of a simple graph, which measures the maximum distance between vertices.

Main definitions #

Todo #

noncomputable def SimpleGraph.ediam {α : Type u_1} (G : SimpleGraph α) :

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
Instances For
    theorem SimpleGraph.ediam_def {α : Type u_1} {G : SimpleGraph α} :
    G.ediam = ⨆ (p : α × α), G.edist p.1 p.2
    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) :
    theorem SimpleGraph.ediam_le_iff {α : Type u_1} {G : SimpleGraph α} {k : ℕ∞} :
    G.ediam k ∀ (u v : α), G.edist u v k
    theorem SimpleGraph.ediam_eq_top {α : Type u_1} {G : SimpleGraph α} :
    G.ediam = b < , ∃ (u : α) (v : α), b < G.edist u v
    theorem SimpleGraph.ediam_ne_zero {α : Type u_1} {G : SimpleGraph α} [Nontrivial α] :
    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

    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

    theorem SimpleGraph.ediam_anti {α : Type u_1} {G G' : SimpleGraph α} (h : G G') :
    @[simp]
    @[simp]
    theorem SimpleGraph.ediam_top {α : Type u_1} [Nontrivial α] :
    @[simp]
    theorem SimpleGraph.ediam_eq_one {α : Type u_1} {G : SimpleGraph α} [Nontrivial α] :
    G.ediam = 1 G =
    noncomputable def SimpleGraph.diam {α : Type u_1} (G : SimpleGraph α) :

    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
    Instances For
      theorem SimpleGraph.diam_def {α : Type u_1} {G : SimpleGraph α} :
      G.diam = (⨆ (p : α × α), G.edist p.1 p.2).toNat
      theorem SimpleGraph.dist_le_diam {α : Type u_1} {G : SimpleGraph α} (h : G.ediam ) {u v : α} :
      G.dist u v G.diam
      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 ) :
      @[simp]
      theorem SimpleGraph.diam_bot {α : Type u_1} :
      @[simp]
      theorem SimpleGraph.diam_top {α : Type u_1} [Nontrivial α] :
      @[simp]
      theorem SimpleGraph.diam_eq_zero {α : Type u_1} {G : SimpleGraph α} :
      @[simp]
      theorem SimpleGraph.diam_eq_one {α : Type u_1} {G : SimpleGraph α} [Nontrivial α] :
      G.diam = 1 G =

      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.