public class VertexPartition<V,E>
extends java.lang.Object
Constructor and Description |
---|
VertexPartition(edu.uci.ics.jung.graph.Graph<V,E> g,
java.util.Collection<java.util.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(edu.uci.ics.jung.graph.Graph<V,E> g,
java.util.Map<V,java.util.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(edu.uci.ics.jung.graph.Graph<V,E> g,
java.util.Map<V,java.util.Set<V>> partition_map,
java.util.Collection<java.util.Set<V>> vertex_sets)
Creates an instance based on the specified graph, vertex-set mapping,
and set of disjoint vertex sets.
|
Modifier and Type | Method and Description |
---|---|
edu.uci.ics.jung.graph.Graph<V,E> |
getGraph()
Returns the graph on which the partition is defined.
|
java.util.Collection<java.util.Set<V>> |
getVertexPartitions()
Returns a collection of vertex sets, where each vertex in the
input graph is in exactly one set.
|
java.util.Map<V,java.util.Set<V>> |
getVertexToPartitionMap()
Returns a map from each vertex in the input graph to its partition.
|
int |
numPartitions()
Returns the number of partitions.
|
java.lang.String |
toString() |
public VertexPartition(edu.uci.ics.jung.graph.Graph<V,E> g, java.util.Map<V,java.util.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(edu.uci.ics.jung.graph.Graph<V,E> g, java.util.Map<V,java.util.Set<V>> partition_map, java.util.Collection<java.util.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(edu.uci.ics.jung.graph.Graph<V,E> g, java.util.Collection<java.util.Set<V>> vertex_sets)
g
- the graph over which the vertex partition is definedvertex_sets
- the set of disjoint vertex setspublic edu.uci.ics.jung.graph.Graph<V,E> getGraph()
public java.util.Map<V,java.util.Set<V>> getVertexToPartitionMap()
public java.util.Collection<java.util.Set<V>> getVertexPartitions()
public int numPartitions()
public java.lang.String toString()
toString
in class java.lang.Object