Digraphs #
This module defines directed graphs on a vertex type V,
which is the same notion as a relation V → V → Prop.
While this might be too simple of a notion to deserve the grandeur of a new definition,
the intention here is to develop relations using the language of graph theory.
Note that in this treatment, a digraph may have self loops.
The type Digraph V is structurally equivalent to Quiver.{0} V,
but a difference between these is that Quiver is a class —
its purpose is to attach a quiver structure to a particular type V.
In contrast, for Digraph V we are interested in working with the entire lattice
of digraphs on V.
Main definitions #
Digraphis a structure for relations. UnlikeSimpleGraph, the relation does not need to be symmetric or irreflexive.CompleteAtomicBooleanAlgebrainstance: Under the subgraph relation,Digraphforms aCompleteAtomicBooleanAlgebra. In other words, this is the complete lattice of spanning subgraphs of the complete graph.
The complete digraph on a type V (denoted by ⊤)
is the digraph whose vertices are all adjacent.
Note that every vertex is adjacent to itself in ⊤.
Instances For
The empty digraph on a type V (denoted by ⊥)
is the digraph such that no pairs of vertices are adjacent.
Note that ⊥ is called the empty digraph because it has no edges.
Instances For
The relation that one Digraph is a spanning subgraph of another.
Note that Digraph.IsSubgraph G H should be spelled G ≤ H.
Instances For
The supremum of two digraphs x ⊔ y has edges where either x or y have edges.
The infimum of two digraphs x ⊓ y has edges where both x and y have edges.
The difference of two digraphs x \ y has the edges of x with the edges of y removed.