ArticleslgStudy

computer science

Chang and Roberts algorithm

Chang and Roberts algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Chang and Roberts algorithm rather than just read about it. In short: The Chang and Roberts algorithm is a ring-based coordinator election algorithm, employed in distributed computing. It was initially published by Ernest Chang and Rosemary Roberts in 1979.

Key takeaways

  • Chang and Roberts algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Chang and Roberts algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Chang and Roberts algorithm from memory before moving on to harder problems.

Reference excerpt

The Chang and Roberts algorithm is a ring-based coordinator election algorithm, employed in distributed computing. It was initially published by Ernest Chang and Rosemary Roberts in 1979.

The algorithm The algorithm assumes that each process has a Unique Identification (UID) and that the processes can arrange themselves in a unidirectional ring with a communication channel going from each process to the clockwise neighbour. The two part algorithm can be described as follows:

Initially each process in the ring is marked as non-participant. A process that notices a lack of leader starts an election. It creates an election message containing its UID. It then sends this message clockwise to its neighbour. Every time a process sends or forwards an election message, the process also marks itself as a participant. When a process receives an election message it compares the UID in the message with its own UID. If the UID in the election message is larger, the process unconditionally forwards the election message in a clockwise direction. If the UID in the election message is smaller, and the process is not yet a participant, the process replaces the UID in the message with its own UID, sends the updated election message in a clockwise direction. If the UID in the election message is smaller, and the process is already a participant (i.e., the process has already sent out an election message with a UID at least as large as its own UID), the process discards the election message. If the UID in the incoming election message is the same as the UID of the process, that process starts acting as the leader. When a process starts acting as the leader, it begins the second stage of the algorithm.

The leader process marks itself as non-participant and sends an elected message to its neighbour announcing its election and UID. When a process receives an elected message, it marks itself as non-participant, records the elected UID, and forwards the elected message unchanged. When the elected message reaches the newly elected leader, the leader discards that message, and the election is over. Assuming there are no failures this algorithm will finish. The algorithm works for any number of processes N, and does not require any process to know how many processes are in the ring.

Properties The algorithm respects safety: a process will receive an elected message with its own UID only if his UID is greater than others', and only when all processes agree on the same UID. The algorithm also respects liveness. "Participant" and "not participant" states are used so that when multiple processes start an election at roughly the same time, only a single winner will be announced. When there's a single process starting the election, the algorithm requires 3N-1 sequential messages, in the worst case. Worst case is when the process starting the election is the immediate following to the one with greatest UID: it takes N-1 messages for the election message to reach it, then N messages for it to get back its own UID, then other N messages to send everyone in the ring the elected message. This algorithm is not very fault tolerant. Fault tolerance can be increased If every process knows the whole topology, by introducing ACK messages and skipping faulty nodes on sending messages.

See also Distributed computing Leader election Bully algorithm HS algorithm

References

Worked examples

Example 1 — a first encounter with Chang and Roberts algorithm

Start with the simplest possible case. Write down what Chang and Roberts algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Chang and Roberts algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Chang and Roberts algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Chang and Roberts algorithm

In research
Chang and Roberts algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Chang and Roberts algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Chang and Roberts algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Distributed algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Chang and Roberts algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Chang and Roberts algorithm” →

How to study Chang and Roberts algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Chang and Roberts algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Chang and Roberts algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Chang and Roberts algorithm in simple terms?

The Chang and Roberts algorithm is a ring-based coordinator election algorithm, employed in distributed computing. It was initially published by Ernest Chang and Rosemary Roberts in 1979.

Why does Chang and Roberts algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Chang and Roberts algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Chang and Roberts algorithm.

Tags

  • Distributed algorithms

Keep exploring