Coloring with Randomized Algorithms

Randomized Algorithms:

Randomized Algorithms can be classified into two types:

  1. Las-Vegas Algorithms: Algorithms which provide correct solutions (i.e., doesn’t fail on any input), but running time of the algorithm is a random variable and is expressed in terms of expected runtime.
  2. Monte-Carlo Algorithms: Algorithms whose running time complexity is determined/fixed but the algorithm doesn’t necessarily produce correct solutions. The algorithm’s success/failure is a random variable. It could be bounded by a probability. A common term used is “Algorithm runs with high probability”. This means that the probability of algorithm providing a incorrect output (failure) can be bounded as , where is a constant related to running time (usually hidden due to asymptotic notation).

Union-Bound:

Let be the event that node fails to compute the solution properly. Then the union bound tells us that

This is straightforward from the inclusion-exclusion principle, where we drop the higher order terms.

3-coloring Randomized Algorithm:

Here is a fairly straightforward algorithm. Each node has a flag , indicating whether it has stopped or not, and value . Once is , the node outputs .

In each step, every node with its flag set to , picks a new color from uniformly at random. Then each node sends it current color to its neighbor. If is different from that of its neighbors, then the flag is set to and the node stops. Otherwise this continues.

It is easy to see that in each step, a node will stop with probability . Fix a positive constant . Let

where is the number of nodes in the graph. Now if we run this algorithm for steps, the probability that a given node has not stopped is

By the union bound, the probability that there is a node that has not stopped is at most

Thus, with probability at least , all nodes have stopped after steps. For any given constant , there is an algorithm that runs for = rounds and produces a proper 3-coloring of a path with probability .

+1 Randomized Coloring algorithm:

Outline:

  • Initially every node is in sleep state.
  • At -th iteration:
    • Each node wakes up with a probability .
    • If a node is awake, it picks up uniformly where is the set of admissible colors. Initially . Send to the neighbors.
    • If , fixes and send that it is fixed to its neighbor.
    • All nodes then update by removing all the fixed colors.
    • Go back to sleep.

It is straightforward that the algorithm computes a proper coloring, since the algorithm runs as long as there is a conflict in the coloring and terminates only when all the nodes are fixed which is when the graph has a proper coloring.

Analysis:

Claim:

The algorithm terminates in rounds with high probability.

Proof:

Let be the event such that is not picked by any neighbor of . Let be the neighborhood of that has not yet been fixed. Consider a .

Probability that picks = Probability that picks given wakes up + Probability that picks given doesn’t wake up .

Therefore, by union bound,

Let be the event that colors itself by iteration .

Using and Using these two, we get

and is complement of . Therefore

Therefore, for some , . Therefore, by union bound, the probability that algorithm does not terminate by -th iteration will be . Thus, the running time of this algorithm is with high probability.

Tail bounds:

Chernoff bound:

Let are independent random variables. Let , where

Then, for any ,

Markov’s Inequality:

Let be a random variable. Then for any ,

Exercises:

Will be added soon

Resources:

  • CS6851 Distributed Algorithms Jul-Nov 25 Offering by Prof. Shreyas Pai