public class VertexPartitionCollapser<V,E,CV,CE> extends Object
Concept based on Danyel Fisher's GraphCollapser
in JUNG 1.x.
Modifier and Type | Field and Description |
---|---|
protected com.google.common.base.Supplier<CE> |
edge_factory |
protected com.google.common.base.Supplier<Graph<CV,CE>> |
graph_factory |
protected Map<Set<V>,CV> |
set_collapsedv |
protected com.google.common.base.Supplier<CV> |
vertex_factory |
Constructor and Description |
---|
VertexPartitionCollapser(com.google.common.base.Supplier<Graph<CV,CE>> graph_factory,
com.google.common.base.Supplier<CV> vertex_factory,
com.google.common.base.Supplier<CE> edge_factory)
Creates an instance with the specified graph and element factories.
|
Modifier and Type | Method and Description |
---|---|
Graph<CV,CE> |
collapseVertexPartitions(VertexPartition<V,E> partitioning)
Creates a new graph whose vertices correspond to the partitions of the supplied graph.
|
com.google.common.base.Function<Set<V>,CV> |
getSetToCollapsedVertexTransformer() |
protected com.google.common.base.Supplier<CV> vertex_factory
protected com.google.common.base.Supplier<CE> edge_factory
public VertexPartitionCollapser(com.google.common.base.Supplier<Graph<CV,CE>> graph_factory, com.google.common.base.Supplier<CV> vertex_factory, com.google.common.base.Supplier<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 Graph<CV,CE> collapseVertexPartitions(VertexPartition<V,E> partitioning)
partitioning
- a vertex partition of a graphCopyright © 2015. All rights reserved.