public class GSAConnectedComponents<K,VV extends Comparable<VV>,EV> extends Object implements GraphAlgorithm<K,VV,EV,DataSet<Vertex<K,VV>>>
This implementation uses a comparable vertex value as initial component identifier (ID). In the gather phase, each vertex collects the vertex value of their adjacent vertices. In the sum phase, the minimum among those values is selected. In the apply phase, the algorithm sets the minimum value as the new vertex value if it is smaller than the current value.
The algorithm converges when vertices no longer update their component ID value or when the maximum number of iterations has been reached.
The result is a DataSet of vertices, where the vertex value corresponds to the assigned component ID.
|Constructor and Description|
Creates an instance of the GSA Connected Components algorithm.
public GSAConnectedComponents(Integer maxIterations)
maxIterations- The maximum number of iterations to run.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.