Class EdgeDepthFirstSearchAlgorithm<TVertex, TEdge>
A edge depth first search algorithm for directed graphs.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph.Algorithms.Search
Assembly: QuikGraph.dll
Syntax
public sealed class EdgeDepthFirstSearchAlgorithm<TVertex, TEdge> : RootedAlgorithmBase<TVertex, IEdgeListAndIncidenceGraph<TVertex, TEdge>>, IAlgorithm<IEdgeListAndIncidenceGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IEdgeColorizerAlgorithm<TVertex, TEdge>, IEdgePredecessorRecorderAlgorithm<TVertex, TEdge>, ITreeBuilderAlgorithm<TVertex, TEdge> where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Remarks
This is a variant of the classic DFS algorithm where the edges are color marked instead of the vertices.
Constructors
| Improve this Doc View SourceEdgeDepthFirstSearchAlgorithm(IAlgorithmComponent, IEdgeListAndIncidenceGraph<TVertex, TEdge>, IDictionary<TEdge, GraphColor>)
Initializes a new instance of the EdgeDepthFirstSearchAlgorithm<TVertex, TEdge> class.
Declaration
public EdgeDepthFirstSearchAlgorithm(IAlgorithmComponent host, IEdgeListAndIncidenceGraph<TVertex, TEdge> visitedGraph, IDictionary<TEdge, GraphColor> edgesColors)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IEdgeListAndIncidenceGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Collections.Generic.IDictionary<TEdge, GraphColor> | edgesColors | Edges associated to their colors (treatment states). |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
EdgeDepthFirstSearchAlgorithm(IEdgeListAndIncidenceGraph<TVertex, TEdge>)
Initializes a new instance of the EdgeDepthFirstSearchAlgorithm<TVertex, TEdge> class.
Declaration
public EdgeDepthFirstSearchAlgorithm(IEdgeListAndIncidenceGraph<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IEdgeListAndIncidenceGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
EdgeDepthFirstSearchAlgorithm(IEdgeListAndIncidenceGraph<TVertex, TEdge>, IDictionary<TEdge, GraphColor>)
Initializes a new instance of the EdgeDepthFirstSearchAlgorithm<TVertex, TEdge> class.
Declaration
public EdgeDepthFirstSearchAlgorithm(IEdgeListAndIncidenceGraph<TVertex, TEdge> visitedGraph, IDictionary<TEdge, GraphColor> edgesColors)
Parameters
Type | Name | Description |
---|---|---|
IEdgeListAndIncidenceGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Collections.Generic.IDictionary<TEdge, GraphColor> | edgesColors | Edges associated to their colors (treatment states). |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceEdgesColors
Treated edges with their colors (colorized edges).
Declaration
public IDictionary<TEdge, GraphColor> EdgesColors { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TEdge, GraphColor> |
MaxDepth
Gets or sets the maximum exploration depth, from the start vertex.
Declaration
public int MaxDepth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Maximum exploration depth. |
Remarks
Defaulted to int.MaxValue.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Value is negative or equal to 0. |
ProcessAllComponents
In case a root vertex has been set, indicates if the algorithm should walk through graph parts of other components than the root component.
Declaration
public bool ProcessAllComponents { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceInitialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
Events
| Improve this Doc View SourceBackEdge
Fired when an edge is going to be treated when coming from a gray edge.
Declaration
public event EdgeAction<TVertex, TEdge> BackEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
DiscoverTreeEdge
Fired when an edge is discovered.
Declaration
public event EdgeEdgeAction<TVertex, TEdge> DiscoverTreeEdge
Event Type
Type | Description |
---|---|
EdgeEdgeAction<TVertex, TEdge> |
FinishEdge
Fired when an edge is fully treated.
Declaration
public event EdgeAction<TVertex, TEdge> FinishEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
ForwardOrCrossEdge
Fired when an edge is going to be treated when coming from a black edge.
Declaration
public event EdgeAction<TVertex, TEdge> ForwardOrCrossEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
InitializeEdge
Fired when an edge is initialized.
Declaration
public event EdgeAction<TVertex, TEdge> InitializeEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
StartEdge
Fired when an edge starts to be treated.
Declaration
public event EdgeAction<TVertex, TEdge> StartEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |
StartVertex
Fired on the root vertex once before the start of the search from it.
Declaration
public event VertexAction<TVertex> StartVertex
Event Type
Type | Description |
---|---|
VertexAction<TVertex> |
TreeEdge
Fired when an edge is going to be treated when coming from a white edge.
Declaration
public event EdgeAction<TVertex, TEdge> TreeEdge
Event Type
Type | Description |
---|---|
EdgeAction<TVertex, TEdge> |