Bridges and forests of multigraphs #
Mathlib defines a bridge of a multigraph G : Graph α β as an edge e forming a singleton edge
cut, Graph.IsBridge. This file characterizes bridges through edge-labelled walks:
Graph.IsLink.isBridge_iff_not_reachable_deleteEdges: an edge joiningxandyis a bridge exactly whenxandyare not reachable from each other once the edge is deleted.Graph.isBridge_iff_exists_not_reachable_deleteEdges: the same criterion with the ends of the edge quantified existentially.Graph.IsLink.isBridge_iff_forall_walk_mem_edges: equivalently, every walk between the ends of the edge traverses it.Graph.isBridge_iff_forall_cycle_notMem: an actual edge is a bridge exactly when it lies on no cycle.
Consequently loops are never bridges, and neither is an edge having a distinct parallel edge.
Deleting an edge joining x and y affects only the connected component containing them:
Graph.IsLink.reachable_iff_reachable_deleteEdges_or shows that this component splits into the
components of x and of y in the deletion, which are distinct exactly when the edge is a
bridge, and Graph.IsLink.reachable_deleteEdges_iff_of_not_reachable that reachability elsewhere
is unchanged. Counting components, Graph.isBridge_iff_componentCount_deleteEdges_eq_add_one
shows that, when there are finitely many components, an edge is a bridge exactly when deleting it
increases the number of connected components by one; deleting any other edge leaves the number
unchanged (Graph.componentCount_deleteEdges_of_not_isBridge). Collecting the bridges into
Graph.bridgeSet, Graph.componentCount_deleteEdges_of_subset_bridgeSet_of_finite shows that,
with finitely many components, deleting a finite set of bridges adds one component per deleted
bridge. With finitely many actual vertices, G has finitely many bridges
(Graph.finite_bridgeSet) and deleting all of them leaves exactly
G.componentCount + G.bridgeSet.ncard components (Graph.componentCount_deleteEdges_bridgeSet).
Deleting every bridge leaves a graph without bridges
(Graph.not_isBridge_deleteEdges_bridgeSet).
A multigraph is a forest, Graph.IsForest, when it has no cycles; since loops and pairs of
parallel edges are cycles of multigraphs, a forest has neither.
Graph.isForest_iff_forall_isBridge shows that a multigraph is a forest exactly when every actual
edge is a bridge. In a forest, a walk is a path exactly when it is a trail
(Graph.IsForest.isPath_iff_isTrail). Only the component counts assume finiteness: of the
components when deleting one bridge or finitely many bridges, and of the actual vertices when
deleting all bridges; the other statements need no finiteness assumptions.
The statements follow the corresponding results for simple graphs in Mathlib,
SimpleGraph.isBridge_iff, SimpleGraph.isBridge_iff_forall_walk_mem_edges,
SimpleGraph.isBridge_iff_forall_cycle_notMem, SimpleGraph.IsBridge.notMem_edges_of_isCycle,
SimpleGraph.isAcyclic_iff_forall_isBridge, SimpleGraph.IsAcyclic.isPath_iff_isTrail, and
SimpleGraph.IsAcyclic.anti, adapted to multigraphs whose walks record edge identities. The proof
of Graph.isForest_iff_forall_isBridge is adapted from Mathlib's proof of
SimpleGraph.isAcyclic_iff_forall_isBridge.
Bridges and deletion #
An edge is a bridge exactly when it links two vertices that are not reachable from each other once it is deleted.
The ends of an edge that is not a bridge remain reachable from each other after deleting all bridges.
Bridges and connected components #
Deleting a bridge increases the number of connected components by exactly one: the component containing its ends splits into the components of its two ends, and every other component is unchanged.
Bridges by component counts. With finitely many connected components, an edge is a bridge exactly when deleting it increases the number of connected components by one.
With finitely many connected components, deleting a finite set of bridges increases the number of connected components by the number of deleted bridges.
With finitely many actual vertices, deleting a set of bridges increases the number of connected components by the number of deleted bridges.
Bridges and cycles #
Deleting all bridges leaves a graph without bridges.