K
- vertex identifier typeVV
- vertex value type which is used for comparisonEV
- edge value typepublic 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 |
---|---|
static class |
LabelPropagation.SendNewLabelToNeighbors<K,VV extends Comparable<VV>>
Sends the vertex label to all out-neighbors.
|
static class |
LabelPropagation.UpdateVertexLabel<K,VV extends Comparable<VV>>
Function that updates the value of a vertex by adopting the most frequent label among its
in-neighbors.
|
Constructor and Description |
---|
LabelPropagation(int maxIterations)
Creates a new Label Propagation algorithm instance.
|
public LabelPropagation(int maxIterations)
maxIterations
- The maximum number of iterations to run.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.