Table of Contents

Class DirectedDepthFirstSearch

Namespace
AlgorithmsSW.Digraph
Assembly
AlgorithmsSW.dll

Provides and algorithm for finding all vertices reachable from a given vertex or set of vertices in a directed graph.

public class DirectedDepthFirstSearch
Inheritance
DirectedDepthFirstSearch
Inherited Members
Extension Methods

Constructors

DirectedDepthFirstSearch(IDigraph, IEnumerable<int>)

Initializes a new instance of the DirectedDepthFirstSearch class.

public DirectedDepthFirstSearch(IDigraph digraph, IEnumerable<int> startVertexes)

Parameters

digraph IDigraph

The graph to search.

startVertexes IEnumerable<int>

The vertices to start the search from.

DirectedDepthFirstSearch(IDigraph, int)

Initializes a new instance of the DirectedDepthFirstSearch class.

public DirectedDepthFirstSearch(IDigraph digraph, int startVertex)

Parameters

digraph IDigraph

The graph to search.

startVertex int

The vertex to start the search from.

Properties

IsConnectedToSources

public bool IsConnectedToSources { get; }

Property Value

bool

Methods

Reachable(int)

Checks whether a given vertex is reachable from the start vertex or vertices.

public bool Reachable(int vertex)

Parameters

vertex int

The vertex to check.

Returns

bool