public class VertexPartitionCollapser<V,E,CV,CE>
extends java.lang.Object
Concept based on Danyel Fisher's GraphCollapser
in JUNG 1.x.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.collections4.Factory<CE> |
edge_factory |
protected org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<CV,CE>> |
graph_factory |
protected java.util.Map<java.util.Set<V>,CV> |
set_collapsedv |
protected org.apache.commons.collections4.Factory<CV> |
vertex_factory |
Constructor and Description |
---|
VertexPartitionCollapser(org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<CV,CE>> graph_factory,
org.apache.commons.collections4.Factory<CV> vertex_factory,
org.apache.commons.collections4.Factory<CE> edge_factory)
Creates an instance with the specified graph and element factories.
|
Modifier and Type | Method and Description |
---|---|
edu.uci.ics.jung.graph.Graph<CV,CE> |
collapseVertexPartitions(VertexPartition<V,E> partitioning)
Creates a new graph whose vertices correspond to the partitions of the supplied graph.
|
org.apache.commons.collections4.Transformer<java.util.Set<V>,CV> |
getSetToCollapsedVertexTransformer()
Returns a transformer from vertex sets in the original graph to collapsed vertices
in the transformed graph.
|
protected org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<CV,CE>> graph_factory
protected org.apache.commons.collections4.Factory<CV> vertex_factory
protected org.apache.commons.collections4.Factory<CE> edge_factory
public VertexPartitionCollapser(org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.Graph<CV,CE>> graph_factory, org.apache.commons.collections4.Factory<CV> vertex_factory, org.apache.commons.collections4.Factory<CE> edge_factory)
vertex_factory
- used to construct the vertices of the new graphedge_factory
- used to construct the edges of the new graphgraph_factory
- used to construct the new graphpublic edu.uci.ics.jung.graph.Graph<CV,CE> collapseVertexPartitions(VertexPartition<V,E> partitioning)
partitioning
-