Interface MutableDirectedGraph<V,A>

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

public interface MutableDirectedGraph<V,A> extends DirectedGraph<V,A>
Interface for a mutable directed graph.
  • Method Details

    • addVertex

      void addVertex(@NonNull V v)
      Adds a vertex to the graph if it is not already in the graph.
      Parameters:
      v - vertex data
    • removeVertex

      void removeVertex(@NonNull V v)
      Removes a vertex from the graph if it is in the graph.
      Parameters:
      v - vertex data
    • addArrow

      void addArrow(@NonNull V v, @NonNull V u, @Nullable A a)
      Adds an arrow from vertex v to vertex u.

      This method adds additional an arrow if the arrow is already in the graph.

      Parameters:
      v - vertex data v
      u - vertex data u
      a - arrow data
    • removeArrow

      void removeArrow(@NonNull V v, @NonNull V u, @Nullable A a)
      Removes the first arrow from vertex v to vertex u that has the same data value.
      Parameters:
      v - vertex data v
      u - vertex data u
      a - arrow data
    • removeArrow

      void removeArrow(@NonNull V v, @NonNull V u)
      Removes the first arrow from vertex v to vertex u.
      Parameters:
      v - vertex data v
      u - vertex data u
    • removeNext

      void removeNext(@NonNull V v, int k)
      Removes the k-th next arrow from vertex v.
      Parameters:
      v - vertex data v
      k - index of arrow to be removed