public class VertexDegreeEquivalenceComparator<V,E> extends java.lang.Object implements EquivalenceComparator<V,Graph<V,E>>
AND
Modifier and Type | Class and Description |
---|---|
protected class |
VertexDegreeEquivalenceComparator.InOutDegrees
Simple structure used to hold the two ints: vertex in degree and vertex
out degree.
|
Constructor and Description |
---|
VertexDegreeEquivalenceComparator() |
Modifier and Type | Method and Description |
---|---|
boolean |
equivalenceCompare(V vertex1,
V vertex2,
Graph<V,E> context1,
Graph<V,E> context2)
Compares the in degrees and the out degrees of the two vertexes.
|
int |
equivalenceHashcode(V vertex,
Graph<V,E> context)
Hashes using the in & out degree of a vertex
|
protected VertexDegreeEquivalenceComparator.InOutDegrees |
getInOutDegrees(Graph<V,E> aContextGraph,
V vertex)
Calculates the In and Out degrees of vertexes.
|
public boolean equivalenceCompare(V vertex1, V vertex2, Graph<V,E> context1, Graph<V,E> context2)
One may reside in an Undirected Graph and the other in a Directed graph, or both on the same graph type.
equivalenceCompare
in interface EquivalenceComparator<V,Graph<V,E>>
EquivalenceComparator.equivalenceCompare(Object, Object, Object,
Object)
public int equivalenceHashcode(V vertex, Graph<V,E> context)
equivalenceHashcode
in interface EquivalenceComparator<V,Graph<V,E>>
EquivalenceComparator.equivalenceHashcode(Object, Object)
protected VertexDegreeEquivalenceComparator.InOutDegrees getInOutDegrees(Graph<V,E> aContextGraph, V vertex)
aContextGraph
- vertex
-