import BaseEdge from "@specs-feup/flow/graph/BaseEdge"; import BaseNode from "@specs-feup/flow/graph/BaseNode"; import Node from "@specs-feup/flow/graph/Node"; /** * A depth-first search algorithm. * * Can have a custom propagation function to determine which edges to follow, * effectively pruning the search tree. * * Can be set to be undirected, in which case it will also use incoming edges * to traverse the graph, disregarding edge direction. */ export default class DepthFirstSearch implements Node.Search { /** * A function that determines whether to propagate a given edge. */ propagate: (edge: BaseEdge.Class) => boolean; /** * Whether the search is to be considered directed or undirected. */ directed: boolean; /** * Creates a new depth-first search algorithm. * * @param propagate A function that determines whether to propagate a given edge. */ constructor(propagate?: (edge: BaseEdge.Class) => boolean); /** * Sets the propagation function for the edges. * The propagation function should return a boolean that determines whether to propagate the edge. * * @param propagate The propagation function to set. * @returns This search instance, for chaining. */ setPropagate(propagate: (edge: BaseEdge.Class) => boolean): this; /** * Sets the search to be undirected. * An undirected search may travel through edges in both directions, * so it can also use incoming edges. */ undirected(): this; search(root: BaseNode.Class): Generator; } //# sourceMappingURL=DepthFirstSearch.d.ts.map