Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Juan-Carlos-Cruz/robotaxi-zoox/llms.txt
Use this file to discover all available pages before exploring further.
busqueda_no_informada is a single function that implements three frontier strategies — BFS (queue), DFS (stack), and UCS (min-heap by cost) — controlled by the modo parameter. All three strategies share the same state representation and goal check: the taxi must collect every passenger in pasajeros_totales before arriving at grid.destino. The only difference between them is how the frontier is ordered and which nodes are expanded next.
Import
Function signature
The map object that generates neighbour states via
get_vecinos. It also exposes grid.destino as the terminal position the taxi must reach.The starting search state. Typically constructed with
posicion=grid.inicio and pasajeros_recogidos=frozenset() to represent the taxi before any pickups.The complete set of passenger grid positions that must be collected before the goal is declared. Pass
frozenset(grid.pasajeros) to require all passengers on the map.Frontier strategy to use. Must be one of
'bfs', 'dfs', or 'ucs'. Any other value raises a ValueError.Return value
Returns adict with the following keys when a solution is found, or None when the goal is unreachable.
Ordered list of grid positions from the starting cell to the final destination, inclusive.
Total number of states that were fully explored (popped from the frontier and added to the visited set) during the search.
Depth of the solution node in the search tree — equivalent to the number of moves made.
Total accumulated movement cost along the solution path, stored in the node’s
g attribute.Frontier strategies
modo | Data structure | Strategy | Optimality |
|---|---|---|---|
'bfs' | deque (FIFO) | Breadth-First Search | Shortest path by number of steps |
'dfs' | list (LIFO stack) | Depth-First Search | Low memory use; not cost-optimal |
'ucs' | heapq ordered by g | Uniform-Cost Search | Optimal by accumulated movement cost |
Visited state encoding
The search tracks visited states as(posicion, pasajeros_recogidos) tuples. This means the same grid cell can be visited more than once if the taxi arrives there with a different set of already-collected passengers — each combination is treated as a distinct state. This is essential for correctness: without passenger tracking in the state key, the search could incorrectly prune paths that revisit a cell on the way to a new pickup.