Documentation

TauCeti.Combinatorics.Network.MixedCapacity

Flows with vertex and arrow capacities #

Let Q be a finite arrow family with nonnegative capacities cap on its arrows, let s ≠ t be terminals, and let c v be a nonnegative capacity on every vertex v other than s and t. An ordinary s–t flow respects the vertex capacities when the total value entering every nonterminal vertex v is at most c v; by conservation this is also the total value leaving v. A mixed separator is a pair (X, F) of a vertex set X avoiding the terminals and a set F of arrows such that every walk from s to t passes through a vertex of X or traverses an arrow of F; equivalently, deleting X and F leaves no walk from s to t. Its weight is ∑ v ∈ X, c v + ∑ a ∈ F, cap a, counting an arrow of F even when it is incident to a vertex of X.

This file proves the max-flow/min-cut theorem for these mixed capacities: the value of every flow respecting the vertex capacities is at most the weight of every mixed separator, and some such flow and some mixed separator attain equality, with every arrow value of the flow in any additive subgroup containing all the capacities.

The proof reduces to ordinary flows by vertex splitting (TauCeti.SplitHom). The split network keeps the capacity cap e on each original arrow, puts c v on the split arrow of each nonterminal vertex, and the total capacity of all arrows on the split arrows of the terminals (TauCeti.mixedSplitCapacity); its terminals are the exit s⁺ of s and the entrance t⁻ of t. The flows respecting the vertex capacities correspond exactly to the ordinary s⁺–t⁻ flows of the split network, with the same values on the original arrows and the same value (TauCeti.Flow.mixedSplitEquiv). A cut of the split network is mapped to the mixed separator formed by its crossing split arrows and its crossing original arrows, of weight equal to the cut capacity, and a mixed separator is mapped to a cut whose crossing arrows it contains. The two maps between cuts and separators do not depend on the capacities of the terminal split arrows; only the correspondence with all flows uses that those capacities bound the traffic through the terminals.

Taking every vertex capacity to be the total capacity of all arrows imposes no constraint (TauCeti.Flow.respectsVertexCapacity_arrowSum), so ordinary max-flow/min-cut is the special case in which mixed separators may as well contain no vertices.

Main definitions #

Main results #

References #

Mixed separators #

def TauCeti.IsMixedSeparator {V : Type u} {Q : V → V → Type v} (X : Finset V) (F : Finset ((v : V) × (w : V) × Q v w)) (s t : V) :

A mixed separator between s and t is a pair of a vertex set X, containing neither s nor t, and a set F of arrows, each recorded with its endpoints, such that every walk from s to t passes through a vertex of X or traverses an arrow of F. Equivalently, no walk from s to t survives the deletion of the vertices of X and the arrows of F.

Instances For
    theorem TauCeti.isMixedSeparator_iff {V : Type u} {Q : V → V → Type v} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} {s t : V} :
    IsMixedSeparator X F s t ↔ s ∉ X ∧ t ∉ X ∧ ∀ (p : ArrowWalk Q s t), (∃ v ∈ p.vertices, v ∈ X) ∨ ∃ a ∈ p.arrows, a ∈ F
    theorem TauCeti.IsMixedSeparator.source_notMem {V : Type u} {Q : V → V → Type v} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} {s t : V} (h : IsMixedSeparator X F s t) :
    s ∉ X
    theorem TauCeti.IsMixedSeparator.target_notMem {V : Type u} {Q : V → V → Type v} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} {s t : V} (h : IsMixedSeparator X F s t) :
    t ∉ X
    theorem TauCeti.IsMixedSeparator.exists_mem {V : Type u} {Q : V → V → Type v} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} {s t : V} (h : IsMixedSeparator X F s t) (p : ArrowWalk Q s t) :
    (∃ v ∈ p.vertices, v ∈ X) ∨ ∃ a ∈ p.arrows, a ∈ F

    Every walk from s to t meets a mixed separator.

    theorem TauCeti.IsMixedSeparator.ne {V : Type u} {Q : V → V → Type v} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} {s t : V} (h : IsMixedSeparator X F s t) :
    s ≠ t

    The terminals of a mixed separator are distinct, since the walk of length zero meets no vertex set avoiding its terminal and no arrow set.

    theorem TauCeti.IsMixedSeparator.mono {V : Type u} {Q : V → V → Type v} {X X' : Finset V} {F F' : Finset ((v : V) × (w : V) × Q v w)} {s t : V} (h : IsMixedSeparator X F s t) (hX : X ⊆ X') (hF : F ⊆ F') (hs : s ∉ X') (ht : t ∉ X') :

    Enlarging a mixed separator, while keeping its vertices away from the terminals, gives a mixed separator.

    theorem TauCeti.isMixedSeparator_empty_iff {V : Type u} {Q : V → V → Type v} {X : Finset V} {s t : V} :
    IsMixedSeparator X ∅ s t ↔ s ∉ X ∧ t ∉ X ∧ ¬ReachableAvoiding Q (↑X) s t

    A mixed separator without arrows is a vertex set avoiding the terminals whose deletion leaves t unreachable from s.

    Cuts of the split network and mixed separators #

    theorem TauCeti.SplitHom.isMixedSeparator_cutVertices_cutArrows {V : Type u} {Q : V → V → Type v} [Fintype V] [DecidableEq V] [(v w : V) → Fintype (Q v w)] {s t : V} (hst : s ≠ t) {S : Finset (V × Bool)} (hs : (s, true) ∈ S) (ht : (t, false) ∉ S) :

    Cuts give mixed separators. For distinct terminals and a vertex set S of the split network containing the exit of s but not the entrance of t, the vertices whose split arrows leave S and the original arrows leaving S form a mixed separator between s and t.

    theorem TauCeti.SplitHom.arrowSum_assignment_compl_eq_weight {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [DecidableEq V] [(v w : V) → Fintype (Q v w)] {s t : V} [AddCommMonoid K] {S : Finset (V × Bool)} (hs : (s, true) ∈ S) (ht : (t, false) ∉ S) {cap : Assignment Q K} {φ c : V → K} (hφ : ∀ (v : V), v ≠ s → v ≠ t → φ v = c v) :
    arrowSum (assignment cap φ) S Sᶜ = ∑ v ∈ cutVertices S, c v + ∑ a ∈ cutArrows Q S, cap a.snd.snd

    Cuts give mixed separators of equal weight. For a vertex set S of the split network containing the exit of s but not the entrance of t, and split capacities φ agreeing with the vertex capacities c away from the terminals, the cut capacity of S equals the weight of the mixed separator formed by the vertices whose split arrows leave S and the original arrows leaving S (TauCeti.SplitHom.isMixedSeparator_cutVertices_cutArrows).

    theorem TauCeti.IsMixedSeparator.exists_cutVertices_subset {V : Type u} {Q : V → V → Type v} [Fintype V] [DecidableEq V] [(v w : V) → Fintype (Q v w)] {s t : V} {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} (h : IsMixedSeparator X F s t) :
    ∃ (S : Finset (V × Bool)), (s, true) ∈ S ∧ (t, false) ∉ S ∧ SplitHom.cutVertices S ⊆ X ∧ SplitHom.cutArrows Q S ⊆ F

    Mixed separators give cuts. Every mixed separator (X, F) between s and t contains the crossing arrows of some vertex set of the split network containing the exit of s but not the entrance of t: the vertices of X include those whose split arrows leave it, and F includes the original arrows leaving it.

    theorem TauCeti.IsMixedSeparator.exists_arrowSum_le {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [DecidableEq V] [(v w : V) → Fintype (Q v w)] {s t : V} [AddCommMonoid K] [PartialOrder K] [IsOrderedAddMonoid K] {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} (h : IsMixedSeparator X F s t) {cap : Assignment Q K} {c : V → K} (hcap : ∀ a ∈ F, 0 ≤ cap a.snd.snd) (hc : ∀ v ∈ X, 0 ≤ c v) :
    ∃ (S : Finset (V × Bool)), (s, true) ∈ S ∧ (t, false) ∉ S ∧ arrowSum (SplitHom.assignment cap c) S Sᶜ ≤ ∑ v ∈ X, c v + ∑ a ∈ F, cap a.snd.snd

    Every mixed separator (X, F) gives a vertex set of the split network containing the exit of s but not the entrance of t, whose cut capacity is at most the weight of (X, F), whenever the capacities of the vertices of X and of the arrows of F are nonnegative.

    Flows respecting vertex capacities #

    def TauCeti.mixedSplitCapacity {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] (cap : Assignment Q K) (c : V → K) (s t : V) [DecidableEq V] :
    V → K

    The capacities of the split arrows in the reduction of mixed capacities to arrow capacities: the vertex capacity c v on the split arrow of every vertex v other than s and t, and the total capacity of all arrows on the split arrows of s and t, which bounds the traffic through the terminals.

    Instances For
      theorem TauCeti.mixedSplitCapacity_of_ne {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [DecidableEq V] {v : V} (hs : v ≠ s) (ht : v ≠ t) :
      mixedSplitCapacity cap c s t v = c v
      theorem TauCeti.mixedSplitCapacity_of_eq_or_eq {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [DecidableEq V] {v : V} (hv : v = s ∨ v = t) :
      def TauCeti.Flow.RespectsVertexCapacity {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {s t : V} [PartialOrder K] (f : Flow cap s t) (c : V → K) :

      An ordinary s–t flow respects the vertex capacities c when the total value entering each vertex v other than s and t is at most c v. By conservation, this is also the total value leaving v.

      Instances For
        theorem TauCeti.Flow.respectsVertexCapacity_iff {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] {f : Flow cap s t} :
        f.RespectsVertexCapacity c ↔ ∀ (v : V), v ≠ s → v ≠ t → arrowSum f.toFun Finset.univ {v} ≤ c v
        theorem TauCeti.Flow.RespectsVertexCapacity.le {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] {f : Flow cap s t} (hf : f.RespectsVertexCapacity c) {v : V} (hs : v ≠ s) (ht : v ≠ t) :

        A flow respecting the vertex capacities carries at most c v into each nonterminal vertex v.

        theorem TauCeti.Flow.respectsVertexCapacity_arrowSum {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] (f : Flow cap s t) :

        Every flow respects the vertex capacities equal to the total capacity of all arrows.

        def TauCeti.Flow.mixedSplitEquiv {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) :

        Vertex splitting for mixed capacities. For distinct terminals, the ordinary s–t flows respecting the vertex capacities c correspond to the ordinary s⁺–t⁻ flows of the split network with the capacities cap on original arrows and mixedSplitCapacity cap c s t on split arrows. A flow keeps its values on the original arrows, and its split arrow at each vertex other than t carries the value entering that vertex.

        Instances For
          @[simp]
          theorem TauCeti.Flow.originalAssignment_mixedSplitEquiv_apply {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) (f : { f : Flow cap s t // f.RespectsVertexCapacity c }) :
          theorem TauCeti.Flow.mixedSplitEquiv_apply_split {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) (f : { f : Flow cap s t // f.RespectsVertexCapacity c }) {v : V} (hv : v ≠ t) :

          The split arrow of a vertex other than the sink carries the value entering that vertex.

          theorem TauCeti.Flow.mixedSplitEquiv_apply_split_self {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) (f : { f : Flow cap s t // f.RespectsVertexCapacity c }) :

          The split arrow of the sink carries the value leaving it.

          @[simp]
          theorem TauCeti.Flow.mixedSplitEquiv_symm_apply_toFun {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) (g : Flow (SplitHom.assignment cap (mixedSplitCapacity cap c s t)) (s, true) (t, false)) :
          @[simp]
          theorem TauCeti.Flow.val_mixedSplitEquiv {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] [DecidableEq V] (hst : s ≠ t) (f : { f : Flow cap s t // f.RespectsVertexCapacity c }) :
          ((mixedSplitEquiv hst) f).val = (↑f).val

          The correspondence preserves values.

          theorem TauCeti.Flow.RespectsVertexCapacity.val_le {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] {cap : Assignment Q K} {c : V → K} {s t : V} [PartialOrder K] [IsOrderedAddMonoid K] {f : Flow cap s t} (hf : f.RespectsVertexCapacity c) {X : Finset V} {F : Finset ((v : V) × (w : V) × Q v w)} (h : IsMixedSeparator X F s t) :
          f.val ≤ ∑ v ∈ X, c v + ∑ a ∈ F, cap a.snd.snd

          Weak duality for mixed capacities. The value of an ordinary flow respecting the vertex capacities c is at most the weight of every mixed separator.

          The max-flow/min-cut theorem for mixed capacities #

          theorem TauCeti.Flow.exists_respectsVertexCapacity_val_eq_mem {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] [LinearOrder K] [IsOrderedAddMonoid K] {cap : Assignment Q K} {c : V → K} {s t : V} (hst : s ≠ t) (hcap : 0 ≤ cap) (hc : ∀ (v : V), v ≠ s → v ≠ t → 0 ≤ c v) (H : AddSubgroup K) (hcapH : ∀ ⦃v w : V⦄ (e : Q v w), cap e ∈ H) (hcH : ∀ (v : V), v ≠ s → v ≠ t → c v ∈ H) :
          ∃ (f : Flow cap s t), f.RespectsVertexCapacity c ∧ (∀ ⦃v w : V⦄ (e : Q v w), f.toFun e ∈ H) ∧ ∃ (X : Finset V) (F : Finset ((v : V) × (w : V) × Q v w)), IsMixedSeparator X F s t ∧ f.val = ∑ v ∈ X, c v + ∑ a ∈ F, cap a.snd.snd

          Max-flow/min-cut for mixed capacities, with integrality. For distinct terminals, nonnegative arrow capacities and nonnegative capacities on the nonterminal vertices, all lying in an additive subgroup H, some ordinary flow respecting the vertex capacities, with every arrow value in H, has value equal to the weight of some mixed separator. By weak duality (TauCeti.Flow.RespectsVertexCapacity.val_le), this flow is maximum among the flows respecting the vertex capacities and this separator has minimum weight.

          theorem TauCeti.Flow.exists_respectsVertexCapacity_val_eq {V : Type u} {Q : V → V → Type v} {K : Type w} [Fintype V] [(v w : V) → Fintype (Q v w)] [AddCommGroup K] [LinearOrder K] [IsOrderedAddMonoid K] {cap : Assignment Q K} {c : V → K} {s t : V} (hst : s ≠ t) (hcap : 0 ≤ cap) (hc : ∀ (v : V), v ≠ s → v ≠ t → 0 ≤ c v) :
          ∃ (f : Flow cap s t), f.RespectsVertexCapacity c ∧ ∃ (X : Finset V) (F : Finset ((v : V) × (w : V) × Q v w)), IsMixedSeparator X F s t ∧ f.val = ∑ v ∈ X, c v + ∑ a ∈ F, cap a.snd.snd

          Max-flow/min-cut for mixed capacities. For distinct terminals, nonnegative arrow capacities and nonnegative capacities on the nonterminal vertices, some ordinary flow respecting the vertex capacities has value equal to the weight of some mixed separator.