Specifically, at each iteration the algorithm analyzes each vertex v in random order and assigns it to the majority class among those associated with its neighbors.
it assigns each vertex v to the class c that maximizes the sum of the weights of the edges {u, v} incident on v such that c is the class of u, according to the following formula: Algorithm 2 The Chinese Whispers algorithm.