@thi.ng/adjacency
Version:
Sparse & bitwise adjacency matrices, lists and selected traversal algorithms for directed & undirected graphs
24 lines • 779 B
TypeScript
import type { Maybe } from "@thi.ng/api";
import { BitField } from "@thi.ng/bitfield/bitfield";
import type { IGraph } from "./api.js";
export declare class DFS {
graph: IGraph;
marked: BitField;
edges: Uint32Array;
src: number;
constructor(graph: IGraph, src: number);
search(id: number): void;
hasPathTo(id: number): boolean;
pathTo(id: number): Maybe<Iterable<number>>;
}
/**
* One-off Depth-First path search from vertex `src` to `dest` in given `graph`.
* If successful, returns path as iterable or undefined if no path connects the
* given vertices.
*
* @param graph -
* @param src -
* @param dest -
*/
export declare const dfs: (graph: IGraph, src: number, dest: number) => Maybe<Iterable<number>>;
//# sourceMappingURL=dfs.d.ts.map