Returns the vertices adjacent from given vertex in the digraph. If there is no such vertex in the digraph, the method returns empty container.
the vertex.
the vertices adjacent from given vertex in the digraph or empty container.
Returns collection backed by edges of this graph. Time complexity is O(V + E).
collection of edges.
Returns collection backed by vertices of this graph. Time complexity is O(1).
collection of vertices.
Returns the number of edges in the digraph.
the number of edges in the digraph.
Returns the number of directed edges incident to vertex v
. This is known as the
indegree of vertex v
.
the vertex
the indegree of vertex v
or 0 if there is no such vertex in the graph.
Returns the number of directed edges incident from vertex v
. This is known as the
outdegree of vertex v
.
the vertex
the outdegree of vertex v
or 0 if there is no such vertex in the graph.
Returns the reverse of the digraph.
the reverse of the digraph
Returns a string representation of the graph. This method takes time proportional to E + V.
the number of vertices V, followed by the number of edges E, followed by the
V adjacency lists
Returns the number of vertices in the digraph.
the number of vertices in the digraph.
Generated using TypeDoc
The Digraph class represents a directed graph of vertices. It supports adding new vertices and edges, iteration over all vertices and iteration over all of the vertices adjecent from a given vertex. Parallel edges and self-loops are permitted.