K- vertex identifier type
VV- vertex value type which is used for comparison
EV- edge value type
public class LabelPropagation<K,VV extends Comparable<VV>,EV> extends Object implements GraphAlgorithm<K,VV,EV,DataSet<Vertex<K,VV>>>
The initial vertex values are used as initial labels and are expected to be
Comparable. In case of a tie (i.e. two or more labels appear with the same frequency), the
algorithm picks the greater label. The algorithm converges when no vertex changes its value or
the maximum number of iterations has been reached. Note that different initializations might lead
to different results.
|Modifier and Type||Class and Description|
Sends the vertex label to all out-neighbors.
Function that updates the value of a vertex by adopting the most frequent label among its in-neighbors.
|Constructor and Description|
Creates a new Label Propagation algorithm instance.
public LabelPropagation(int maxIterations)
maxIterations- The maximum number of iterations to run.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.