Documentation

CslibFrontier.Computability.Distributed.MinimumSpanningTree.GHS

Event-Driven Fragment-Phase Gallager–Humblet–Spira (GHS) Distributed MST Protocol #

This module formalizes an event-driven fragment-phase execution and seven-type message accounting model (fragLTS) as a milestone step toward #7508, after [GHS83] (Sections 2–4 and Appendix, pp. 68–77).

Model scope and relationship to [GHS83] #

In [GHS83], nodes communicate asynchronously over reliable FIFO links using local state variables (SN, SE(j), FN, LN, best-edge, best-wt, test-edge, in-branch, find-count) and per-node incoming message queues (Appendix rules (1)–(12), pp. 75–77), where adjacent endpoints may temporarily hold asymmetric SE(j) edge states and re-queue premature Connect, Test, and Report messages.

Here FragState, FragAction, fragStep?, and fragLTS model the protocol at the event-driven fragment-phase level while retaining the exact level/phase synchronization guards and seven-message breakdown of Sections 3–4:

Refining the Appendix per-node asynchronous FIFO message-queue state machine onto fragLTS, as well as the nondistinct-weight Connect-cancellation modification (§3, p. 73) and synchronous-awakening 5 N log₂ N time bound (§5, p. 74), remains open in #7508.

Main definitions #

Main results #

References #

Edge states, fragments, and seven-type message accounting #

Classification of an undirected edge in the GHS algorithm ([GHS83], §3, pp. 70–71): basic (undecided), branch (selected MST tree edge), or rejected (non-tree chord inside a single fragment).

Instances For

    Protocol phase of a fragment in the event-driven fragment-merging GHS model (corresponding to Sleeping, Find, Found waiting on Connect(L), and halted termination in [GHS83], §3 & Appendix, pp. 69–77).

    A fragment (verts, level, core, phase) in the event-driven GHS protocol ([GHS83], §§2–3, pp. 68–72).

    • verts : Finset V

      Vertex set of the fragment.

    • level : ℕ

      Nonnegative GHS level L (0 for initial singleton fragments).

    • core : Option (Sym2 V)

      Core edge some e for level ≥ 1 (none at level = 0), whose weight identifies the fragment (FN in [GHS83], §3, p. 70).

    • phase : FragPhase V

      Current protocol phase of the fragment.

    Cumulative counts of the seven message types of [GHS83] (§§3–4, pp. 69–73).

    • connect : ℕ

      Connect(L) messages sent across minimum-weight outgoing edges.

    • initiate : ℕ

      Initiate(L, F, S) messages broadcast outward along fragment branches.

    • test : ℕ

      Test(L, F) probes sent across Basic edges.

    • accept : ℕ

      Accept replies certifying outgoing Basic edges.

    • reject : ℕ

      Reject replies on internal chord Basic edges.

    • report : ℕ

      Report(W) convergecast messages sent inward along fragment branches.

    • changeRoot : ℕ

      Change-root (Change-core) messages sent from the core toward the MOE endpoint.

    Instances For

      Total messages exchanged across all seven GHS message types.

      Global configuration of the event-driven fragment-phase GHS protocol on vertex type V.

      • fragments : Finset (Fragment V)

        Active partition of V into fragments.

      • branchEdges : Finset (Sym2 V)

        Undirected edges currently classified as Branch.

      • rejectedEdges : Finset (Sym2 V)

        Undirected edges currently classified as Rejected.

      • msgs : MsgCount

        Cumulative per-type message counters.

      Edge classification of e in s : FragState V.

      A configuration s has halted once there is a halted fragment in s.fragments (which by the reachable invariant implies s.fragments is a single spanning fragment on Finset.univ).

      Instances For

        Initial quiescent configuration ([GHS83], §3, p. 69 & Appendix, p. 75): each vertex v : V forms a level-0 sleeping singleton fragment, all edges are basic, and all message counters are zero.

        Symmetry-preserving cut helpers and BFS Change-root hop counter #

        Computable Boolean check testing whether both endpoints of e belong to S.

        Computable Boolean check testing whether e has one endpoint in S₁ and one in S₂.

        Whether all internal edges of S in G are non-Basic (Branch or Rejected).

        Number of vertices in S incident to at least one outgoing edge of S in G (each such vertex transmits one successful Test and receives one Accept during a non-final search cycle, [GHS83], §4, p. 73).

        GHS Test/Accept level-delay guard ([GHS83], §3, p. 71 and Appendix rule (6), p. 76): every minimum-weight outgoing edge incident to any vertex u ∈ F.verts leads to a fragment in s.fragments whose level is at least F.level.

        def Cslib.Distributed.MinimumSpanningTree.bfsDist {V : Type u_1} [DecidableEq V] (B : Finset (Sym2 V)) (verts target : Finset V) :
        ℕ → Finset V → ℕ

        Computable BFS hop counter along B inside verts from visited to target with fuel k.

        Number of Change-root (Change-core) messages sent from F.core toward the endpoint of e in F.verts ([GHS83], §3, p. 72).

        Executable fragment-phase transitions and Cslib.LTS #

        Transition labels of the event-driven fragment-phase GHS protocol.

        • wakeupSingleton {V : Type u_1} (v : V) : FragAction V

          Wake up the sole vertex in a 1-vertex graph (0 outgoing edges, immediate halt).

        • wakeup {V : Type u_1} (v : V) (e : Sym2 V) : FragAction V

          Wake up sleeping singleton {v} and send Connect(0) over its minimum-weight incident edge e (Appendix rules (1)–(2), p. 75).

        • rejectChord {V : Type u_1} (F : Fragment V) (e : Sym2 V) (dual : Bool) : FragAction V

          Reject an internal Basic chord e of searching fragment F via Test + Reject (dual = false) or simultaneous dual Test (dual = true, §3, p. 71).

        • completeSearch {V : Type u_1} (F : Fragment V) (e : Sym2 V) : FragAction V

          Complete the Test/Accept/Report/Change-root/Connect search cycle of non-spanning fragment F, discovering minimum-weight outgoing edge e (§3, pp. 71–72).

        • haltSearch {V : Type u_1} (F : Fragment V) : FragAction V

          Complete the final Report(∞) convergecast and halt once F spans Finset.univ and all internal Basic chords are rejected (§3, p. 71 & Appendix rule (10), p. 76).

        • absorb {V : Type u_1} (F₁ F₂ : Fragment V) : FragAction V

          Absorb lower-level fragment F₁ (F₁.level < F₂.level) along F₁'s MOE into F₂, keeping F₂'s level, core, and phase (Find or Found, §3, p. 72).

        • merge {V : Type u_1} (F₁ F₂ : Fragment V) (e : Sym2 V) : FragAction V

          Merge equal-level fragments F₁ and F₂ (F₁.level = F₂.level = L) sharing mutual MOE e into a new searching fragment at level L + 1 with core some e (§3, p. 72).

        Whether an action combines two fragments (absorb or merge).

        Executable single-step transition function of the fragment-phase GHS protocol.

        Executable multi-step trace runner for fragStep?.

        Labelled transition system of the event-driven fragment-phase GHS protocol.

        Instances For

          fragLTS is deterministic since fragStep? is a function into Option (FragState V).

          theorem Cslib.Distributed.MinimumSpanningTree.runFragTrace?_eq_some_iff_mTr {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] [LinearOrder W] (w : Sym2 V → W) (s : FragState V) (as : List (FragAction V)) (s' : FragState V) :
          runFragTrace? G w s as = some s' ↔ (fragLTS G w).MTr s as s'

          Reachability from initFragState V in fragLTS G w.

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.step {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj] [LinearOrder W] {w : Sym2 V → W} {s s' : FragState V} {a : FragAction V} (hr : FragReachable G w s) (htr : (fragLTS G w).Tr s a s') :

          Remaining message budget and inductive state invariant #

          Shared fragment-partition and transition frame lemmas #

          Per-action preservation of FragInv #

          MST subtree invariant, fragment trees, and chord rejection #

          Fragment-phase protocol step toward #7508 (after [GHS83], §§2–3, pp. 68–72; modeling atomic fragment-level phases rather than Appendix per-node FIFO message queues): at every reachable FragState, s.branchGraph is a subgraph of every MST of (G, w) when edge weights are injective on G.edgeSet.

          Fragment-phase protocol step toward #7508 (after [GHS83], §§2–3, pp. 68–72): on a finite connected graph with injective edge weights, s.branchGraph is acyclic at every reachable FragState.

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, pp. 69–72): at every reachable FragState on a connected graph with injective edge weights, every fragment F ∈ s.fragments induces a connected tree in s.branchGraph.

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.rejected_internal_chord {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj] [LinearOrder W] {w : Sym2 V → W} {s : FragState V} (hr : FragReachable G w s) {e : Sym2 V} (he : e ∈ s.rejectedEdges) :
          e ∈ G.edgeSet ∧ ∃ F ∈ s.fragments, ∀ x ∈ e, x ∈ F.verts

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, p. 71): every Rejected edge belongs to G and has both endpoints inside a single fragment.

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.rejected_notMem_isMST {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] [AddCancelCommMonoid W] [LinearOrder W] [IsOrderedCancelAddMonoid W] {G T : SimpleGraph V} [DecidableRel G.Adj] (hconn : G.Connected) {w : Sym2 V → W} (hinj : Set.InjOn w G.edgeSet) {s : FragState V} (hr : FragReachable G w s) (hMST : G.IsMST w T) {e : Sym2 V} (he : e ∈ s.rejectedEdges) :
          e ∉ T.edgeSet

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, p. 71): on a finite connected graph with injective edge weights, no Rejected edge belongs to any MST of (G, w).

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.rejected_not_isMOE {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] [AddCancelCommMonoid W] [LinearOrder W] [IsOrderedCancelAddMonoid W] {G : SimpleGraph V} [DecidableRel G.Adj] (hconn : G.Connected) {w : Sym2 V → W} (hinj : Set.InjOn w G.edgeSet) {s : FragState V} (hr : FragReachable G w s) {e : Sym2 V} (he : e ∈ s.rejectedEdges) (S : Finset V) :
          ¬G.IsMOE w S e

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, p. 71): on a finite connected graph with injective edge weights, no Rejected edge is ever a cut-MOE across any cut S : Finset V.

          Exponential fragment size and logarithmic level bound #

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, p. 72): every reachable fragment at level L contains at least 2 ^ L vertices.

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, p. 72): every reachable fragment has level at most Nat.log 2 (Fintype.card V).

          Deadlock-freedom and minimum-level smallest-MOE progress #

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.exists_absorb_or_merge_of_minLevel_found {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj] [LinearOrder W] {w : Sym2 V → W} (hinj : Set.InjOn w G.edgeSet) {s : FragState V} (hr : FragReachable G w s) {L_min : ℕ} (hex_min : ∃ F ∈ s.fragments, F.level = L_min) (hle_min : ∀ F ∈ s.fragments, L_min ≤ F.level) (hfound_min : ∀ F ∈ s.fragments, F.level = L_min → ∃ (e : Sym2 V), F.phase = FragPhase.found e) :
          ∃ (a : FragAction V) (s' : FragState V), a.isCombine = true ∧ (fragLTS G w).Tr s a s'

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, pp. 72–73): under injective edge weights, whenever every fragment of minimum level L_min is in phase found (and at least one fragment has level L_min), some minimum-level fragment has an enabled absorb or mutual merge transition in fragLTS G w (no waiting cycle can occur).

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.exists_step_of_not_halted {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] {G : SimpleGraph V} [DecidableRel G.Adj] (hconn : G.Connected) [LinearOrder W] {w : Sym2 V → W} (hinj : Set.InjOn w G.edgeSet) {s : FragState V} (hr : FragReachable G w s) (hnot : ¬s.Halted) :
          ∃ (a : FragAction V) (s' : FragState V), (fragLTS G w).Tr s a s'

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, pp. 72–73): on a finite connected graph with injective edge weights, every non-halted reachable FragState has at least one enabled transition in fragLTS G w.

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, pp. 72–73): a reachable FragState is terminal in fragLTS G w if and only if s.Halted holds.

          Exact MST termination, combine-step bound, and 5 N log₂ N + 2 E message complexity #

          Fragment-phase protocol step toward #7508 (after [GHS83], §§2–3, pp. 68–73): at every halted reachable FragState, s.branchGraph is the unique minimum-weight spanning tree of (G, w) and s.rejectedEdges = G.edgeFinset \ s.branchEdges.

          Fragment-phase protocol step toward #7508 (after [GHS83], §§2–3, pp. 68–73): every finite execution trace from initFragState V performs at most Fintype.card V - 1 fragment-combining (absorb or merge) steps (when Nonempty V, and 0 when IsEmpty V).

          Fragment-phase protocol step toward #7508 (after [GHS83], §§2–3, pp. 68–73): every complete execution trace (μs ∈ (fragLTS G w).completeTraces (initFragState V)) on a finite connected graph with injective edge weights reaches a halted state whose branchGraph is the unique MST of (G, w) after exact Fintype.card V - 1 combine steps.

          theorem Cslib.Distributed.MinimumSpanningTree.FragReachable.exists_mTr_halted {V : Type u_1} {W : Type u_2} [Fintype V] [DecidableEq V] [AddCancelCommMonoid W] [LinearOrder W] [IsOrderedCancelAddMonoid W] {G : SimpleGraph V} [DecidableRel G.Adj] (hconn : G.Connected) {w : Sym2 V → W} (hinj : Set.InjOn w G.edgeSet) {s : FragState V} (hr : FragReachable G w s) :
          ∃ (as : List (FragAction V)) (s' : FragState V), (fragLTS G w).MTr s as s' ∧ s'.Halted ∧ G.IsMST w s'.branchGraph

          Fragment-phase protocol step toward #7508 (after [GHS83], §3, pp. 72–73): from every reachable FragState on a finite connected graph with injective edge weights, a multi-step execution reaches a halted state whose branchGraph is the unique MST of (G, w).

          Fragment-phase protocol step toward #7508 (after [GHS83], §4, p. 73; counting the seven message types of fragStep?): at every reachable FragState (including termination), total messages exchanged satisfy s.msgs.total ≤ 5 * Fintype.card V * Nat.log 2 (Fintype.card V) + 2 * G.edgeFinset.card.

          Fragment-phase protocol step toward #7508 (after [GHS83], §4, p. 73; sharpened halted-state message bound for 2 ≤ Fintype.card V, tight at s.msgs.total = 6 on K₂): s.msgs.total + 4 * Fintype.card V ≤ 5 * Fintype.card V * Nat.log 2 (Fintype.card V) + 2 * G.edgeFinset.card + 2.