DepthFirstSearchCrawlerTVertex, TEdgeCycleDetected Method |
A cycle has been detected in a directed graph. This method is called to signal derived classes that the cycle has been detected, as the derived class
ordered this class to signal it if cycles were detected. Cycle checks are only performed on directed graphs.
Namespace:
SD.Tools.Algorithmia.Graphs
Assembly:
SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.4.0.0 (1.4.19.0711)
Syntax protected virtual bool CycleDetected(
TVertex relatedVertex,
HashSet<TEdge> edges
)
Protected Overridable Function CycleDetected (
relatedVertex As TVertex,
edges As HashSet(Of TEdge)
) As Boolean
Parameters
- relatedVertex
- Type: TVertex
The related vertex which formed the cycle. - edges
- Type: System.Collections.GenericHashSetTEdge
The edges used to visit the related vertex.
Return Value
Type:
Booleantrue if routines should proceed deeper into the graph, false otherwise (so traversing will stop at this point and backtrack with
other paths). Returning true could lead to infinite loops. Default is false
Remarks It's recommended you throw an exception to quit the operation entirely if your algorithm can't deal with cycles.
See Also