@openhps/geospatial
    Preparing search index...

    Function findShortestPath

    • Finds the shortest path over the connectedSpaces graph of a set of symbolic spaces.

      Edges are weighted by travel effort, not raw distance: walking time plus stair/elevator penalties. avoidStairs removes stair connections from consideration (their weight is infinite), so a wheelchair route uses the elevator when one exists and reports unreachable when it does not.

      const result = findShortestPath('room-201', 'room-305', floor.spaces);
      if (result.reachable) {
      console.log(result.route.spaces, result.route.eta);
      }

      Parameters

      • from: string | SymbolicSpace<any>

        The start space or its uid

      • to: string | SymbolicSpace<any>

        The destination space or its uid

      • spaces: Iterable<SymbolicSpace<any>>

        The spaces that may be traversed

      • Optionaloptions: SpacePathOptions

        The travel options (defaults to gentle walking)

      Returns SpacePathResult

      The route, or a clean unreachable result