Documentation

CslibFrontier.Algorithms.Lean.MaxFlow.VertexSeparator

Minimum vertex separators by vertex splitting #

Given a simple graph G on Fin n and three vertex sets Z, A and B (Boolean vectors), Cslib.Algorithms.Lean.MaxFlow.minSeparator computes a set X of vertices outside Z of minimum size such that Z ∪ X separates A from B (SimpleGraph.IsSeparator). The vertices of Z are forbidden in X, but walks may not pass through them either: X is a minimum separator of A \ Z from B \ Z in G - Z. For the checked Word-RAM running-time bound (O(n ^ 5) instructions), see CslibFrontier.Algorithms.WordRAM.EdmondsKarp.

Construction #

The split network (Cslib.Algorithms.Lean.MaxFlow.vertexSplitNetwork) has a source, a sink, and an in-copy and an out-copy of every vertex (Cslib.Algorithms.Lean.MaxFlow.SplitNode), with capacities (Cslib.Algorithms.Lean.MaxFlow.vertexSplitCap)

This is the standard vertex-splitting construction. Any minimum cut S of this network yields a minimum separator and side certificate via Cslib.Algorithms.Lean.MaxFlow.separatorOfCut: the separator is the set of vertices v ∉ Z whose in-copy lies in S and whose out-copy does not, and side v records whether the out-copy of v lies in S. minSeparator instantiates separatorOfCut with the minimum cut computed by Cslib.Algorithms.Lean.MaxFlow.edmondsKarpDense.

Main definitions #

Main results #

References #

The nodes of the split network on Fin n.

Instances For
    @[instance_reducible]

    The index of a split node: the source is 0, the sink 1, the in-copies 2, …, n + 1 and the out-copies n + 2, …, 2n + 1.

    The split node with a given index, inverse to toFin.

    Split nodes are indexed by Fin (n + n + 2).

    Capacities of the split network: n + 1 from the source to the in-copies of A, from the out-copies of B to the sink and from the out-copy of u to the in-copy of v for each edge G.Adj u v; 1 from the in-copy to the out-copy of each vertex outside Z; 0 otherwise.

    The split network of G for the vertex sets Z, A and B (vertexSplitCap).

    The output of minSeparator.

    • sep : List (Fin n)

      The separator, without repetitions.

    • side : Vector Bool n

      The side labelling: true on the vertices reached from A in G - (Z ∪ sep).

    Extract a separator and side labelling from a cut S of the split network.

    A minimum set X of vertices outside Z such that Z ∪ X separates A from B, by a minimum cut of the split network (edmondsKarpDense on Fin (2n + 2)).

    Correctness #

    The separator extracted from any cut has no repetitions.

    The separator extracted from any cut avoids Z.

    theorem Cslib.Algorithms.Lean.MaxFlow.separatorOfCut_side_eq_of_adj {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {S : Finset (SplitNode n)} (hS : (vertexSplitNetwork G Z A B).IsMinCut S) {u v : Fin n} (huv : G.Adj u v) (hu : vget Z u = false) (hv : vget Z v = false) (hus : u ∉ (separatorOfCut Z S).sep) (hvs : v ∉ (separatorOfCut Z S).sep) :

    For any minimum cut S, the side labelling is constant along edges of G - (Z ∪ sep).

    theorem Cslib.Algorithms.Lean.MaxFlow.separatorOfCut_side_eq_true {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {S : Finset (SplitNode n)} (hS : (vertexSplitNetwork G Z A B).IsMinCut S) {v : Fin n} (hA : vget A v = true) (hZ : vget Z v = false) (hvs : v ∉ (separatorOfCut Z S).sep) :

    For any minimum cut S, the side labelling is true on A \ (Z ∪ sep).

    For any minimum cut S, the side labelling is false on B.

    theorem Cslib.Algorithms.Lean.MaxFlow.separatorOfCut_isSeparator {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {S : Finset (SplitNode n)} (hS : (vertexSplitNetwork G Z A B).IsMinCut S) :
    G.IsSeparator {v : Fin n | vget A v = true} {v : Fin n | vget B v = true} ({v : Fin n | vget Z v = true} ∪ {v : Fin n | v ∈ (separatorOfCut Z S).sep})

    Separation for any minimum cut S: Z ∪ (separatorOfCut Z S).sep separates A from B.

    theorem Cslib.Algorithms.Lean.MaxFlow.separatorOfCut_length_sep_le {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {S : Finset (SplitNode n)} (hS : (vertexSplitNetwork G Z A B).IsMinCut S) {Y : Finset (Fin n)} (hY : G.IsSeparator {v : Fin n | vget A v = true} {v : Fin n | vget B v = true} ({v : Fin n | vget Z v = true} ∪ ↑Y)) :

    Minimality for any minimum cut S: if Z ∪ Y separates A from B, the extracted separator has at most |Y| vertices.

    For any minimum cut S, the extracted separator size equals the cut capacity.

    The separator has no repetitions.

    The separator avoids Z.

    theorem Cslib.Algorithms.Lean.MaxFlow.minSeparator_side_eq_of_adj {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {u v : Fin n} (huv : G.Adj u v) (hu : vget Z u = false) (hv : vget Z v = false) (hus : u ∉ (minSeparator G Z A B).sep) (hvs : v ∉ (minSeparator G Z A B).sep) :
    vget (minSeparator G Z A B).side u = vget (minSeparator G Z A B).side v

    The side labelling is constant along the edges of G - (Z ∪ sep).

    theorem Cslib.Algorithms.Lean.MaxFlow.minSeparator_side_eq_true {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {v : Fin n} (hA : vget A v = true) (hZ : vget Z v = false) (hvs : v ∉ (minSeparator G Z A B).sep) :

    The side labelling is true on the vertices of A outside Z ∪ sep.

    The side labelling is false on B.

    theorem Cslib.Algorithms.Lean.MaxFlow.minSeparator_isSeparator {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} :
    G.IsSeparator {v : Fin n | vget A v = true} {v : Fin n | vget B v = true} ({v : Fin n | vget Z v = true} ∪ {v : Fin n | v ∈ (minSeparator G Z A B).sep})

    Separation. Z ∪ sep separates A from B.

    theorem Cslib.Algorithms.Lean.MaxFlow.minSeparator_length_sep_le {n : ℕ} {G : SimpleGraph (Fin n)} [DecidableRel G.Adj] {Z A B : Vector Bool n} {Y : Finset (Fin n)} (hY : G.IsSeparator {v : Fin n | vget A v = true} {v : Fin n | vget B v = true} ({v : Fin n | vget Z v = true} ∪ ↑Y)) :

    Minimality. If Z ∪ Y separates A from B, the separator has at most |Y| vertices.