Interface IsomorphismIMapping

    • Method Detail

      • mapVertex

        int mapVertex​(int vertex)
        Map a vertex from the first graph to a vertex of the second graph.
        Parameters:
        vertex - the vertex to map
        Returns:
        the mapped vertex, or -1 if v1 is not mapped
        Throws:
        NoSuchVertexException - if the vertex does not exist in the first graph
      • mapEdge

        int mapEdge​(int edge)
        Map an edge from the first graph to an edge of the second graph.
        Parameters:
        edge - the edge to map
        Returns:
        the mapped edge, or -1 if e1 is not mapped
        Throws:
        NoSuchEdgeException - if the edge does not exist in the first graph
      • sourceGraph

        IntGraph sourceGraph()
        Description copied from interface: IsomorphismMapping
        Get the source graph.

        The 'source' graph contains the vertices and edges of the domain of the mapping, namely these vertices and edges are mapped to vertices and edges of the target (range) graph.

        Specified by:
        sourceGraph in interface IsomorphismMapping<Integer,​Integer,​Integer,​Integer>
        Returns:
        the source graph
      • targetGraph

        IntGraph targetGraph()
        Description copied from interface: IsomorphismMapping
        Get the target graph.

        The 'target' graph contains the vertices and edges of the range of the mapping, namely the vertices and edges of another graph (the source or domain graph) are mapped to these vertices and edges.

        Specified by:
        targetGraph in interface IsomorphismMapping<Integer,​Integer,​Integer,​Integer>
        Returns:
        the target graph
      • mappedVertices

        IntSet mappedVertices()
        Description copied from interface: IsomorphismMapping
        Get the set of the vertices that are mapped out of all the vertices of the source graph.

        The mapping may not map all the vertices of the source graph, in case the first graph is smaller than the second graph, and a (maybe induced) sub graph isomorphism was searched. This method can be used to get the set of vertices for which there is a corresponding vertex in the target graph.

        Together with IsomorphismMapping.mappedEdges(), this method can be used to construct the subgraph mapped to the target graph:

         
         Set<V1> vertices = mapping.mappedVertices();
         Set<E1> edges = mapping.mappedEdges();
         Graph<V1, E1> mappedSubGraph = mapping.sourceGraph().subGraphCopy(vertices, edges);
          
        Specified by:
        mappedVertices in interface IsomorphismMapping<Integer,​Integer,​Integer,​Integer>
        Returns:
        the set of the mapped vertices
      • mappedEdges

        IntSet mappedEdges()
        Description copied from interface: IsomorphismMapping
        Get the set of the edges that are mapped out of all the edges of the source graph.

        The mapping may not map all the edges of the source graph, in case the first graph is smaller than the second graph, and a (maybe induced) sub graph isomorphism was searched. This method can be used to get the set of edges for which there is a corresponding edge in the target graph.

        Together with IsomorphismMapping.mappedVertices(), this method can be used to construct the subgraph mapped to the target graph:

         
         Set<V1> vertices = mapping.mappedVertices();
         Set<E1> edges = mapping.mappedEdges();
         Graph<V1, E1> mappedSubGraph = mapping.sourceGraph().subGraphCopy(vertices, edges);
          
        Specified by:
        mappedEdges in interface IsomorphismMapping<Integer,​Integer,​Integer,​Integer>
        Returns:
        the set of the mapped edges