About Me | Hunch | Twitter

Two Generals Solution - Human Breadcrumbs

written by matt, on Mar 10, 2010 12:28:00 PM.

I was recently introduced to the Two Generals' Problem at work as a thought experiment illustrating the impossibility of perfect coordination over an unreliable communication channel. I thought of a solution that doesn't require any improbable assumptions. Here is my algorithm:

1) Tell a group of messengers a time to attack

2) Send them all across at once

3) At equally spaced intervals along the route, have them leave one person behind such that each person left behind can see the last person left behind.

4) If at any time someone is captured, relay the "error" message backward and forward via each node. The sending general then sends more messengers to rebuild the link if it hasn't already been completed and increases the time of attack into the future. If someone was captured in the middle, when the message gets to the pack of traveling messengers, they invalidate their time and wait for a new time.

5) If the sending general doesn't get any notices of capture back before the attack time he sent out, he attacks. If the receiving general gets the message and no invalidations after some timeout, he attacks at the time he got.

After a lot of argument, I convinced my coworkers (volkan and peter) to accept this solution with only two easy assumptions:

1) That sight is a reliable communication channel (there are no mirages)

2) The time to cross the valley via foot and via sight hops can be bounded.

  • peter coles
    I still think you need to make clear the assumption that each person in the chain can trust the person in front and behind him, and can reliably determine (and relay a message) if either of them has been compromised (lost ability to transfer message or relay a break in the chain). There’s also a specific timeout of M + 2F (where M is time for the message to be sent across, and F is the maximum time for a failure to be relayed in one direction across the chain). If nothing breaks in that time, then the first general knows that it worked, and the same for the second general (who only needs to wait 2F time from when he receives the message). However, if it breaks at any point in that time, both generals have to assume the message failed.
  • chris dixon
    I dunno. While you are making assumptions, why not just assume you have a Wimax internet connection with Macbooks on each side. Sheesh.