java.lang.Object
es.uam.eps.ir.relison.sna.community.detection.modularity.balanced.SpectralClustering<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
CommunityDetectionAlgorithm<U>
Direct Known Subclasses:
NormalizedCutSpectralClustering, RatioCutSpectralClustering

public abstract class SpectralClustering<U>
extends java.lang.Object
implements CommunityDetectionAlgorithm<U>
Community detection algorithm for balanced communities.

Reference: R. Zafarani, M.A. Abassi, H. Liu. Social Media Mining: An Introduction. Chapter 6. 2014

  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int k
    The number of clusters we want to find.
  • Constructor Summary

    Constructors 
    Constructor Description
    SpectralClustering​(int k)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    Communities<U> detectCommunities​(Graph<U> graph)
    Computes the communities for a certain graph.
    protected abstract cern.colt.matrix.DoubleMatrix2D laplacian​(cern.colt.matrix.DoubleMatrix2D degree, cern.colt.matrix.DoubleMatrix2D adjacency)
    Computes the Laplacian matrix of a graph, given the degree and adjacency matrices.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • k

      private final int k
      The number of clusters we want to find.
  • Constructor Details

    • SpectralClustering

      public SpectralClustering​(int k)
      Constructor.
      Parameters:
      k - The number of clusters we want to find
  • Method Details

    • detectCommunities

      public Communities<U> detectCommunities​(Graph<U> graph)
      Description copied from interface: CommunityDetectionAlgorithm
      Computes the communities for a certain graph.
      Specified by:
      detectCommunities in interface CommunityDetectionAlgorithm<U>
      Parameters:
      graph - The full graph.
      Returns:
      The communities if everything went OK, null if not.
    • laplacian

      protected abstract cern.colt.matrix.DoubleMatrix2D laplacian​(cern.colt.matrix.DoubleMatrix2D degree, cern.colt.matrix.DoubleMatrix2D adjacency)
      Computes the Laplacian matrix of a graph, given the degree and adjacency matrices.
      Parameters:
      degree - the degree matrix of a graph
      adjacency - the adjacency matrix of a graph.
      Returns:
      the Laplacian matrix.