Interface BidiGraph<V,A>

Type Parameters:
V - the vertex data type
A - the arrow data type
All Superinterfaces:
BareBidiGraph<V,A>, BareDirectedGraph<V,A>, BareDirectedVertexGraph<V>, DirectedGraph<V,A>
All Known Subinterfaces:
MutableBidiGraph<V,A>
All Known Implementing Classes:
ImmutableAttributed32BitIndexedBidiGraph, IndexedBidiGraphBidiGraphFacade, SimpleMutableBidiGraph

public interface BidiGraph<V,A> extends DirectedGraph<V,A>, BareBidiGraph<V,A>
Adds convenience methods to the interface defined in BareBidiGraph.
Author:
Werner Randelshofer
  • Method Details

    • getPrevArrows

      default @NonNull Collection<A> getPrevArrows(@NonNull V v)
      Returns the list of previous (incoming) arrows of vertex v.
      Parameters:
      v - a vertex
      Returns:
      a collection view on the previous arrows
    • getPrevVertices

      default @NonNull Collection<V> getPrevVertices(@NonNull V v)
      Returns the list of next vertices of vertex v.
      Parameters:
      v - a vertex
      Returns:
      a collection view on the direct successor vertices of vertex
    • getPrevArc

      default @NonNull Arc<V,A> getPrevArc(@NonNull V v, int i)
      Returns the arc data for the i-th previous (incoming) arrow from vertex v.
      Parameters:
      v - a vertex
      i - the index into the list of outgoing arrows
      Returns:
      the arc data
    • getPrevArcs

      default @NonNull Collection<Arc<V,A>> getPrevArcs(@NonNull V v)
      Returns the list of previous arc data of vertex v.
      Parameters:
      v - a vertex
      Returns:
      a collection view on the arc data
    • findIndexOfPrev

      default int findIndexOfPrev(@NonNull V v, @NonNull V u)
      Returns the index of vertex u in the list of previous vertices of v if an arrow from u to v exists.
      Parameters:
      v - a vertex
      u - a vertex
      Returns:
      index of vertex u or a value < 0
    • isPrev

      default boolean isPrev(@NonNull V v, @NonNull V u)
      Returns whether there is an arrow from vertex u to vertex v.
      Parameters:
      v - a vertex
      u - a vertex
      Returns:
      true if u is previous of v
    • searchPrevVertices

      default @NonNull Enumerator<V> searchPrevVertices(@NonNull V start, boolean dfs)
      Searches for vertices starting at the provided vertex.
      Parameters:
      start - the start vertex
      dfs - whether to search depth-first instead of breadth-first
      Returns:
      breadth first search
    • searchPrevVertices

      default @NonNull Enumerator<V> searchPrevVertices(@NonNull V start, @NonNull AddToSet<V> visited, boolean dfs)
      Searches for vertices starting at the provided vertex.
      Parameters:
      start - the start vertex
      visited - the add method of the visited set, see Set.add(E).
      dfs - whether to search depth-first instead of breadth-first
      Returns:
      breadth first search