{"record":{"id":"7e23409c279c0398","repo":"AtsushiSakai/PythonRobotics","slug":"no-path-found-7e2340","errorCode":null,"errorMessage":"No path found","messagePattern":"No path found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar.py","lineNumber":68,"sourceCode":"                path_walker: Node = expanded_node\n                while True:\n                    path.append(path_walker)\n                    if path_walker.parent_index == -1:\n                        break\n                    path_walker = expanded_list[path_walker.parent_index]\n\n                # reverse path so it goes start -> goal\n                path.reverse()\n                return NodePath(path, len(expanded_set))\n\n            expanded_idx = len(expanded_list)\n            expanded_list.append(expanded_node)\n            expanded_set.add(expanded_node)\n\n            for child in SpaceTimeAStar.generate_successors(grid, goal, expanded_node, expanded_idx, verbose, expanded_set):\n                heapq.heappush(open_set, child)\n\n        raise Exception(\"No path found\")\n\n    \"\"\"\n    Generate possible successors of the provided `parent_node`\n    \"\"\"\n    @staticmethod\n    def generate_successors(\n        grid: Grid, goal: Position, parent_node: Node, parent_node_idx: int, verbose: bool, expanded_set: set[Node]\n    ) -> Generator[Node, None, None]:\n        diffs = [\n            Position(0, 0),\n            Position(1, 0),\n            Position(-1, 0),\n            Position(0, 1),\n            Position(0, -1),\n        ]\n        for diff in diffs:\n            new_pos = parent_node.position + diff\n            new_node = Node(","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/AtsushiSakai/PythonRobotics/blob/1fe4fb980f6a12fe21c3c33d2b4da97a52c9154d/PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar.py#L50-L86","documentation":"Thrown by SpaceTimeAStar.plan when the open set is exhausted before the goal is reached: no time-expanded path exists that avoids dynamic obstacles (and reservations) within the grid's time limit. It signals an unsolvable or over-constrained planning query.","triggerScenarios":"Calling SpaceTimeAStar.plan(grid, start, goal) where every candidate route is blocked by dynamic obstacles or reserved cells, or where the grid's time_limit is shorter than any feasible path length.","commonSituations":"High obstacle density or adversarial arrangements; small time_limit relative to grid size; multi-agent runs where earlier reservations block the later agent; invalid/out-of-bounds goal positions.","solutions":["Increase the grid's time_limit so the search has enough timesteps","Lower obstacle density or change the arrangement so a route exists","Check start/goal validity and that they are not permanently obstructed","Catch the exception and treat it as an 'unreachable' result (skip/wait the agent)"],"exampleFix":"# before\npath = SpaceTimeAStar.plan(grid, start, goal)\n\n# after\ntry:\n    path = SpaceTimeAStar.plan(grid, start, goal)\nexcept Exception as e:\n    if 'No path found' in str(e):\n        path = None  # agent cannot reach goal under current constraints\n    else:\n        raise","handlingStrategy":"try-catch","validationCode":"assert grid.time_limit > abs(start.x - goal.x) + abs(start.y - goal.y), \"time_limit too short for any path\"","typeGuard":null,"tryCatchPattern":"try:\n    path = SpaceTimeAStar.plan(grid, start, goal)\nexcept Exception as e:\n    if str(e) == 'No path found':\n        path = None  # unreachable under current constraints\n    else:\n        raise","preventionTips":["Ensure time_limit exceeds the Manhattan distance from start to goal plus slack for waits","Validate start/goal are in-bounds and not permanently occupied","Increase time_limit or reduce obstacles when queries become unsolvable"],"tags":["path-planning","a-star","no-solution","search-exhausted"],"backgroundTag":"pathfinding-no-solution","analyzedSha":"1fe4fb980f6a12fe21c3c33d2b4da97a52c9154d","analyzedAt":"2026-08-28T13:23:33.733Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}