deque-typed
Version:
19 lines (16 loc) • 405 B
text/typescript
export type VertexKey = string | number;
export type DijkstraResult<V> =
| {
distMap: Map<V, number>;
distPaths?: Map<V, V[]>;
preMap: Map<V, V | undefined>;
seen: Set<V>;
paths: V[][];
minDist: number;
minPath: V[];
}
| undefined;
export type GraphOptions<V = any> = {
vertexValueInitializer?: (key: VertexKey) => V;
defaultEdgeWeight?: number;
};