Class SpectralClustering.Implementation<V,​E>

  • Type Parameters:
    V - the type of nodes in the graph
    E - the type of edges in the graph
    Enclosing class:
    SpectralClustering<V,​E>

    public static class SpectralClustering.Implementation<V,​E>
    extends Object
    Actual implementation of Spectral Clustering.
    • Field Detail

      • clusterer

        protected final org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>> clusterer
        The underlying clustering algorithm.
      • mapping

        protected final org.jgrapht.util.VertexToIntegerMapping<V> mapping
        The mapping of graph nodes to the columns of the graph Laplacian.
    • Constructor Detail

      • Implementation

        public Implementation​(org.jgrapht.Graph<V,​E> graph,
                              org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>> clusterer,
                              int k)
        Create an instance of the Spectral Clustering algorithm implementation.
        Parameters:
        graph - the graph
        clusterer - the clustering algorithm
        k - the number of clusters
    • Method Detail

      • compute

        public org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V> compute()
        Perform clustering with Spectral Clustering.
        Returns:
        the clustering