Weakly and strongly connected components #
For a quiver V
, define the type WeaklyConnectedComponent V
as the quotient of V
by
the relation which identifies a
with b
if there is a path from a
to b
in Symmetrify V
.
(These zigzags can be seen as a proof-relevant analogue of EqvGen
.)
We define:
Quiver.IsStronglyConnected V
: every pair of vertices is connected by a (possibly empty) path.Quiver.IsSStronglyConnected V
: every pair of vertices is connected by a path of positive length.Quiver.StronglyConnectedComponent V
: the quotient by the equivalence relation “paths in both directions”.
These concepts relate strong and weak connectivity and let us reason about strongly connected components in directed graphs.
Two vertices are related in the zigzag setoid if there is a zigzag of arrows from one to the other.
Equations
- Quiver.zigzagSetoid V = { r := fun (a b : V) => Nonempty (Quiver.Path a b), iseqv := ⋯ }
Instances For
The type of weakly connected components of a directed graph. Two vertices are in the same weakly connected component if there is a zigzag of arrows from one to the other.
Equations
Instances For
The weakly connected component corresponding to a vertex.
Instances For
Equations
Equations
- Quiver.WeaklyConnectedComponent.instInhabited = { default := have this := default; Quiver.WeaklyConnectedComponent.mk this }
A wide subquiver H
of Symmetrify V
determines a wide subquiver of V
, containing an
arrow e
if either e
or its reversal is in H
.
Equations
Instances For
Strongly connected components (directed connectivity) #
We define strong connectivity (IsStronglyConnected
), its positive-length refinement
(IsSStronglyConnected
), and strongly connected components.
Strong connectivity: every ordered pair of vertices is joined by a (possibly empty) directed path.
Equations
- Quiver.IsStronglyConnected V = ∀ (i j : V), Nonempty (Quiver.Path i j)
Instances For
Positive strong connectivity: every ordered pair of vertices is joined by a directed path of positive length.
Equations
- Quiver.IsSStronglyConnected V = ∀ (i j : V), ∃ (p : Quiver.Path i j), 0 < p.length
Instances For
Equivalence relation identifying vertices connected by directed paths in both directions.
Equations
- Quiver.stronglyConnectedSetoid V = { r := fun (a b : V) => Nonempty (Quiver.Path a b) ∧ Nonempty (Quiver.Path b a), iseqv := ⋯ }
Instances For
The type of strongly connected components (bidirectional reachability classes).
Equations
Instances For
The canonical map from a vertex to its strongly connected component.