org.jgrapht.alg.isomorphism

## Class IsomorphicGraphMapping<V,E>

• Type Parameters:
V - the type of the vertices
E - the type of the edges
All Implemented Interfaces:
GraphMapping<V,E>

public class IsomorphicGraphMapping<V,E>
extends Object
implements GraphMapping<V,E>
This class represents a GraphMapping between two (subgraph)isomorphic graphs. In the subgraph isomorphic case, the second one is assumed to be a subgraph of the first one.
• ### Constructor Summary

Constructors
Constructor and Description
IsomorphicGraphMapping(org.jgrapht.alg.isomorphism.GraphOrdering<V,E> g1, org.jgrapht.alg.isomorphism.GraphOrdering<V,E> g2, int[] core1, int[] core2)
Construct a new isomorphic graph mapping
• ### Method Summary

All Methods
Modifier and Type Method and Description
E getEdgeCorrespondence(E e, boolean forward)
Gets the mapped value where the key is edge
V getVertexCorrespondence(V v, boolean forward)
Gets the mapped value where the key is vertex
boolean hasEdgeCorrespondence(E e)
Checks if a edge e from the first graph has a corresponding edge in the second graph
boolean hasVertexCorrespondence(V v)
Checks if a vertex v from the first graph has a corresponding vertex in the second graph
boolean isEqualMapping(GraphMapping<V,E> rel)
Checks for equality.
String toString()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Constructor Detail

• #### IsomorphicGraphMapping

public IsomorphicGraphMapping(org.jgrapht.alg.isomorphism.GraphOrdering<V,E> g1,
org.jgrapht.alg.isomorphism.GraphOrdering<V,E> g2,
int[] core1,
int[] core2)
Construct a new isomorphic graph mapping
Parameters:
g1 - the first graph
g2 - the second graph which is a possible subgraph of g1
core1 - the mapping as array (forwards)
core2 - the mapping as array (backwards)
• ### Method Detail

• #### getVertexCorrespondence

public V getVertexCorrespondence(V v,
boolean forward)
Description copied from interface: GraphMapping
Gets the mapped value where the key is vertex
Specified by:
getVertexCorrespondence in interface GraphMapping<V,E>
Parameters:
v - vertex in one of the graphs
forward - 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
• #### getEdgeCorrespondence

public E getEdgeCorrespondence(E e,
boolean forward)
Description copied from interface: GraphMapping
Gets the mapped value where the key is edge
Specified by:
getEdgeCorrespondence in interface GraphMapping<V,E>
Parameters:
e - edge in one of the graphs
forward - 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
• #### hasVertexCorrespondence

public boolean hasVertexCorrespondence(V v)
Checks if a vertex v from the first graph has a corresponding vertex in the second graph
Parameters:
v - the vertex
Returns:
is there a corresponding vertex to v in the subgraph
• #### hasEdgeCorrespondence

public boolean hasEdgeCorrespondence(E e)
Checks if a edge e from the first graph has a corresponding edge in the second graph
Parameters:
e - the edge
Returns:
is there a corresponding edge to e in the subgraph
• #### toString

public String toString()
Overrides:
toString in class Object
• #### isEqualMapping

public boolean isEqualMapping(GraphMapping<V,E> rel)
Checks for equality. Assuming both are mappings on the same graphs.
Parameters:
rel - the corresponding mapping
Returns:
do both relations map to the same vertices