import { Position } from "geojson"; import { Coordinates, PathFinderOptions, Vertices, Key } from "./types"; /** * Given a graph of vertices and edges, simplifies the graph so redundant * nodes/edges are removed, only preserving nodes which are either: * * * Dead ends: end of lines, where you can only go back in the opposite * direction * * Forks, where there is an option to go in multiple directions * * The idea is to reduce the number of nodes in the graph, which drasticly * reduces the complexity of Dijkstra's algorithm. * * @param sourceVertices the graph's vertices (a lookup of vertex edges and weights) * @param vertexCoords the geographic coordinates of the vertices * @param edgeData the (optional) data associated with each edge * @param options options used for creating and compacting the graph * @returns */ export default function compactGraph(sourceVertices: Vertices, vertexCoords: Coordinates, sourceEdgeData: Record>, options?: PathFinderOptions): { vertices: Vertices; coordinates: Record>; edgeData: Record>; }; export declare function compactNode(key: Key, vertices: Vertices, ends: Vertices, vertexCoords: Coordinates, edgeData: Record>, trackIncoming: boolean, options?: PathFinderOptions): { edges: Record; incomingEdges: Record; coordinates: Record; incomingCoordinates: Record; reducedEdges: Record; };