Class ChineseWhispers.Builder<V,​E>

    • Field Detail

      • ITERATIONS

        public static final int ITERATIONS
        The default number of Chinese Whispers iterations.
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • build

        public ChineseWhispers<V,​E> build​(org.jgrapht.Graph<V,​E> graph)
        Description copied from interface: ClusteringBuilder
        Construct an instance of the clustering algorithm with the parameters specified in the builder.
        Specified by:
        build in interface ClusteringBuilder<V,​E,​ChineseWhispers<V,​E>>
        Parameters:
        graph - the graph
        Returns:
        a fully-configured clustering algorithm
      • setWeighting

        public ChineseWhispers.Builder<V,​E> setWeighting​(NodeWeighting<V,​E> weighting)
        Set the the node weighting approach.
        Parameters:
        weighting - the node weighting approach
        Returns:
        the builder
      • setIterations

        public ChineseWhispers.Builder<V,​E> setIterations​(int iterations)
        Set the maximal number of iterations.
        Parameters:
        iterations - the maximal number of iterations
        Returns:
        the builder
      • setRandom

        public ChineseWhispers.Builder<V,​E> setRandom​(Random random)
        Set the random number generator.
        Parameters:
        random - the random number generator
        Returns:
        the builder