Package ghidra.graph

Interface GImplicitDirectedGraph<V,​E extends GEdge<V>>

  • Type Parameters:
    V - the type of vertices
    E - the type of edges
    All Known Implementing Classes:
    AssemblyContextGraph

    public interface GImplicitDirectedGraph<V,​E extends GEdge<V>>
    A directed graph that need not be constructed explicitly

    Instead, the graph is constructed (and usually cached) as it is explored. For instance, if a path searching algorithm is being applied, incident edges and neighboring nodes need not be computed if they're never visited. This allows conceptually large (even infinite) graphs to be represented. A graph algorithm can be applied so long as it supports this interface, and does not attempt to exhaust an infinite graph.

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      GDirectedGraph<V,​E> copy()
      Copy some portion of the implicit graph to an explicit graph Usually, this returns the cached (explored) portion of the graph
      java.util.Collection<E> getInEdges​(V v)
      Compute the incident edges that end at the given vertex (Optional operation)
      java.util.Collection<E> getOutEdges​(V v)
      Compute the incident edges that start at the given vertex
      default java.util.Collection<V> getPredecessors​(V v)
      Compute a vertex's predecessors The default implementation computes this from the in-edges
      default java.util.Collection<V> getSuccessors​(V v)
      Compute a vertex's successors The default implementation compute this from the out-edges
    • Method Detail

      • getInEdges

        java.util.Collection<E> getInEdges​(V v)
        Compute the incident edges that end at the given vertex (Optional operation)
        Parameters:
        v - the destination vertex
        Returns:
        the in-edges to the given vertex
      • getOutEdges

        java.util.Collection<E> getOutEdges​(V v)
        Compute the incident edges that start at the given vertex
        Parameters:
        v - the source vertex
        Returns:
        the out-edges from the given vertex
      • getPredecessors

        default java.util.Collection<V> getPredecessors​(V v)
        Compute a vertex's predecessors The default implementation computes this from the in-edges
        Parameters:
        v - the destination vertex
        Returns:
        the predecessors
      • getSuccessors

        default java.util.Collection<V> getSuccessors​(V v)
        Compute a vertex's successors The default implementation compute this from the out-edges
        Parameters:
        v - the source vertex
        Returns:
        the successors
      • copy

        GDirectedGraph<V,​E> copy()
        Copy some portion of the implicit graph to an explicit graph Usually, this returns the cached (explored) portion of the graph
        Returns:
        a "copy" of this implicit graph