org.jgrapht.experimental.isomorphism
Class IsomorphismRelation<V,E>

java.lang.Object
  extended by org.jgrapht.experimental.isomorphism.IsomorphismRelation<V,E>
All Implemented Interfaces:
GraphMapping<V,E>

public class IsomorphismRelation<V,E>
extends Object
implements GraphMapping<V,E>

Holds an isomorphism relation for two graphs. It contains a mapping between the two graphs.

Usage:

  1. use getVertexCorrespondence() or getEdgeCorrespondence() to get the mapped object in the other graph.

It consists of two vertexes array , the i-th vertex in the 1st array is the isomorphic eqv. of the i-th in 2nd array. Note that the getters are unsafe (they return the array and not a copy of it).

Since:
May 27, 2005
Author:
Assaf

Constructor Summary
IsomorphismRelation(List<V> aGraph1vertexArray, List<V> aGraph2vertexArray, Graph<V,E> g1, Graph<V,E> g2)
           
 
Method Summary
 E getEdgeCorrespondence(E edge, boolean forward)
          Gets the mapped value where the key is edge
 V getVertexCorrespondence(V vertex, boolean forward)
          Gets the mapped value where the key is vertex
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsomorphismRelation

public IsomorphismRelation(List<V> aGraph1vertexArray,
                           List<V> aGraph2vertexArray,
                           Graph<V,E> g1,
                           Graph<V,E> g2)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getVertexCorrespondence

public V getVertexCorrespondence(V vertex,
                                 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:
vertex - 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 edge,
                               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:
edge - 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


Copyright © 2013. All rights reserved.