public class StructurallyEquivalent<V,E> extends java.lang.Object implements org.apache.commons.collections4.Transformer<edu.uci.ics.jung.graph.Graph<V,E>,VertexPartition<V,E>>
You can extend this class to have a different definition of equivalence (by
overriding isStructurallyEquivalent
), and may give it hints for
accelerating the process by overriding canPossiblyCompare
.
(For example, in a bipartite graph, canPossiblyCompare
may
return false
for vertices in
different partitions. This function should be fast.)
Constructor and Description |
---|
StructurallyEquivalent() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canPossiblyCompare(V v1,
V v2)
This is a space for optimizations.
|
protected java.util.Set<edu.uci.ics.jung.graph.util.Pair<V>> |
getEquivalentPairs(edu.uci.ics.jung.graph.Graph<V,?> g)
For each vertex pair v, v1 in G, checks whether v and v1 are fully
equivalent: meaning that they connect to the exact same vertices.
|
protected boolean |
isStructurallyEquivalent(edu.uci.ics.jung.graph.Graph<V,?> g,
V v1,
V v2)
Checks whether a pair of vertices are structurally equivalent.
|
VertexPartition<V,E> |
transform(edu.uci.ics.jung.graph.Graph<V,E> g) |
public VertexPartition<V,E> transform(edu.uci.ics.jung.graph.Graph<V,E> g)
transform
in interface org.apache.commons.collections4.Transformer<edu.uci.ics.jung.graph.Graph<V,E>,VertexPartition<V,E>>
protected java.util.Set<edu.uci.ics.jung.graph.util.Pair<V>> getEquivalentPairs(edu.uci.ics.jung.graph.Graph<V,?> g)
g
- protected boolean isStructurallyEquivalent(edu.uci.ics.jung.graph.Graph<V,?> g, V v1, V v2)
g
- the graph in which the structural equivalence comparison is to take placev1
- the vertex to check for structural equivalence to v2v2
- the vertex to check for structural equivalence to v1