V
- the graph vertex typeE
- the graph edge typepublic class DefaultGraphMapping<V,E> extends Object implements GraphMapping<V,E>
getVertex/EdgeCorrespondence
is based on the performance of the concrete Map class which
is passed in the constructor. For example, using HashMap
will provide expected $O(1)$
performance.Constructor and Description |
---|
DefaultGraphMapping(Map<V,V> g1ToG2,
Map<V,V> g2ToG1,
Graph<V,E> g1,
Graph<V,E> g2)
The maps themselves are used.
|
Modifier and Type | Method and Description |
---|---|
E |
getEdgeCorrespondence(E currEdge,
boolean forward)
Gets the mapped value where the key is
edge |
V |
getVertexCorrespondence(V keyVertex,
boolean forward)
Gets the mapped value where the key is
vertex |
public DefaultGraphMapping(Map<V,V> g1ToG2, Map<V,V> g2ToG1, Graph<V,E> g1, Graph<V,E> g2)
g1ToG2
- vertex mapping from the first graph to the secondg2ToG1
- vertex mapping from the second graph to the firstg1
- the first graphg2
- the second graphpublic E getEdgeCorrespondence(E currEdge, boolean forward)
GraphMapping
edge
getEdgeCorrespondence
in interface GraphMapping<V,E>
currEdge
- edge in one of the graphsforward
- if true, uses mapping from graph1 to graph2; if false, use mapping from graph2
to graph1public V getVertexCorrespondence(V keyVertex, boolean forward)
GraphMapping
vertex
getVertexCorrespondence
in interface GraphMapping<V,E>
keyVertex
- vertex in one of the graphsforward
- if true, uses mapping from graph1 to graph2; if false, use mapping from graph2
to graph1Copyright © 2018. All rights reserved.