Sources grouped here: Message Passing Algorithms.pdf and Distributed-Spannig Tree.pdf.

Core idea

Processes know only local information. They use messages and a tree-shaped communication backbone to spread information, collect information, and construct a minimum-cost network structure.

1. Message-passing model

assets/slide-figures/message-passing-network.png

Slide visual - message-passing topology

Processes are graph nodes; communication channels are the edges. A node initially knows only its local incident channels.

  • Processes communicate by sending messages over communication channels.
  • A channel connects two specific processes and is bidirectional; the pattern of channels is the system topology (a graph).
  • Formally, a system has n processors P0, P1, ..., P(n-1) as graph nodes and point-to-point channels as graph edges.
  • A process can label its incident channels 1, 2, ... without necessarily knowing which process is at the other end.
Plain meaning

Each computer knows the doors connected directly to it, not necessarily the full road map or everyone behind each door.

Modeling a processor and channel

  • A processor is a state machine: it has local state and mechanisms representing channels.
  • Directed channel from P_i to P_j is represented in two pieces:
    • outbuf at sender P_i - outgoing message buffer, representing the physical channel from sender’s view;
    • inbuf at receiver P_j - incoming-message queue.
  • A process can access its local variables and its incoming buffers. Outgoing buffers represent messages in transit and are not directly accessible to the receiver until delivery.

Configuration, events, and execution

assets/slide-figures/message-delivery-event.png

Slide visual - delivery event

Delivery moves a message from the sender’s outgoing buffer to the receiver’s incoming buffer, where it becomes available for computation.

  • A configuration is the vector of all processor states, including their outgoing buffers/channels. It is a snapshot of the entire system.

  • Two event types are used:

    1. Deliver event: moves a message from sender’s outbuf to receiver’s inbuf; it becomes available when receiver next takes a step.
    2. Computation event: occurs at one processor. It starts with its accessible state (local variables + incoming messages), applies the state-transition function, consumes/handles input, and ends with new local state, empty input buffers, and new outgoing messages.
  • An execution is a sequence:

    Initial configuration: processors are in initial states and all inbufs are empty. Each later configuration differs only according to the delivered message or the computation transition at one process.

2. Asynchronous and synchronous systems

ModelMeaningAdmissible execution / time
AsynchronousNo fixed upper bound on message delay or time between processor steps. Example: Internet/email.Every message in an outbuf is eventually delivered and every processor takes infinitely many steps. Delays and speeds are otherwise arbitrary.
SynchronousProcessors operate in lockstep rounds. In each round they can send to neighbours, messages are delivered, then processes compute from received messages.The round structure implies delivery and infinitely many steps. Time is the number of rounds to termination.

An asynchronous admissible execution models reliable communication/no stopped processor, but not predictable timing.

3. Broadcast over a rooted spanning tree

Tree concepts

  • A tree is a connected graph with no cycles.
  • A spanning tree contains every processor of the communication graph.
  • A rooted spanning tree has one distinguished root.
  • Each process stores local parent and children variables identifying its tree edges.

Broadcast algorithm

Goal: send information/message M from root to every process.

  1. Root initially sends M to all its children.
  2. When a non-root receives M from its parent, it forwards M to all its children.
  3. It terminates/sets a local completion flag.

Because each tree edge is used once in the parent-to-child direction, every node receives exactly one copy and no cycle causes duplicates.

assets/slide-figures/broadcast-execution.png

Slide visual - broadcast execution

The first view shows the source spreading the message; the second shows the message moving outward through the rooted tree.

Complexity

  • Messages: n-1, one per spanning-tree edge.
  • Time: tree depth d; in a chain, at most n-1.
  • These bounds are the same in the synchronous and asynchronous presentation: completion depends on the longest root-to-leaf chain, not on non-tree edges.
Plain meaning

The root tells its children, each child tells its children, and so on - like a controlled phone tree.

4. Convergecast

assets/slide-figures/convergecast-execution.png

Slide visual - convergecast execution

Information moves in the reverse direction: leaves report upward and intermediate nodes combine values before forwarding.

Convergecast is the reverse of broadcast and collects information at the root.

  1. Leaves send their values to their parents.
  2. A non-leaf waits until it has received a value from every child.
  3. It combines/aggregates the child values with its own information and sends the result to its parent.
  4. The root finally has the aggregate.

Examples of aggregation: sum, maximum ID (leader election), minimum edge weight, count, or an AND/OR result.

Plain meaning

Broadcast is the root distributing a question; convergecast is everyone sending their answers back up the tree.

PYQ — CT1 2026, Q3: sensor aggregation

Original CT1 2026 Q3 with the sensor tree and all three parts

In a tree, has children ; has children ; and has child . Their readings are respectively 10, 20, 15, 30, 25 and 40. Give the message order, sum, and number of rounds for convergecast.
Answer
  1. In round 1, and send 30 and 25 to , and sends 40 to .
  2. In round 2, sends to , and sends to .
  3. The root adds its own reading: . The tree depth is two, so two synchronous communication rounds are required, assuming each edge transmission takes one round.

5. Constructing a spanning tree when a root is known

The root can build a spanning tree by modified flooding.

Informal protocol

  1. Root sends M to all neighbours and marks itself as root/parent of itself.
  2. When a non-root receives M for the first time from neighbour p:
    • set p as parent;
    • send parent acknowledgement to p;
    • send M to every other neighbour.
  3. If it later receives another M, send already/reject to that sender.
  4. On parent from neighbour, add that neighbour to children.
  5. On already from neighbour, record it as a non-child (other).
  6. A node terminates after it has heard from every neighbour other than its parent, because each is now either a child or other.

Initial local state for non-roots: , , .

Shape of the resulting tree

  • In a synchronous execution, first receipt corresponds to shortest-hop distance, so flooding yields a BFS tree.
  • In an asynchronous execution, arbitrary message arrival order decides the first parent. The result need not be BFS, need not be DFS, and can be another spanning tree.

assets/slide-figures/spanning-tree-execution.png

Slide visual - synchronous versus asynchronous tree construction

Synchronous flooding gives a breadth-first tree. Arbitrary first-message arrivals in an asynchronous run can form a different spanning tree.

6. Minimum spanning tree (MST)

Definition and usefulness

In an undirected weighted graph, a minimum spanning tree is a spanning tree whose total edge weight is as small as possible.

assets/slide-figures/mst-example.png

Slide visual - minimum spanning tree

The bold selected edges connect every node without cycles while minimizing the sum of selected edge weights.

  • For broadcast, flooding over an MST has the minimum total selected-edge cost.
  • For point-to-point routing, the source slides state it minimizes the maximum weight on the path between two nodes.
  • Once built, the MST is a clean backbone for broadcasts, convergecasts, leader election, and global aggregation.

7. GHS distributed MST algorithm

GHS is the Gallager-Humblet-Spira distributed minimum-spanning-tree algorithm.

Assumptions:

  • each node knows its incident edges and their weights;
  • nodes have unique IDs (UIDs);
  • construction proceeds in levels/components.

High-level idea

  1. Start as a forest of n one-node components.
  2. For each component, find its minimum-weight outgoing edge (MWOE).
  3. Merge components through selected MWOEs.
  4. Update leadership/component information.
  5. Repeat levels until one component covers all nodes.

Level 0

  • There are n separate one-node trees.
  • No edges are selected.
  • Each node knows its own UID and is its component leader.

Step 1: search for an MWOE

  • The component leader initiates a search/broadcast within its current component (described as BFS in the source).
  • Every node examines incident edges.
  • A test message asks a neighbour for its component identity.

Step 2: identify outgoing edges

  • Compare component leader UIDs at an edge’s endpoints.
  • Same UID means both endpoints are in the same component: the edge is internal.
  • Different UIDs means it connects distinct components: the edge is outgoing.
  • Each node keeps its least-weight outgoing candidate.

assets/slide-figures/ghs-identify-mwoe.png

Slide visual - identify an MWOE

Matching component IDs means an internal edge; different IDs expose an outgoing edge, from which each node keeps its lightest candidate.

Step 3: convergecast candidates

  • Peripheral nodes send their local best candidate toward the component leader.
  • Internal nodes aggregate candidates during convergecast.
  • The leader chooses the global minimum candidate; this is the component MWOE for this merge.

Step 4: merge

  • Leader communicates with the endpoint nodes of the selected MWOE.
  • Endpoints mark the edge as part of the spanning structure.
  • The two components become one component.

New leader and simultaneous merges

  • After a merge, the endpoints know each other’s UIDs; the source selects the larger UID as new leader and broadcasts it through the merged component.
  • Several trees can potentially merge at once. The selected edges form a tree of component-trees, not a cycle: orient selected edges so each component has an outgoing edge; there must be a mutually selected pair, otherwise following pointers forever would require an infinite structure. Use that pair for a controlled merge and update leader identity.

assets/slide-figures/ghs-convergecast-mwoe.png

Slide visual - selecting the merged-component leader

After an MWOE merge, the larger component UID becomes leader and the new identity is broadcast across the merged component.

Plain meaning

Each little tree finds the cheapest cable leading outside itself. Adding cheapest safe links grows the forest without wasting expensive links or creating cycles.

Why levels matter

  • Independent components merging without control can conflict.
  • Two level-0 components make a level-1 component.
  • A level-0 plus level-1 component produces level 1.
  • Equal-level merges advance to the next level.
  • Levels order the work and prevent conflicting activity; each level’s smallest component grows at least geometrically/doubles.

Termination

Eventually only one component remains. Its leader starts another MWOE search. If every neighbour reports the same component leader UID, no outgoing edge exists. The leader knows its tree spans the full network and stops.

Complexity

The source gives two closely related presentations:

  • At each level, constant numbers of broadcasts/convergecasts cost O(n) time; at most O(log n) levels, so time is O(n log n).
  • One slide summarizes communication as O(n log n + |E|) messages; the detailed level-based slide states O((n + e) log n), where n is nodes and e is edges. Use the latter when quoting the detailed construction analysis, and state the source also presents the former summary.

8. Using the constructed tree for leader election

The MST is not only a low-cost tree; it is reusable infrastructure:

  1. Leaves initiate a convergecast containing their unique comparable UIDs.
  2. Each internal node waits for descendants, combines their data (for election, retain best UID), and forwards upward.
  3. If final neighbouring candidates remain, the node with higher UID becomes leader.

The tree makes global aggregation much simpler than sending messages over every edge in the original graph.

Fast recall

Broadcast goes down; convergecast comes up; flooding chooses the first parent; GHS repeatedly chooses the MWOE.

9. Quick comparison for revision

OperationDirectionPurposeKey cost/result
Broadcastroot -> leavesdistribute one message to alln-1 messages, time = tree depth
Convergecastleaves -> rootcollect/aggregate informationwaits for all children
Flooding tree constructionroot outwardcreate a spanning treeBFS in synchronous setting; arbitrary spanning tree in asynchronous setting
GHScomponent-to-componentconstruct a minimum-weight spanning treerepeated MWOE search/merge; O(n log n) time

10. PYQ coverage check

The 2026 CT directly asks about convergecast; the worked answer appears in Section 4. No other supplied PYQ directly asks about message-passing configurations/events, broadcast, rooted spanning-tree construction, MSTs, or the GHS algorithm. The papers do ask leader election, but those questions are collected in 02-leader-election.md; clock/synchronization questions are collected in 01-introduction-clocks-synchronization.md.

Revision implication: Most of Sections 1–8 are lecture-note material rather than repeated PYQ material, so prepare at least one full answer each for: message-passing system model, broadcast versus convergecast, flooding construction, and GHS/MWOE complexity.