# Leader election algorithm in a grid

I have to write a leader election algorithm in an unoriented mesh (a grid a*b), with many initiators.

Someone give me an indication to wake up each node and then make an election in the exterior ring between the 4 corners. But I don't found anything on the web :/ For the wake-up process I think I can use a wake flood algorithm, but for the leader election, I'm out... Thank's.

• What are you trying to achieve with the algorithm, and why is this research level? As it stands the question sounds like a standard textbook exercise. – András Salamon Jan 15 '15 at 13:30

One simple way would be something like this:

For each processor:
1. myID = Some unique ID
3. Loop forever:
3.1 For each neighbour:

Of course you can bound the number of iterations by a + b + 1 (if you have a synchronized way to make each one work on it's turn) since this is the maximum "jumps" an ID has to make is from one corner to the corner on the other side of the board.