|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.algorithms.blockmodel.VertexPartition<V,E>
public class VertexPartition<V,E>
Maintains information about a vertex partition of a graph. This can be built from a map from vertices to vertex sets or from a collection of (disjoint) vertex sets, such as those created by various clustering methods.
Constructor Summary | |
---|---|
VertexPartition(Graph<V,E> g,
Collection<Set<V>> vertex_sets)
Creates an instance based on the specified graph and set of disjoint vertex sets, and generates a vertex-to-partition map based on these sets. |
|
VertexPartition(Graph<V,E> g,
Map<V,Set<V>> partition_map)
Creates an instance based on the specified graph and mapping from vertices to vertex sets, and generates a set of partitions based on this mapping. |
|
VertexPartition(Graph<V,E> g,
Map<V,Set<V>> partition_map,
Collection<Set<V>> vertex_sets)
Creates an instance based on the specified graph, vertex-set mapping, and set of disjoint vertex sets. |
Method Summary | |
---|---|
Graph<V,E> |
getGraph()
Returns the graph on which the partition is defined. |
Collection<Set<V>> |
getVertexPartitions()
Returns a collection of vertex sets, where each vertex in the input graph is in exactly one set. |
Map<V,Set<V>> |
getVertexToPartitionMap()
Returns a map from each vertex in the input graph to its partition. |
int |
numPartitions()
Returns the number of partitions. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VertexPartition(Graph<V,E> g, Map<V,Set<V>> partition_map)
g
- the graph over which the vertex partition is definedpartition_map
- the mapping from vertices to vertex sets (partitions)public VertexPartition(Graph<V,E> g, Map<V,Set<V>> partition_map, Collection<Set<V>> vertex_sets)
g
- the graph over which the vertex partition is definedpartition_map
- the mapping from vertices to vertex sets (partitions)vertex_sets
- the set of disjoint vertex setspublic VertexPartition(Graph<V,E> g, Collection<Set<V>> vertex_sets)
g
- the graph over which the vertex partition is definedvertex_sets
- the set of disjoint vertex setsMethod Detail |
---|
public Graph<V,E> getGraph()
public Map<V,Set<V>> getVertexToPartitionMap()
public Collection<Set<V>> getVertexPartitions()
public int numPartitions()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |