In order to take into account the weight of a node or relationship, we can update the majority vote rule so that it does not only count the number of nodes with a given label but sums their weight. The selected label will then be the one with the highest sum of weights.
Let's consider the weighted version of the preceding graph illustrated in the following figure:
This time, in order to choose the label for node D, we have to take into account the weights of each edge connected to D:
- Weight for the CR community = 1 (C) + 8 (D) = 9
- Weight for the CG community = 1 (E) + 2 (G) = 3
Hence, in this weighted version of the graph, node D would belong to the CR community.