Method DepthFirstSearchForAllPaths
DepthFirstSearchForAllPaths(T, T)
Finds all paths between a start and end node using DFS.
Declaration
public List<List<T>> DepthFirstSearchForAllPaths(T startNode, T endNode)
Parameters
| Type | Name | Description |
|---|---|---|
| T | startNode | The node to start from. |
| T | endNode | The node to end at. |
Returns
| Type | Description |
|---|---|
| List<List<T>> | A list of paths between the nodes. |
DepthFirstSearchForAllPaths(T, Predicate<T>)
Finds all paths from a start node to nodes matching a condition.
Declaration
public List<List<T>> DepthFirstSearchForAllPaths(T startNode, Predicate<T> endNodeCondition)
Parameters
| Type | Name | Description |
|---|---|---|
| T | startNode | The node to start from. |
| Predicate<T> | endNodeCondition | Predicate identifying acceptable end nodes. |
Returns
| Type | Description |
|---|---|
| List<List<T>> | A list of matching paths. |