net.xqhs.graphs.matcher
Class GraphMatcherQuick.MatchSingleComparator
java.lang.Object
net.xqhs.graphs.matcher.Match.MatchComparator
net.xqhs.graphs.matcher.GraphMatcherQuick.MatchSingleComparator
- All Implemented Interfaces:
- java.util.Comparator<Match>
- Enclosing class:
- GraphMatcherQuick
protected static class GraphMatcherQuick.MatchSingleComparator
- extends Match.MatchComparator
Match
comparator with additional features for single-edge matches.
The matches are sorted according to:
- if the match is single-edge and the
distances
to the start vertex are given (otherwise order by
id), use the distance (of the closest adjacent vertex) to the start vertex. If it's the same distance, order by
the match's id.
- for matches with more than one edge, order by
k
(smaller k first). If equal, order by id.
Field Summary |
private java.util.Map<Node,java.lang.Integer> |
distances
Vector of distances between every node and the start vertex. |
private MonitorPack |
monitorLink
Link to the object measuring performance of the algorithm in terms of number of compared edges. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
distances
private java.util.Map<Node,java.lang.Integer> distances
- Vector of distances between every node and the start vertex.
monitorLink
private MonitorPack monitorLink
- Link to the object measuring performance of the algorithm in terms of number of compared edges.
GraphMatcherQuick.MatchSingleComparator
protected GraphMatcherQuick.MatchSingleComparator(java.util.Map<Node,java.lang.Integer> vertexDistances,
MonitorPack monitor)
- Creates a match comparator that uses distances of vertices with respect to the root vertex.
- Parameters:
vertexDistances
- - Map
of distances between nodes and the start vertex.monitor
- - the object measuring performance in terms of edge matches.
compare
public int compare(Match m1,
Match m2)
- Specified by:
compare
in interface java.util.Comparator<Match>
- Overrides:
compare
in class Match.MatchComparator