DFS class

Implementation of Depth-first Search.

@author {@link https://github.com/Mugen87|Mugen87}

Constructors

DFS([Graph? graph, int source = -1, int target = -1])
Constructs an AStar algorithm object.

Properties

found ↔ bool
getter/setter pair
graph ↔ Graph?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source ↔ int
getter/setter pair
target ↔ int
getter/setter pair

Methods

clear() → DFS
Clears the internal state of the object. A new search is now possible.
getPath() → List<int>
Returns the shortest path from the source to the target node as an array of node indices.
getSearchTree() → List<Edge>
Returns the search tree of the algorithm as an array of edges.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Executes the graph search. If the search was successful, {@link DFS#found} is set to true.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited