Sources grouped here: Message Passing Algorithms.pdf and Distributed-Spannig Tree.pdf.
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
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
nprocessorsP0, 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.
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_itoP_jis represented in two pieces:outbufat senderP_i- outgoing message buffer, representing the physical channel from sender’s view;inbufat receiverP_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
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:
- Deliver event: moves a message from sender’s
outbufto receiver’sinbuf; it becomes available when receiver next takes a step. - 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.
- Deliver event: moves a message from sender’s
-
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
| Model | Meaning | Admissible execution / time |
|---|---|---|
| Asynchronous | No 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. |
| Synchronous | Processors 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
parentandchildrenvariables identifying its tree edges.
Broadcast algorithm
Goal: send information/message M from root to every process.
- Root initially sends
Mto all its children. - When a non-root receives
Mfrom its parent, it forwardsMto all its children. - 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.
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 mostn-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.
The root tells its children, each child tells its children, and so on - like a controlled phone tree.
4. Convergecast
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.
- Leaves send their values to their parents.
- A non-leaf waits until it has received a value from every child.
- It combines/aggregates the child values with its own information and sends the result to its parent.
- The root finally has the aggregate.
Examples of aggregation: sum, maximum ID (leader election), minimum edge weight, count, or an AND/OR result.
Broadcast is the root distributing a question; convergecast is everyone sending their answers back up the tree.
PYQ — CT1 2026, Q3: sensor aggregation
- In round 1, and send 30 and 25 to , and sends 40 to .
- In round 2, sends to , and sends to .
- 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
- Root sends
Mto all neighbours and marks itself as root/parent of itself. - When a non-root receives
Mfor the first time from neighbourp:- set
pas parent; - send
parentacknowledgement top; - send
Mto every other neighbour.
- set
- If it later receives another
M, sendalready/reject to that sender. - On
parentfrom neighbour, add that neighbour tochildren. - On
alreadyfrom neighbour, record it as a non-child (other). - 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.
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.
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
- Start as a forest of
none-node components. - For each component, find its minimum-weight outgoing edge (MWOE).
- Merge components through selected MWOEs.
- Update leadership/component information.
- Repeat levels until one component covers all nodes.
Level 0
- There are
nseparate 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
testmessage 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.
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.
After an MWOE merge, the larger component UID becomes leader and the new identity is broadcast across the merged component.
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 mostO(log n)levels, so time isO(n log n). - One slide summarizes communication as
O(n log n + |E|)messages; the detailed level-based slide statesO((n + e) log n), wherenis nodes andeis 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:
- Leaves initiate a convergecast containing their unique comparable UIDs.
- Each internal node waits for descendants, combines their data (for election, retain best UID), and forwards upward.
- 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.
Broadcast goes down; convergecast comes up; flooding chooses the first parent; GHS repeatedly chooses the MWOE.
9. Quick comparison for revision
| Operation | Direction | Purpose | Key cost/result |
|---|---|---|---|
| Broadcast | root -> leaves | distribute one message to all | n-1 messages, time = tree depth |
| Convergecast | leaves -> root | collect/aggregate information | waits for all children |
| Flooding tree construction | root outward | create a spanning tree | BFS in synchronous setting; arbitrary spanning tree in asynchronous setting |
| GHS | component-to-component | construct a minimum-weight spanning tree | repeated 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.








