Adds the given edge, if it does not exist, and it is allowed. May not be allowed eg if adding the edge creates a cycle.
Source vertex of the edge.
Target vertex of the edge.
true
iff the edge was added.
Adds the given vertex, if it does not exist, and it is allowed.
Vertex to be added.
true
iff the vertex was added.
Checks whether adding the edge would add a cycle.
Source vertex of the edge.
Target vertex of the edge.
true
iff the edge can be added without introducing a cycle.
Checks whether the edge can be contracted without creating a cycle.
Source vertex of the edge.
Target vertex of the edge.
true
iff the edge can be contracted without introducing a cycle.
Contracts the given edge, ie. delete the vertex to
and
all edges between from
and to
, and moves all remaining edges
of to
to from
.
Source vertex of the edge.
Target vertex of the edge.
The vertex that replaces the two old vertices. If not given, defaults to from
.
Another vertex may be connected two both of the vertices that are to be contracted. In this case, their edge data needs to be merged. If not given, defaults to taking the edge data from one edge.
true
iff the edge was contracted.
Delete the given edge, if it exists and it is allowed.
Source vertex of the edge.
Target vertex of the edge.
true
iff the edge was deleted.
Deletes the given vertex, if it does exist, and it is allowed.
Vertex to be deleted.
true
iff the vertex was deleted.
The number of vertices in this graph.
Source vertex of the edge.
Target vertex of the edge.
The data associated with the given edge.
Returns the edge data of all edges that point from (start at) the given vertex.
Vertex where the edge starts.
Edge data for the edges (vertex, *)
Returns the edge data of all edges that point to (end at) the given vertex.
Vertex where the edge ends.
Edge data for the edges (*, vertex)
All edges in this graph.
All edges with their data in this graph.
Returns the predecessor with the edge data of all edges that point from (start at) the given vertex.
Vertex where the edge starts.
Predecessors and edge data for the edges (vertex, *)
Returns the successors with the edge data of all edges that point to (end at) the given vertex.
Vertex where the edge ends.
Successors and edge data for the edges (*, vertex)
Returns the topological order of the vertex, if supported.
Vertex for which to determine its order.
The topological order of the given vertex.
The vertex whose predecessors are to be found.
All immediate predecessors of the given vertex. None if the vertex does not exist.
The vertex whose successors are to be found.
All immediate successors of the given vertex. None if the vertex does not exist.
The number of vertices in this graph.
All vertices in this graph.
Source vertex of the edge.
Target vertex of the edge.
true
iff this graph contains the given edge.
true
iff this graph contains the given vertex.
Checks whether the target vertex can be reached from the source vertex.
Source vertex for the search.
Target vertex for the search.
true
iff the target vertex can be reached from the source vertex, ie. iff there is a path from source
to target
.
Source vertex of the edge.
Target vertex of the edge.
The data to be associated with the given edge.
true
iff the data was set, false
iff the edge does not exist.
true
iff the algorithm in use supports querying a vertex's topological order.
Generated using TypeDoc
Common methods implemented by the provided GraphAdapters.