Checks whether adding the given edge creates a cycle. Must be called at least once for each edge that was added for the algorithm to work correctly. It the edge cannot be added, does not perform any modifications.
The graph data structure to be used.
Source vertex of the edge.
Target vertex of the edge.
true
iff the specified edge can be added to the graph without introducing a cycle.
Creates the vertex data the algorithm needs. This needs to be called
exactly once for each vertex of the graph and must be the data returned
by GraphAdapter#getData
.
The graph data structure to be used.
The data to be set on the vertex.
Returns the topological order of the vertex, if supported.
The graph data structure to be used.
Vertex for which to determine its order.
The topological order of the given vertex.
Checks whether the target vertex can be reached from the source vertex, possibly with some algorithm-specific optimizations.
The graph data structure to be used.
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
.
Type of the cloned vertices.
A independent copy of this detector for a possibly different type of vertex. Changes to the state of this detector do not affect the state of the cloned detector and vice-versa.
Must be called when a vertex is deleted. The graph adapter must behave as if the vertex was not deleted just yet, ie. return the data for the vertex etc.
The graph data structure to be used.
New vertex that is about to be added or was just deleted.
true
iff this algorithm supports querying a vertex's topological order.
Generated using TypeDoc
The interface for the entry point of this library. The main method is
addEdge
, which checks whether the given edge can be added without adding a cycle, and if so, modifies theVertexData
of the edge to reflect this fact. It must be called at least once for each edge that was added.