Interface IndexedDirectedGraph

All Known Subinterfaces:
AttributedIndexedBidiGraph<V,A>, AttributedIndexedDirectedGraph<V,A>, IndexedBidiGraph, IntAttributedIndexedBidiGraph, IntAttributedIndexedDirectedGraph, MutableIndexedBidiGraph
All Known Implementing Classes:
AbstractDirectedGraphBuilder, AbstractMutableIndexedBidiGraph, ChunkedMutableIndexedBidiGraph, ImmutableAttributed16BitIndexedDirectedGraph, ImmutableAttributed32BitIndexedBidiGraph, ImmutableAttributed32BitIndexedDirectedGraph, MutableIntAttributed16BitIndexedBidiGraph, SimpleMutableDirectedGraph

public interface IndexedDirectedGraph
Provides indexed read access to a directed graph G = (V, A) .
  • G is a tuple (V, A) .
  • V is the set of vertices with elements v_i ∈ V. i ∈ {0, ..., vertexCount - 1} .
  • A is the set of ordered pairs with elements (v_i, v_j)_k ∈ A. i,j ∈ {0, ..., vertexCount - 1}. k ∈ {0, ..., arrowCount - 1} .

The API of this class provides access to the following data:

  • The vertex count vertexCount.
  • The arrow count arrowCount.
  • The index i of each vertex v_i ∈ V.
  • The index k of each arrow a_k ∈ A.
  • The next count nextCount_i of the vertex with index i.
  • The index of the k-th next vertex of the vertex with index i, and with k ∈ {0, ..., nextCount_i - 1}.
Author:
Werner Randelshofer
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    findIndexOfNextAsInt(int v, int u)
    Returns the index of vertex b.
    int
    Returns the number of arrows.
    int
    getNextArrowAsInt(int v, int i)
    Returns the i-th next arrow of v.
    int
    getNextAsInt(int v, int i)
    Returns the i-th next vertex of v.
    int
    getNextCount(int v)
    Returns the number of next vertices of v.
    int
    Returns the number of vertices V.
    default boolean
    isNextAsInt(int v, int u)
    Returns whether there is an arrow from vertex v to vertex u.
    Returns the direct successor vertices of the specified vertex.
  • Method Details

    • getArrowCount

      int getArrowCount()
      Returns the number of arrows.
      Returns:
      arrow count
    • getNextAsInt

      int getNextAsInt(int v, int i)
      Returns the i-th next vertex of v.
      Parameters:
      v - a vertex index
      i - the index of the desired next vertex, i ∈ {0, ..., getNextCount(v) -1 }.
      Returns:
      the vertex index of the i-th next vertex of v.
    • getNextArrowAsInt

      int getNextArrowAsInt(int v, int i)
      Returns the i-th next arrow of v.
      Parameters:
      v - a vertex index
      i - the index of the desired arrow, i ∈ {0, ..., getNextCount(v) -1 }.
      Returns:
      the arrow data of the i-th next vertex of v.
    • getNextCount

      int getNextCount(int v)
      Returns the number of next vertices of v.
      Parameters:
      v - a vertex
      Returns:
      the number of next vertices of v.
    • getVertexCount

      int getVertexCount()
      Returns the number of vertices V.
      Returns:
      vertex count
    • findIndexOfNextAsInt

      default int findIndexOfNextAsInt(int v, int u)
      Returns the index of vertex b.
      Parameters:
      v - a vertex
      u - another vertex
      Returns:
      index of vertex b. Returns a value < 0 if b is not a next vertex of a.
    • isNextAsInt

      default boolean isNextAsInt(int v, int u)
      Returns whether there is an arrow from vertex v to vertex u.
      Parameters:
      v - a vertex
      u - another vertex
      Returns:
      true if there is an arrow from u to v
    • nextVerticesEnumerator

      default @NonNull Enumerator.OfInt nextVerticesEnumerator(int v)
      Returns the direct successor vertices of the specified vertex.
      Parameters:
      v - a vertex index
      Returns:
      a collection view on the direct successor vertices of vertex