NodeNameType
- The class-type of the nodes in the graph this
references.public static class Louvain.LouvainHierarchy<NodeNameType> extends java.lang.Object implements NodePartitioning<NodeNameType>
Modifier and Type | Method and Description |
---|---|
java.util.Set<NodeNameType> |
getAllMembers()
Returns all nodes stored within this partitioning
|
int |
getCommunityForNodeAtLevel(NodeNameType n,
int level)
Returns the community ID for the input node at the input level
|
int |
getCommunityForNodeAtLevelById(int nodeId,
int level) |
java.lang.Double |
getModularity()
Returns the modularity for this community specification.
|
double |
getModularity(int level)
Returns the modularity at the input level of the hierarchy.
|
int |
getNumCommunitiesAtLevel(int level)
Returns the number of communities at the input level of the
hierarchy.
|
int |
getNumPartitions()
Return the number of partitions in this partitioning
|
int |
getPartition(NodeNameType n)
Returns the partition id for the input node
|
int |
getPartitionById(int nodeId)
Returns the partition id for the input node
|
java.util.Set<NodeNameType> |
getPartitionMembers(int i)
Returns the members of the ith partition
|
int |
numLevels()
The number of levels in the hierarchy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
printPartitioning
public int numLevels()
public double getModularity(int level)
level
- The level to check onjava.lang.IllegalArgumentException
- if the input level isn't in this
datastructure.public int getNumCommunitiesAtLevel(int level)
level
- The level to check onjava.lang.IllegalArgumentException
- if the input level isn't in this
datastructure.public int getCommunityForNodeAtLevel(NodeNameType n, int level)
n
- The node to search forlevel
- The level to search onjava.lang.IllegalArgumentException
- if the input node isn't in the
graph, or if the level isn't validpublic int getCommunityForNodeAtLevelById(int nodeId, int level)
public int getPartition(NodeNameType n)
NodePartitioning
getPartition
in interface NodePartitioning<NodeNameType>
n
- The node whose partition is desiredpublic int getPartitionById(int nodeId)
NodePartitioning
getPartitionById
in interface NodePartitioning<NodeNameType>
nodeId
- The node's ID (from the graph) whose partition is desiredpublic int getNumPartitions()
NodePartitioning
getNumPartitions
in interface NodePartitioning<NodeNameType>
public java.util.Set<NodeNameType> getPartitionMembers(int i)
NodePartitioning
getPartitionMembers
in interface NodePartitioning<NodeNameType>
i
- the 0-based index into the partitioningpublic java.util.Set<NodeNameType> getAllMembers()
NodePartitioning
getAllMembers
in interface NodePartitioning<NodeNameType>
public java.lang.Double getModularity()
NodePartitioning
getModularity
in interface NodePartitioning<NodeNameType>