public class VertexPartition<V,E> extends Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
String |
toString() |
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 setspublic Graph<V,E> getGraph()
public Map<V,Set<V>> getVertexToPartitionMap()
public Collection<Set<V>> getVertexPartitions()
public int numPartitions()
Copyright © 2015. All rights reserved.