java.lang.Object
org.jgrapht.graph.DefaultGraphMapping<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
GraphMapping<V,
E>
Implementation of the GraphMapping interface. The performance of
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.- Author:
- Assaf Lehr
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetEdgeCorrespondence
(E currEdge, boolean forward) Gets the mapped value where the key isedge
getVertexCorrespondence
(V keyVertex, boolean forward) Gets the mapped value where the key isvertex
-
Constructor Details
-
DefaultGraphMapping
The maps themselves are used. There is no defensive-copy. Assumption: The key and value in the mappings are of valid graph objects. It is not checked.- Parameters:
g1ToG2
- vertex mapping from the first graph to the secondg2ToG1
- vertex mapping from the second graph to the firstg1
- the first graphg2
- the second graph
-
-
Method Details
-
getEdgeCorrespondence
Description copied from interface:GraphMapping
Gets the mapped value where the key isedge
- Specified by:
getEdgeCorrespondence
in interfaceGraphMapping<V,
E> - Parameters:
currEdge
- edge in one of the graphsforward
- if true, uses mapping from graph1 to graph2; if false, use mapping from graph2 to graph1- Returns:
- corresponding edge in other graph, or null if none
-
getVertexCorrespondence
Description copied from interface:GraphMapping
Gets the mapped value where the key isvertex
- Specified by:
getVertexCorrespondence
in interfaceGraphMapping<V,
E> - Parameters:
keyVertex
- vertex in one of the graphsforward
- if true, uses mapping from graph1 to graph2; if false, use mapping from graph2 to graph1- Returns:
- corresponding vertex in other graph, or null if none
-