public abstract class GraphContractionAlgorithm extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
GraphContractionAlgorithm(Graph graph) |
| Modifier and Type | Method and Description |
|---|---|
void |
contractEdges(Collection edges)
Perform contractVertexPair for the two incident vertices of
each edge in a specified set.
|
void |
contractVertexPair(Vertex vRemain,
Vertex vRemove)
Contract two arbitrary vertices within a graph.
|
void |
contractVertices(Collection vertices)
Contract an arbitrary collection of vertices within a graph into a
single vertex.
|
protected abstract Edge |
copyEdge(Edge oldEdge,
Vertex vA,
Vertex vB)
Subclass method called to add a new contracted edge equivalent to
oldEdge, but connecting vA to vB.
|
Edge |
getContractionEdge(Edge edge)
Find the resulting contraction for an Edge.
|
GraphComponent |
getContractionResult(GraphComponent c)
Find the resulting contraction for a GraphComponent
(Vertex or Edge).
|
Vertex |
getContractionVertex(Vertex v)
Find the resulting contraction for a Vertex.
|
Graph |
getGraph() |
protected abstract boolean |
shouldBeSelfLoop(Edge e)
Subclass method called to decide whether a given edge
encountered during contraction should be turned into a self-loop
on the contracted vertex.
|
protected GraphContractionAlgorithm(Graph graph)
public Graph getGraph()
public void contractVertexPair(Vertex vRemain, Vertex vRemove) throws Exception
vRemain - the vertex that will remain after contractionvRemove - the vertex that will be removed by contractionException - if the graph cannot be modifiedpublic void contractVertices(Collection vertices) throws Exception
vertices - the vertices to be contracted; the first vertex returned
by this Collection's iterator will be the one to remainException - if the graph cannot be modifiedpublic void contractEdges(Collection edges) throws Exception
edges - the edges to contractException - if the graph cannot be modifiedpublic Vertex getContractionVertex(Vertex v)
v - the Vertex to find the contraction forpublic Edge getContractionEdge(Edge edge)
edge - the Edge to find the contraction forpublic GraphComponent getContractionResult(GraphComponent c)
c - the GraphComponentprotected abstract boolean shouldBeSelfLoop(Edge e)
protected abstract Edge copyEdge(Edge oldEdge, Vertex vA, Vertex vB) throws Exception
oldEdge - the edge being contractedvA - one vertex to which the new edge should be incident;
for a DirectedGraph, this is the sourcevB - the other vertex to which the new edge should be incident;
for a DirectedGraph, this is the sinkException - if the graph cannot be modifiedCopyright © 2019 JULIE Lab, Germany. All rights reserved.