Package org.jgrapht

Interface GraphMapping<V,​E>

  • Type Parameters:
    V - the graph vertex type
    E - the graph edge type
    All Known Implementing Classes:
    DefaultGraphMapping, IsomorphicGraphMapping

    public interface GraphMapping<V,​E>
    GraphMapping represents a bidirectional mapping between two graphs (called graph1 and graph2), which allows the caller to obtain the matching vertex or edge in either direction, from graph1 to graph2, or from graph2 to graph1. It does not have to always be a complete bidirectional mapping (it could return null for some lookups).
    Author:
    Assaf Lehr
    • Method Detail

      • getVertexCorrespondence

        V getVertexCorrespondence​(V vertex,
                                  boolean forward)
        Gets the mapped value where the key is vertex
        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

        E getEdgeCorrespondence​(E edge,
                                boolean forward)
        Gets the mapped value where the key is edge
        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