netkit.util
Class ModularityClusterer

java.lang.Object
  extended by netkit.util.ModularityClusterer

public final class ModularityClusterer
extends java.lang.Object

Modularity-based clusterer, extended to work with weights, multiple edges, and directed edges. Self-loops are ignored. All edges are directed. For bidirectional edges, use two opposite edges with equal weights.

Author:
Evan Gamble (egamble@fetch.com), Sofus A. Macskassy (sofmac@gmail.com)
See Also:
Clauset, M. Newman and C. Moore, "Finding community structure in very large networks."

Nested Class Summary
 class ModularityClusterer.Cluster
           
 
Constructor Summary
ModularityClusterer(Graph g)
           
 
Method Summary
static void buildNodeCluster(java.util.Set<Node> nodeCluster, ModularityClusterer.Cluster c)
           
 java.util.List<java.util.Set<Node>> getConnectedClusterNodeSets()
           
 java.util.Set<ModularityClusterer.Cluster> getConnectedClusters()
           
 Graph getGraph()
           
 java.util.List<java.util.Set<Node>> getIsolatedClusterNodeSets()
           
 java.util.Set<ModularityClusterer.Cluster> getIsolatedClusters()
           
 int getNumClusterNodes()
           
 int getNumConnectedClusters()
           
 int getNumIsolatedClusters()
           
 int getNumSingletons()
           
 boolean isActive()
           
static void main(java.lang.String[] args)
           
 double percentDone()
           
 void startClustering()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModularityClusterer

public ModularityClusterer(Graph g)
Method Detail

startClustering

public void startClustering()

getIsolatedClusters

public java.util.Set<ModularityClusterer.Cluster> getIsolatedClusters()

getIsolatedClusterNodeSets

public java.util.List<java.util.Set<Node>> getIsolatedClusterNodeSets()

getConnectedClusters

public java.util.Set<ModularityClusterer.Cluster> getConnectedClusters()

getConnectedClusterNodeSets

public java.util.List<java.util.Set<Node>> getConnectedClusterNodeSets()

getNumConnectedClusters

public int getNumConnectedClusters()

getNumIsolatedClusters

public int getNumIsolatedClusters()

getNumClusterNodes

public int getNumClusterNodes()

getNumSingletons

public int getNumSingletons()

getGraph

public Graph getGraph()

percentDone

public double percentDone()

isActive

public boolean isActive()

stop

public void stop()

buildNodeCluster

public static void buildNodeCluster(java.util.Set<Node> nodeCluster,
                                    ModularityClusterer.Cluster c)

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException