Legend
+Edge Costs
+diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b74b8e0cd7687ff5c70132e875c9811412af0e7b --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +.venv/ +venv/ + +# Node +node_modules/ +.npm/ + +# Build +dist/ +build/ + +# IDE +.vscode/ +.idea/ + +# OS +.DS_Store + +# Logs +*.log + +# Environment +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f9ed618905ff8cfc51867a031012fb24adba7689 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# Simple Hugging Face Spaces Dockerfile +FROM node:20-slim + +ENV DEBIAN_FRONTEND=noninteractive + +# Install Python +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 \ + python3-pip \ + python3-venv \ + && rm -rf /var/lib/apt/lists/* + +# Create user with UID 1000 (required by HF Spaces) +RUN useradd -m -u 1000 user + +WORKDIR /app + +# Copy and build frontend +COPY --chown=user frontend/package*.json ./frontend/ +RUN cd frontend && npm ci +COPY --chown=user frontend/ ./frontend/ +RUN cd frontend && npm run build + +# Copy and install backend +COPY --chown=user backend/ ./backend/ +RUN pip3 install --no-cache-dir --break-system-packages \ + fastapi uvicorn pydantic pydantic-settings \ + httpx psutil python-dotenv websockets + +# Switch to non-root user +USER user + +ENV HOME=/home/user \ + PYTHONPATH=/app/backend \ + PYTHONUNBUFFERED=1 + +EXPOSE 7860 + +# Simple startup script +COPY --chown=user start.sh /app/ +RUN chmod +x /app/start.sh + +CMD ["/app/start.sh"] diff --git a/README.md b/README.md index 3bdc0b41bfe753fa97684b546f745f81114d517b..d7a3a4ce78703ba86a53f001aed8a62486d1247c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,26 @@ --- -title: SearchAlgorithms -emoji: ⚡ -colorFrom: gray -colorTo: gray +title: Grid Search Pathfinding +emoji: 🗺️ +colorFrom: blue +colorTo: green sdk: docker +app_port: 7860 pinned: false --- -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# Grid Search - Pathfinding Algorithms Visualization + +An interactive web application to visualize and compare various pathfinding algorithms on a grid-based map. + +## Features + +- **Multiple Algorithms**: A*, BFS, DFS, Greedy Best-First, UCS, IDS +- **Real-time Visualization**: Watch algorithms explore the grid step by step +- **Algorithm Comparison**: Compare performance metrics across different algorithms +- **Customizable Grid**: Generate grids with obstacles, tunnels, and delivery points + +## Tech Stack + +- **Frontend**: React + TypeScript + Vite + TailwindCSS +- **Backend**: FastAPI + Python +- **Visualization**: Real-time WebSocket updates diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..92e68940d24bc52f92b42701d40133fe3ea022f9 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,46 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +.venv/ +venv/ +ENV/ +env/ + +# Testing +.pytest_cache/ +.coverage +htmlcov/ +.tox/ +.nox/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# Build +*.egg-info/ +dist/ +build/ +eggs/ +.eggs/ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log + +# Environment +.env +.env.* +!.env.example + +# UV +.uv/ +uv.lock diff --git a/backend/.python-version b/backend/.python-version new file mode 100644 index 0000000000000000000000000000000000000000..c8cfe3959183f8e9a50f83f54cd723f2dc9c252d --- /dev/null +++ b/backend/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/backend/app/algorithms/__init__.py b/backend/app/algorithms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..87da80414f1ccff549e65b84679eb7cb6c622eef --- /dev/null +++ b/backend/app/algorithms/__init__.py @@ -0,0 +1,22 @@ +"""Search algorithms package.""" +from .bfs import bfs_search, bfs_search_generator +from .dfs import dfs_search, dfs_search_generator +from .ids import ids_search, ids_search_generator +from .ucs import ucs_search, ucs_search_generator +from .greedy import greedy_search, greedy_search_generator +from .astar import astar_search, astar_search_generator + +__all__ = [ + "bfs_search", + "bfs_search_generator", + "dfs_search", + "dfs_search_generator", + "ids_search", + "ids_search_generator", + "ucs_search", + "ucs_search_generator", + "greedy_search", + "greedy_search_generator", + "astar_search", + "astar_search_generator", +] diff --git a/backend/app/algorithms/astar.py b/backend/app/algorithms/astar.py new file mode 100644 index 0000000000000000000000000000000000000000..b78be450646b7cc9564193aef8a9ca1678945fdc --- /dev/null +++ b/backend/app/algorithms/astar.py @@ -0,0 +1,186 @@ +"""A* Search algorithm.""" +from typing import Tuple, Optional, List, Generator, Callable, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..core.frontier import PriorityQueueFrontier +from ..models.state import PathResult, SearchStep + + +def astar_search( + problem: 'GenericSearch', + heuristic: Callable[[Tuple[int, int], Tuple[int, int]], float], + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + A* search using f(n) = g(n) + h(n). + + Optimal if heuristic is admissible (never overestimates). + Complete if step costs are positive. + + Args: + problem: The search problem to solve + heuristic: Function(state, goal) -> estimated cost to goal + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + + # Get goal for heuristic calculation + goal = getattr(problem, 'goal', None) + + h_value = heuristic(start, goal) if goal else 0 + f_value = 0 + h_value # g(n) + h(n) + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=f_value) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + g_value = node.path_cost + step_cost + h_value = heuristic(child_state, goal) if goal else 0 + f_value = g_value + h_value + + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=g_value, + depth=node.depth + 1, + priority=f_value # Priority = f(n) = g(n) + h(n) + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def astar_search_generator( + problem: 'GenericSearch', + heuristic: Callable[[Tuple[int, int], Tuple[int, int]], float] +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of A* search that yields steps during execution. + + Args: + problem: The search problem to solve + heuristic: Heuristic function + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + goal = getattr(problem, 'goal', None) + + h_value = heuristic(start, goal) if goal else 0 + f_value = 0 + h_value + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=f_value) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + g_value = node.path_cost + step_cost + h_value = heuristic(child_state, goal) if goal else 0 + f_value = g_value + h_value + + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=g_value, + depth=node.depth + 1, + priority=f_value + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/algorithms/bfs.py b/backend/app/algorithms/bfs.py new file mode 100644 index 0000000000000000000000000000000000000000..91600f6cebd0aa1d3b847f6f0aa75b052d256e43 --- /dev/null +++ b/backend/app/algorithms/bfs.py @@ -0,0 +1,160 @@ +"""Breadth-First Search algorithm.""" +from typing import Tuple, Optional, List, Generator, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..core.frontier import QueueFrontier +from ..models.state import PathResult, SearchStep + + +def bfs_search( + problem: 'GenericSearch', + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Breadth-first search using FIFO queue. + + Finds path with minimum number of steps (not minimum cost). + Complete and optimal for unweighted graphs. + + Args: + problem: The search problem to solve + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + frontier = QueueFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test after pop (standard BFS) + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def bfs_search_generator( + problem: 'GenericSearch' +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of BFS that yields steps during execution. + + Args: + problem: The search problem to solve + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + frontier = QueueFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/algorithms/dfs.py b/backend/app/algorithms/dfs.py new file mode 100644 index 0000000000000000000000000000000000000000..5d79e705f5cc73c19b944e586cc19925ab1aaf50 --- /dev/null +++ b/backend/app/algorithms/dfs.py @@ -0,0 +1,162 @@ +"""Depth-First Search algorithm.""" +from typing import Tuple, Optional, List, Generator, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..core.frontier import StackFrontier +from ..models.state import PathResult, SearchStep + + +def dfs_search( + problem: 'GenericSearch', + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Depth-first search using LIFO stack. + + Not guaranteed to find optimal solution. + Complete in finite state spaces with cycle detection. + + Args: + problem: The search problem to solve + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + frontier = StackFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + # Expand node (reverse order so first action is processed last -> depth-first) + actions = problem.actions(node.state) + for action in reversed(actions): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def dfs_search_generator( + problem: 'GenericSearch' +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of DFS that yields steps during execution. + + Args: + problem: The search problem to solve + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + frontier = StackFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + actions = problem.actions(node.state) + for action in reversed(actions): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/algorithms/greedy.py b/backend/app/algorithms/greedy.py new file mode 100644 index 0000000000000000000000000000000000000000..6b4bbc50e295b8a45a7721dd80ea36a917746e48 --- /dev/null +++ b/backend/app/algorithms/greedy.py @@ -0,0 +1,181 @@ +"""Greedy Best-First Search algorithm.""" +from typing import Tuple, Optional, List, Generator, Callable, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..core.frontier import PriorityQueueFrontier +from ..models.state import PathResult, SearchStep + + +def greedy_search( + problem: 'GenericSearch', + heuristic: Callable[[Tuple[int, int], Tuple[int, int]], float], + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Greedy best-first search using heuristic only. + + Expands node that appears closest to goal. + Not guaranteed to find optimal solution. + Not complete in general. + + Args: + problem: The search problem to solve + heuristic: Function(state, goal) -> estimated cost to goal + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + + # Get goal for heuristic calculation (assume single goal) + goal = getattr(problem, 'goal', None) + + h_value = heuristic(start, goal) if goal else 0 + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=h_value) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + h_value = heuristic(child_state, goal) if goal else 0 + + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1, + priority=h_value # Priority = h(n) only for Greedy + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def greedy_search_generator( + problem: 'GenericSearch', + heuristic: Callable[[Tuple[int, int], Tuple[int, int]], float] +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of Greedy search that yields steps during execution. + + Args: + problem: The search problem to solve + heuristic: Heuristic function + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + goal = getattr(problem, 'goal', None) + + h_value = heuristic(start, goal) if goal else 0 + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=h_value) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + h_value = heuristic(child_state, goal) if goal else 0 + + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1, + priority=h_value + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/algorithms/ids.py b/backend/app/algorithms/ids.py new file mode 100644 index 0000000000000000000000000000000000000000..fd4eb7d75581c4a5e08138cdb0c1766f06475480 --- /dev/null +++ b/backend/app/algorithms/ids.py @@ -0,0 +1,255 @@ +"""Iterative Deepening Search algorithm.""" +from typing import Tuple, Optional, List, Generator, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..models.state import PathResult, SearchStep + + +# Sentinel values for DLS results +CUTOFF = "cutoff" +FAILURE = "failure" + + +def depth_limited_search( + problem: 'GenericSearch', + limit: int, + visualize: bool = False, + steps: Optional[List[SearchStep]] = None, + base_expanded: int = 0 +) -> Tuple[Optional[PathResult], str, int, Optional[List[SearchStep]]]: + """ + Depth-limited search - DFS with depth limit. + + Args: + problem: The search problem + limit: Maximum depth to search + visualize: If True, collect visualization steps + steps: Existing steps list to append to + base_expanded: Starting count for nodes expanded + + Returns: + Tuple of (PathResult or None, status, nodes_expanded, steps) + status is CUTOFF if limit reached, FAILURE if no solution exists + """ + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + + return _recursive_dls( + problem, start_node, limit, set(), visualize, + steps if steps is not None else ([] if visualize else None), + base_expanded + ) + + +def _recursive_dls( + problem: 'GenericSearch', + node: SearchNode, + limit: int, + explored: set, + visualize: bool, + steps: Optional[List[SearchStep]], + nodes_expanded: int +) -> Tuple[Optional[PathResult], str, int, Optional[List[SearchStep]]]: + """Recursive helper for depth-limited search.""" + + # Record step for visualization + if visualize and steps is not None: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=[], # DLS doesn't maintain explicit frontier + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), "success", nodes_expanded, steps + + # Depth limit reached + if node.depth >= limit: + return None, CUTOFF, nodes_expanded, steps + + # Mark as explored for this path + explored.add(node.state) + nodes_expanded += 1 + + cutoff_occurred = False + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + + result, status, nodes_expanded, steps = _recursive_dls( + problem, child, limit, explored.copy(), visualize, steps, nodes_expanded + ) + + if status == "success": + return result, status, nodes_expanded, steps + elif status == CUTOFF: + cutoff_occurred = True + + if cutoff_occurred: + return None, CUTOFF, nodes_expanded, steps + else: + return None, FAILURE, nodes_expanded, steps + + +def ids_search( + problem: 'GenericSearch', + visualize: bool = False, + max_depth: int = 1000 +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Iterative deepening search - repeated DLS with increasing depth. + + Combines BFS's completeness and optimality (for unweighted) + with DFS's space efficiency. + + Args: + problem: The search problem to solve + visualize: If True, collect visualization steps + max_depth: Maximum depth to search (prevents infinite loops) + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + total_expanded = 0 + all_steps: List[SearchStep] = [] if visualize else None + + for depth in range(max_depth): + result, status, expanded, steps = depth_limited_search( + problem, depth, visualize, all_steps, total_expanded + ) + total_expanded = expanded + + if visualize and steps: + all_steps = steps + + if status == "success" and result is not None: + result.nodes_expanded = total_expanded + return result, all_steps + elif status == FAILURE: + # No solution exists + break + + # No solution found within max_depth + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=total_expanded, + path=[] + ), all_steps + + +def ids_search_generator( + problem: 'GenericSearch', + max_depth: int = 1000 +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of IDS that yields steps during execution. + + Args: + problem: The search problem to solve + max_depth: Maximum depth to search + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + total_expanded = 0 + + for depth in range(max_depth): + # Run DLS and yield steps + for step in _dls_generator(problem, depth, total_expanded): + yield step + total_expanded = step.step_number + + # Check if solution was found at this depth + result, status, expanded, _ = depth_limited_search( + problem, depth, False, None, total_expanded + ) + total_expanded = expanded + + if status == "success" and result is not None: + result.nodes_expanded = total_expanded + return result + elif status == FAILURE: + break + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=total_expanded, + path=[] + ) + + +def _dls_generator( + problem: 'GenericSearch', + limit: int, + base_expanded: int +) -> Generator[SearchStep, None, None]: + """Generator helper for DLS.""" + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + + stack = [(start_node, set())] + nodes_expanded = base_expanded + + while stack: + node, explored = stack.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=[n.state for n, _ in stack], + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return + + if node.depth >= limit: + continue + + explored = explored | {node.state} + nodes_expanded += 1 + + for action in reversed(problem.actions(node.state)): + child_state = problem.result(node.state, action) + if child_state not in explored: + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + stack.append((child, explored)) diff --git a/backend/app/algorithms/ucs.py b/backend/app/algorithms/ucs.py new file mode 100644 index 0000000000000000000000000000000000000000..5b183b79b05c28360af98d96de642288dfcf6f54 --- /dev/null +++ b/backend/app/algorithms/ucs.py @@ -0,0 +1,166 @@ +"""Uniform Cost Search algorithm.""" +from typing import Tuple, Optional, List, Generator, TYPE_CHECKING + +if TYPE_CHECKING: + from ..core.generic_search import GenericSearch + +from ..core.node import SearchNode +from ..core.frontier import PriorityQueueFrontier +from ..models.state import PathResult, SearchStep + + +def ucs_search( + problem: 'GenericSearch', + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Uniform Cost Search using priority queue ordered by path cost. + + Always finds the optimal (minimum cost) solution. + Complete if step costs are positive. + + Args: + problem: The search problem to solve + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test (after pop for UCS) + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + step_cost = problem.step_cost(node.state, action, child_state) + new_cost = node.path_cost + step_cost + + if child_state not in explored: + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=new_cost, + depth=node.depth + 1, + priority=new_cost # Priority = path cost for UCS + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def ucs_search_generator( + problem: 'GenericSearch' +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of UCS that yields steps during execution. + + Args: + problem: The search problem to solve + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + frontier = PriorityQueueFrontier() + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0, priority=0) + frontier.push(start_node) + + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + step_cost = problem.step_cost(node.state, action, child_state) + new_cost = node.path_cost + step_cost + + if child_state not in explored: + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=new_cost, + depth=node.depth + 1, + priority=new_cost + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/api/__init__.py b/backend/app/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1ba4038003af96b16ba233758fd7e2a265015a2a --- /dev/null +++ b/backend/app/api/__init__.py @@ -0,0 +1,5 @@ +"""API package.""" +from .routes import router +from .websocket import handle_visualization, manager + +__all__ = ["router", "handle_visualization", "manager"] diff --git a/backend/app/api/routes.py b/backend/app/api/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..8ce15aba18ba4b49413da4ab3235bd94957cd652 --- /dev/null +++ b/backend/app/api/routes.py @@ -0,0 +1,270 @@ +"""API routes for the delivery search application.""" +from fastapi import APIRouter, HTTPException +from typing import List + +from ..models.requests import ( + GridConfig, + SearchRequest, + PathRequest, + CompareRequest, + Position, + GenerateResponse, + SearchResponse, + PlanResponse, + ComparisonResult, + CompareResponse, + AlgorithmInfo, + AlgorithmsResponse, + GridData, + StoreData, + DestinationData, + TunnelData, + SegmentData, +) +from ..services import gen_grid, parse_full_state, measure_performance +from ..core import DeliverySearch, DeliveryPlanner + + +router = APIRouter() + + +# Algorithm metadata +ALGORITHMS = [ + AlgorithmInfo( + code="BF", + name="Breadth-First Search", + description="Explores all nodes at current depth before moving deeper. Finds shortest path in terms of steps." + ), + AlgorithmInfo( + code="DF", + name="Depth-First Search", + description="Explores as far as possible along each branch. Memory efficient but may not find optimal path." + ), + AlgorithmInfo( + code="ID", + name="Iterative Deepening", + description="Combines BFS completeness with DFS space efficiency. Good for unknown depth goals." + ), + AlgorithmInfo( + code="UC", + name="Uniform Cost Search", + description="Expands lowest-cost node first. Always finds the optimal (minimum cost) solution." + ), + AlgorithmInfo( + code="GR1", + name="Greedy (Manhattan)", + description="Uses Manhattan distance heuristic. Fast but may not find optimal path." + ), + AlgorithmInfo( + code="GR2", + name="Greedy (Euclidean)", + description="Uses Euclidean distance heuristic. Fast but may not find optimal path." + ), + AlgorithmInfo( + code="AS1", + name="A* (Manhattan)", + description="A* with Manhattan distance. Optimal and complete with admissible heuristic." + ), + AlgorithmInfo( + code="AS2", + name="A* (Tunnel-Aware)", + description="A* considering tunnel shortcuts. More informed for grids with tunnels." + ), +] + + +@router.get("/api/health") +async def health_check(): + """Health check endpoint.""" + return {"status": "ok"} + + +@router.get("/api/algorithms", response_model=AlgorithmsResponse) +async def list_algorithms(): + """List available search algorithms.""" + return AlgorithmsResponse(algorithms=ALGORITHMS) + + +@router.post("/api/grid/generate", response_model=GenerateResponse) +async def generate_grid(config: GridConfig): + """Generate a random grid configuration.""" + try: + initial_state, traffic, state = gen_grid( + width=config.width, + height=config.height, + num_stores=config.num_stores, + num_destinations=config.num_destinations, + num_tunnels=config.num_tunnels, + obstacle_density=config.obstacle_density + ) + + # Convert to GridData for frontend + parsed = GridData( + width=state.grid.width, + height=state.grid.height, + stores=[ + StoreData(id=s.id, position=Position(x=s.position[0], y=s.position[1])) + for s in state.stores + ], + destinations=[ + DestinationData(id=d.id, position=Position(x=d.position[0], y=d.position[1])) + for d in state.destinations + ], + tunnels=[ + TunnelData( + entrance1=Position(x=t.entrance1[0], y=t.entrance1[1]), + entrance2=Position(x=t.entrance2[0], y=t.entrance2[1]), + cost=t.cost + ) + for t in state.tunnels + ], + segments=[ + SegmentData( + src=Position(x=seg.src[0], y=seg.src[1]), + dst=Position(x=seg.dst[0], y=seg.dst[1]), + traffic=seg.traffic + ) + for seg in state.grid.segments.values() + ] + ) + + return GenerateResponse( + initial_state=initial_state, + traffic=traffic, + parsed=parsed + ) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + +@router.post("/api/search/path", response_model=SearchResponse) +async def find_path(request: PathRequest): + """Find path from start to goal using specified strategy.""" + try: + from ..models.grid import Grid + from ..models.entities import Tunnel + + # Build grid from request + grid = Grid(width=request.grid_width, height=request.grid_height) + for seg in request.segments: + grid.add_segment( + (seg.src.x, seg.src.y), + (seg.dst.x, seg.dst.y), + seg.traffic + ) + + # Build tunnels + tunnels = [ + Tunnel( + entrance1=(t.entrance1.x, t.entrance1.y), + entrance2=(t.entrance2.x, t.entrance2.y) + ) + for t in request.tunnels + ] + + # Run search with metrics + with measure_performance() as metrics: + result, steps = DeliverySearch.path( + grid, + (request.start.x, request.start.y), + (request.goal.x, request.goal.y), + tunnels, + request.strategy.value, + visualize=True + ) + metrics.sample() + + return SearchResponse( + plan=result.plan, + cost=result.cost, + nodes_expanded=result.nodes_expanded, + runtime_ms=metrics.runtime_ms, + memory_mb=max(0, metrics.memory_mb), + cpu_percent=metrics.cpu_percent, + path=[Position(x=p[0], y=p[1]) for p in result.path], + steps=[s.to_dict() for s in steps] if steps else None + ) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + +@router.post("/api/search/plan", response_model=PlanResponse) +async def create_plan(request: SearchRequest): + """Create full delivery plan for all trucks and destinations.""" + try: + # Parse state + state = parse_full_state(request.initial_state, request.traffic) + + # Run planner with metrics + with measure_performance() as metrics: + plan_result, viz_data = DeliveryPlanner.plan_from_state( + state.grid, + state.stores, + state.destinations, + state.tunnels, + request.strategy.value, + request.visualize + ) + metrics.sample() + + return PlanResponse( + output=plan_result.to_string(), + assignments=[a.to_dict() for a in plan_result.assignments], + total_cost=plan_result.total_cost, + total_nodes_expanded=plan_result.total_nodes_expanded, + runtime_ms=metrics.runtime_ms, + memory_mb=max(0, metrics.memory_mb), + cpu_percent=metrics.cpu_percent + ) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + + +@router.post("/api/search/compare", response_model=CompareResponse) +async def compare_algorithms(request: CompareRequest): + """Run all algorithms on same problem and return comparison.""" + try: + state = parse_full_state(request.initial_state, request.traffic) + + results: List[ComparisonResult] = [] + optimal_cost = float('inf') + + # Run each algorithm + for algo_info in ALGORITHMS: + with measure_performance() as metrics: + plan_result, _ = DeliveryPlanner.plan_from_state( + state.grid, + state.stores, + state.destinations, + state.tunnels, + algo_info.code, + visualize=False + ) + metrics.sample() + + # Track optimal cost (from UCS or A*) + if algo_info.code in ["UC", "AS1", "AS2"]: + optimal_cost = min(optimal_cost, plan_result.total_cost) + + results.append(ComparisonResult( + algorithm=algo_info.code, + name=algo_info.name, + plan=plan_result.to_string(), + cost=plan_result.total_cost, + nodes_expanded=plan_result.total_nodes_expanded, + runtime_ms=metrics.runtime_ms, + memory_mb=max(0, metrics.memory_mb), + cpu_percent=metrics.cpu_percent, + is_optimal=False # Will be set below + )) + + # Mark optimal solutions + for result in results: + result.is_optimal = (result.cost == optimal_cost) + + return CompareResponse( + comparisons=results, + optimal_cost=optimal_cost + ) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) diff --git a/backend/app/core/__init__.py b/backend/app/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..67189d621666f0dc9b5e73435ca8a66f31a490c0 --- /dev/null +++ b/backend/app/core/__init__.py @@ -0,0 +1,19 @@ +"""Core search module.""" +from .node import SearchNode +from .frontier import Frontier, QueueFrontier, StackFrontier, PriorityQueueFrontier +from .generic_search import GenericSearch, graph_search, graph_search_generator +from .delivery_search import DeliverySearch +from .delivery_planner import DeliveryPlanner + +__all__ = [ + "SearchNode", + "Frontier", + "QueueFrontier", + "StackFrontier", + "PriorityQueueFrontier", + "GenericSearch", + "graph_search", + "graph_search_generator", + "DeliverySearch", + "DeliveryPlanner", +] diff --git a/backend/app/core/delivery_planner.py b/backend/app/core/delivery_planner.py new file mode 100644 index 0000000000000000000000000000000000000000..b13b85fa8185945c17afd50ca01b5fc4d2283dde --- /dev/null +++ b/backend/app/core/delivery_planner.py @@ -0,0 +1,197 @@ +"""DeliveryPlanner - Plans which trucks deliver which packages.""" +from typing import List, Dict, Tuple, Optional +from .delivery_search import DeliverySearch +from ..models.grid import Grid +from ..models.entities import Store, Destination, Tunnel +from ..models.state import PathResult, PlanResult, DeliveryAssignment, SearchStep + + +class DeliveryPlanner: + """ + Plans the assignment of destinations to stores/trucks. + + For each destination, finds the optimal store to deliver from and computes the delivery path. + """ + + def __init__( + self, + grid: Grid, + stores: List[Store], + destinations: List[Destination], + tunnels: Optional[List[Tunnel]] = None + ): + """ + Initialize the delivery planner. + + Args: + grid: The city grid with traffic information + stores: List of store locations (each has a truck) + destinations: List of customer destinations + tunnels: Available tunnels + """ + self.grid = grid + self.stores = stores + self.destinations = destinations + self.tunnels = tunnels or [] + + def plan( + self, + strategy: str, + visualize: bool = False + ) -> Tuple[PlanResult, Optional[Dict[int, List[SearchStep]]]]: + """ + Create delivery plan assigning destinations to stores. + + Algorithm: + 1. For each destination, compute path cost from each store + 2. Assign each destination to the store with minimum path cost + 3. Compile results + + Args: + strategy: Search strategy to use + visualize: If True, collect visualization steps + + Returns: + Tuple of (PlanResult, Optional visualization data) + """ + assignments: List[DeliveryAssignment] = [] + all_steps: Dict[int, List[SearchStep]] = {} if visualize else None + total_cost = 0.0 + total_nodes = 0 + + # For each destination, find best store + for dest in self.destinations: + best_store: Optional[Store] = None + best_result: Optional[PathResult] = None + best_steps: Optional[List[SearchStep]] = None + best_cost = float('inf') + + # Try each store + for store in self.stores: + result, steps = DeliverySearch.path( + self.grid, + store.position, + dest.position, + self.tunnels, + strategy, + visualize + ) + + # Track nodes expanded + total_nodes += result.nodes_expanded + + # Check if this is better + if result.cost < best_cost: + best_cost = result.cost + best_store = store + best_result = result + best_steps = steps + + # Create assignment + if best_store and best_result: + assignment = DeliveryAssignment( + store_id=best_store.id, + destination_id=dest.id, + path_result=best_result + ) + assignments.append(assignment) + total_cost += best_result.cost + + if visualize and best_steps: + all_steps[dest.id] = best_steps + + return PlanResult( + assignments=assignments, + total_cost=total_cost, + total_nodes_expanded=total_nodes + ), all_steps + + def plan_all_from_store( + self, + store: Store, + strategy: str, + visualize: bool = False + ) -> List[Tuple[Destination, PathResult, Optional[List[SearchStep]]]]: + """ + Plan all deliveries from a single store. + + This variant finds paths from one store to all destinations, + useful for comparing which destinations are closest. + + Args: + store: The store to deliver from + strategy: Search strategy to use + visualize: If True, collect visualization steps + + Returns: + List of (destination, path_result, steps) tuples + """ + results = [] + + for dest in self.destinations: + result, steps = DeliverySearch.path( + self.grid, + store.position, + dest.position, + self.tunnels, + strategy, + visualize + ) + results.append((dest, result, steps)) + + # Sort by cost (closest first) + results.sort(key=lambda x: x[1].cost) + return results + + def plan_sequential( + self, + strategy: str, + visualize: bool = False + ) -> Tuple[PlanResult, Optional[Dict]]: + """ + Plan deliveries where trucks return to store after each delivery. + + For each destination: + 1. Find best store (minimum round-trip or just delivery cost) + 2. Assign to that store + + This is the simplified version as per project spec where + "once a delivery has been made, the truck immediately returns + to the store and can now make a new delivery." + + Args: + strategy: Search strategy to use + visualize: If True, collect visualization steps + + Returns: + Tuple of (PlanResult, Optional visualization data) + """ + # For this simplified version, we use the same logic as plan() + # since each delivery is independent (truck returns to store) + return self.plan(strategy, visualize) + + @staticmethod + def plan_from_state( + grid: Grid, + stores: List[Store], + destinations: List[Destination], + tunnels: List[Tunnel], + strategy: str, + visualize: bool = False + ) -> Tuple[PlanResult, Optional[Dict]]: + """ + Static method to create and run planner. + + Args: + grid: The city grid + stores: List of stores + destinations: List of destinations + tunnels: Available tunnels + strategy: Search strategy + visualize: If True, collect visualization steps + + Returns: + Tuple of (PlanResult, Optional visualization data) + """ + planner = DeliveryPlanner(grid, stores, destinations, tunnels) + return planner.plan(strategy, visualize) diff --git a/backend/app/core/delivery_search.py b/backend/app/core/delivery_search.py new file mode 100644 index 0000000000000000000000000000000000000000..d2f87af3eb51cc238aa27c369e9228871ee1108f --- /dev/null +++ b/backend/app/core/delivery_search.py @@ -0,0 +1,211 @@ +"""DeliverySearch - Search problem for package delivery.""" +from typing import List, Tuple, Optional, Dict +from .generic_search import GenericSearch +from ..models.grid import Grid +from ..models.entities import Tunnel +from ..models.state import PathResult, SearchStep +from ..heuristics import create_tunnel_aware_heuristic + + +class DeliverySearch(GenericSearch): + """ + Search problem for finding path from a store to a destination. + + Implements the GenericSearch interface for the package delivery problem. + Supports movement in 4 directions (up/down/left/right) and tunnel travel. + """ + + def __init__( + self, + grid: Grid, + start: Tuple[int, int], + goal: Tuple[int, int], + tunnels: Optional[List[Tunnel]] = None + ): + """ + Initialize the delivery search problem. + + Args: + grid: The city grid with traffic information + start: Starting position (store location) + goal: Goal position (destination location) + tunnels: List of available tunnels + """ + self.grid = grid + self.start = start + self.goal = goal + self.tunnels = tunnels or [] + + # Create tunnel lookup by entrance position + self._tunnel_entrances: Dict[Tuple[int, int], Tunnel] = {} + for tunnel in self.tunnels: + self._tunnel_entrances[tunnel.entrance1] = tunnel + self._tunnel_entrances[tunnel.entrance2] = tunnel + + # Create tunnel-aware heuristic + self._tunnel_heuristic = create_tunnel_aware_heuristic(self.tunnels) + + def initial_state(self) -> Tuple[int, int]: + """Return the starting position.""" + return self.start + + def goal_test(self, state: Tuple[int, int]) -> bool: + """Check if current state is the goal.""" + return state == self.goal + + def actions(self, state: Tuple[int, int]) -> List[str]: + """ + Return list of valid actions from current state. + + Actions: + - up: Move up (y+1) + - down: Move down (y-1) + - left: Move left (x-1) + - right: Move right (x+1) + - tunnel: Use tunnel if at entrance + + Returns: + List of valid action strings + """ + x, y = state + valid_actions = [] + + # Check each direction + directions = [ + ("up", (x, y + 1)), + ("down", (x, y - 1)), + ("left", (x - 1, y)), + ("right", (x + 1, y)), + ] + + for action, new_pos in directions: + if self.grid.is_valid_position(new_pos): + if not self.grid.is_blocked(state, new_pos): + valid_actions.append(action) + + # Check for tunnel + if state in self._tunnel_entrances: + valid_actions.append("tunnel") + + return valid_actions + + def result(self, state: Tuple[int, int], action: str) -> Tuple[int, int]: + """ + Apply action to state and return new state. + + Args: + state: Current position + action: Action to take + + Returns: + New position after action + """ + x, y = state + + if action == "up": + return (x, y + 1) + elif action == "down": + return (x, y - 1) + elif action == "left": + return (x - 1, y) + elif action == "right": + return (x + 1, y) + elif action == "tunnel": + if state in self._tunnel_entrances: + tunnel = self._tunnel_entrances[state] + return tunnel.get_other_entrance(state) + else: + raise ValueError(f"No tunnel entrance at {state}") + else: + raise ValueError(f"Unknown action: {action}") + + def step_cost( + self, + state: Tuple[int, int], + action: str, + next_state: Tuple[int, int] + ) -> float: + """ + Return the cost of taking an action. + + For regular moves: cost = traffic level of the segment + For tunnels: cost = Manhattan distance between entrances + + Args: + state: Current position + action: Action taken + next_state: Resulting position + + Returns: + Cost of the action + """ + if action == "tunnel": + tunnel = self._tunnel_entrances.get(state) + if tunnel: + return tunnel.cost + return 0.0 + else: + # Regular movement - cost is traffic level + return self.grid.get_traffic(state, next_state) + + def heuristic(self, state: Tuple[int, int]) -> float: + """ + Tunnel-aware heuristic for A* search. + + Args: + state: Current position + + Returns: + Estimated cost to goal + """ + return self._tunnel_heuristic(state, self.goal) + + @staticmethod + def path( + grid: Grid, + start: Tuple[int, int], + goal: Tuple[int, int], + tunnels: List[Tunnel], + strategy: str, + visualize: bool = False + ) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Find path from start to goal using specified strategy. + + Args: + grid: The city grid + start: Starting position + goal: Goal position + tunnels: Available tunnels + strategy: Search strategy (BF, DF, ID, UC, GR1, GR2, AS1, AS2) + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + search = DeliverySearch(grid, start, goal, tunnels) + return search.solve(strategy, visualize) + + @staticmethod + def path_string( + grid: Grid, + start: Tuple[int, int], + goal: Tuple[int, int], + tunnels: List[Tunnel], + strategy: str + ) -> str: + """ + Find path and return formatted string. + + Args: + grid: The city grid + start: Starting position + goal: Goal position + tunnels: Available tunnels + strategy: Search strategy + + Returns: + String in format "plan;cost;nodesExpanded" + """ + result, _ = DeliverySearch.path(grid, start, goal, tunnels, strategy) + return result.to_string() diff --git a/backend/app/core/frontier.py b/backend/app/core/frontier.py new file mode 100644 index 0000000000000000000000000000000000000000..d0d6637e19823f0926c68b4b66297d0da256cfd5 --- /dev/null +++ b/backend/app/core/frontier.py @@ -0,0 +1,182 @@ +"""Frontier data structures for search algorithms.""" +from abc import ABC, abstractmethod +from collections import deque +import heapq +from typing import List, Optional, Set, Dict +from .node import SearchNode + + +class Frontier(ABC): + """Abstract base class for frontier data structures.""" + + @abstractmethod + def push(self, node: SearchNode) -> None: + """Add a node to the frontier.""" + pass + + @abstractmethod + def pop(self) -> SearchNode: + """Remove and return the next node from the frontier.""" + pass + + @abstractmethod + def is_empty(self) -> bool: + """Check if the frontier is empty.""" + pass + + @abstractmethod + def __len__(self) -> int: + """Return the number of nodes in the frontier.""" + pass + + @abstractmethod + def contains_state(self, state) -> bool: + """Check if a state is in the frontier.""" + pass + + def get_states(self) -> List: + """Get all states in the frontier (for visualization).""" + return [] + + +class QueueFrontier(Frontier): + """FIFO queue frontier for Breadth-First Search.""" + + def __init__(self): + self._queue: deque[SearchNode] = deque() + self._states: Set = set() + + def push(self, node: SearchNode) -> None: + self._queue.append(node) + self._states.add(node.state) + + def pop(self) -> SearchNode: + node = self._queue.popleft() + self._states.discard(node.state) + return node + + def is_empty(self) -> bool: + return len(self._queue) == 0 + + def __len__(self) -> int: + return len(self._queue) + + def contains_state(self, state) -> bool: + return state in self._states + + def get_states(self) -> List: + return [node.state for node in self._queue] + + +class StackFrontier(Frontier): + """LIFO stack frontier for Depth-First Search.""" + + def __init__(self): + self._stack: List[SearchNode] = [] + self._states: Set = set() + + def push(self, node: SearchNode) -> None: + self._stack.append(node) + self._states.add(node.state) + + def pop(self) -> SearchNode: + node = self._stack.pop() + self._states.discard(node.state) + return node + + def is_empty(self) -> bool: + return len(self._stack) == 0 + + def __len__(self) -> int: + return len(self._stack) + + def contains_state(self, state) -> bool: + return state in self._states + + def get_states(self) -> List: + return [node.state for node in self._stack] + + +class PriorityQueueFrontier(Frontier): + """ + Priority queue frontier for UCS, Greedy, and A* search. + + Uses heapq with a counter to break ties and ensure FIFO ordering for nodes with equal priority. + """ + + def __init__(self): + self._heap: List[tuple] = [] # (priority, counter, node) + self._counter: int = 0 + self._states: Dict = {} # state -> (priority, node) for updates + self._removed: Set = set() # Track removed entries + + def push(self, node: SearchNode) -> None: + """ + Add a node to the priority queue. + + If a node with the same state already exists with higher priority, it will be updated. + """ + state = node.state + priority = node.priority + + # If state exists with higher or equal priority, skip + if state in self._states: + existing_priority, _ = self._states[state] + if existing_priority <= priority: + return + # Mark old entry as removed + self._removed.add((existing_priority, state)) + + # Add new entry + entry = (priority, self._counter, node) + heapq.heappush(self._heap, entry) + self._states[state] = (priority, node) + self._counter += 1 + + def pop(self) -> SearchNode: + """Remove and return the node with lowest priority.""" + while self._heap: + priority, _, node = heapq.heappop(self._heap) + + # Skip removed entries + if (priority, node.state) in self._removed: + self._removed.discard((priority, node.state)) + continue + + # Skip if this is not the current entry for this state + if node.state in self._states: + current_priority, current_node = self._states[node.state] + if current_priority != priority: + continue + del self._states[node.state] + + return node + + raise IndexError("Pop from empty frontier") + + def is_empty(self) -> bool: + # Account for lazy deletions + return len(self._states) == 0 + + def __len__(self) -> int: + return len(self._states) + + def contains_state(self, state) -> bool: + return state in self._states + + def get_node(self, state) -> Optional[SearchNode]: + """Get the node for a given state if it exists.""" + if state in self._states: + _, node = self._states[state] + return node + return None + + def get_states(self) -> List: + return list(self._states.keys()) + + def get_priority(self, state) -> Optional[float]: + """Get the priority of a state if it exists.""" + if state in self._states: + priority, _ = self._states[state] + return priority + return None diff --git a/backend/app/core/generic_search.py b/backend/app/core/generic_search.py new file mode 100644 index 0000000000000000000000000000000000000000..f2cc1f3fb56652d5d5f4ee09bf52fb5d1beed4e8 --- /dev/null +++ b/backend/app/core/generic_search.py @@ -0,0 +1,303 @@ +"""Generic search problem abstract base class.""" +from abc import ABC, abstractmethod +from typing import List, Tuple, Optional, Generator +from .node import SearchNode +from .frontier import Frontier +from ..models.state import PathResult, SearchStep + + +class GenericSearch(ABC): + """ + Abstract base class for search problems. + + Subclasses must implement: + - initial_state(): Return the starting state + - goal_test(state): Return True if state is a goal + - actions(state): Return list of valid actions from state + - result(state, action): Return new state after action + - step_cost(state, action, next_state): Return cost of action + """ + + @abstractmethod + def initial_state(self) -> Tuple[int, int]: + """Return the initial state.""" + pass + + @abstractmethod + def goal_test(self, state: Tuple[int, int]) -> bool: + """Return True if state is a goal state.""" + pass + + @abstractmethod + def actions(self, state: Tuple[int, int]) -> List[str]: + """Return list of valid actions from given state.""" + pass + + @abstractmethod + def result(self, state: Tuple[int, int], action: str) -> Tuple[int, int]: + """Return the state resulting from taking action in given state.""" + pass + + @abstractmethod + def step_cost( + self, state: Tuple[int, int], action: str, next_state: Tuple[int, int] + ) -> float: + """Return the cost of taking action from state to next_state.""" + pass + + def heuristic(self, state: Tuple[int, int]) -> float: + """ + Heuristic function h(n) estimating cost from state to goal. + Override in subclass for informed search. + """ + return 0.0 + + def solve( + self, + strategy: str, + visualize: bool = False + ) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Solve the search problem using the specified strategy. + + Args: + strategy: One of 'BF', 'DF', 'ID', 'UC', 'GR1', 'GR2', 'AS1', 'AS2' + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + from ..algorithms import ( + bfs_search, + dfs_search, + ids_search, + ucs_search, + greedy_search, + astar_search, + ) + from ..heuristics import ( + manhattan_heuristic, + euclidean_heuristic, + ) + + # Wrap instance heuristic to match expected signature (state, goal) -> float + def tunnel_aware_wrapper(state, goal): + return self.heuristic(state) + + # Map strategy codes to search functions + strategy_map = { + 'BF': lambda: bfs_search(self, visualize), + 'DF': lambda: dfs_search(self, visualize), + 'ID': lambda: ids_search(self, visualize), + 'UC': lambda: ucs_search(self, visualize), + 'GR1': lambda: greedy_search(self, manhattan_heuristic, visualize), + 'GR2': lambda: greedy_search(self, euclidean_heuristic, visualize), + 'AS1': lambda: astar_search(self, manhattan_heuristic, visualize), + 'AS2': lambda: astar_search(self, tunnel_aware_wrapper, visualize), # Tunnel-aware + } + + if strategy not in strategy_map: + raise ValueError(f"Unknown strategy: {strategy}") + + return strategy_map[strategy]() + + def solve_with_steps( + self, strategy: str + ) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of solve that yields steps for real-time visualization. + + Args: + strategy: Search strategy code + + Yields: + SearchStep objects during search + + Returns: + Final PathResult + """ + from ..algorithms import ( + bfs_search_generator, + dfs_search_generator, + ids_search_generator, + ucs_search_generator, + greedy_search_generator, + astar_search_generator, + ) + from ..heuristics import ( + manhattan_heuristic, + euclidean_heuristic, + ) + + # Wrap instance heuristic to match expected signature (state, goal) -> float + def tunnel_aware_wrapper(state, goal): + return self.heuristic(state) + + strategy_map = { + 'BF': lambda: bfs_search_generator(self), + 'DF': lambda: dfs_search_generator(self), + 'ID': lambda: ids_search_generator(self), + 'UC': lambda: ucs_search_generator(self), + 'GR1': lambda: greedy_search_generator(self, manhattan_heuristic), + 'GR2': lambda: greedy_search_generator(self, euclidean_heuristic), + 'AS1': lambda: astar_search_generator(self, manhattan_heuristic), + 'AS2': lambda: astar_search_generator(self, tunnel_aware_wrapper), + } + + if strategy not in strategy_map: + raise ValueError(f"Unknown strategy: {strategy}") + + return strategy_map[strategy]() + + +def graph_search( + problem: GenericSearch, + frontier: Frontier, + visualize: bool = False +) -> Tuple[PathResult, Optional[List[SearchStep]]]: + """ + Generic graph search algorithm. + + Args: + problem: The search problem to solve + frontier: The frontier data structure (Queue, Stack, or PriorityQueue) + visualize: If True, collect visualization steps + + Returns: + Tuple of (PathResult, Optional[List[SearchStep]]) + """ + # Initialize + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + explored: set = set() + nodes_expanded = 0 + steps: List[SearchStep] = [] if visualize else None + + while not frontier.is_empty(): + # Get next node + node = frontier.pop() + + # Record step for visualization + if visualize: + steps.append(SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + )) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ), steps + + # Skip if already explored + if node.state in explored: + continue + + # Mark as explored and count + explored.add(node.state) + nodes_expanded += 1 + + # Expand node + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + # No solution found + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ), steps + + +def graph_search_generator( + problem: GenericSearch, + frontier: Frontier +) -> Generator[SearchStep, None, PathResult]: + """ + Generator version of graph search that yields steps during execution. + + Args: + problem: The search problem to solve + frontier: The frontier data structure + + Yields: + SearchStep objects + + Returns: + Final PathResult + """ + start = problem.initial_state() + start_node = SearchNode(state=start, path_cost=0, depth=0) + frontier.push(start_node) + explored: set = set() + nodes_expanded = 0 + + while not frontier.is_empty(): + node = frontier.pop() + + # Yield current step + yield SearchStep( + step_number=nodes_expanded, + current_node=node.state, + action=node.action, + frontier=frontier.get_states(), + explored=list(explored), + current_path=node.get_path(), + path_cost=node.path_cost + ) + + # Goal test + if problem.goal_test(node.state): + return PathResult( + plan=node.get_solution(), + cost=node.path_cost, + nodes_expanded=nodes_expanded, + path=node.get_path() + ) + + if node.state in explored: + continue + + explored.add(node.state) + nodes_expanded += 1 + + for action in problem.actions(node.state): + child_state = problem.result(node.state, action) + if child_state not in explored and not frontier.contains_state(child_state): + step_cost = problem.step_cost(node.state, action, child_state) + child = SearchNode( + state=child_state, + parent=node, + action=action, + path_cost=node.path_cost + step_cost, + depth=node.depth + 1 + ) + frontier.push(child) + + return PathResult( + plan="", + cost=float('inf'), + nodes_expanded=nodes_expanded, + path=[] + ) diff --git a/backend/app/core/node.py b/backend/app/core/node.py new file mode 100644 index 0000000000000000000000000000000000000000..5bdb4ab4f9c0e15ef79b858fa39347c575149bd1 --- /dev/null +++ b/backend/app/core/node.py @@ -0,0 +1,119 @@ +"""SearchNode class for the search tree.""" +from dataclasses import dataclass, field +from typing import Optional, List, Tuple, Any + + +@dataclass +class SearchNode: + """ + Represents a node in the search tree. + + Attributes: + state: Current position (x, y) on the grid + parent: Parent node for path reconstruction + action: Action taken to reach this node (up/down/left/right/tunnel) + path_cost: g(n) - cost from start to this node + depth: Depth in search tree + """ + state: Tuple[int, int] + parent: Optional['SearchNode'] = None + action: Optional[str] = None + path_cost: float = 0.0 + depth: int = 0 + # For priority queue - lower is better + priority: float = field(default=0.0, compare=False) + + def __lt__(self, other: 'SearchNode') -> bool: + """Compare nodes by priority for priority queue.""" + return self.priority < other.priority + + def __eq__(self, other: Any) -> bool: + """Nodes are equal if they have the same state.""" + if not isinstance(other, SearchNode): + return False + return self.state == other.state + + def __hash__(self) -> int: + """Hash by state for set membership.""" + return hash(self.state) + + def get_path(self) -> List[Tuple[int, int]]: + """ + Reconstruct the path from root to this node. + + Returns: + List of positions from start to current node + """ + path = [] + node: Optional[SearchNode] = self + while node is not None: + path.append(node.state) + node = node.parent + path.reverse() + return path + + def get_actions(self) -> List[str]: + """ + Reconstruct the sequence of actions from root to this node. + + Returns: + List of actions taken from start to current node + """ + actions = [] + node: Optional[SearchNode] = self + while node is not None and node.action is not None: + actions.append(node.action) + node = node.parent + actions.reverse() + return actions + + def get_solution(self) -> str: + """ + Get the solution as a comma-separated string of actions. + + Returns: + String in format "action1,action2,action3,..." + """ + actions = self.get_actions() + return ",".join(actions) if actions else "" + + def expand( + self, + actions_func, + result_func, + cost_func, + heuristic_func=None + ) -> List['SearchNode']: + """ + Expand this node by generating all child nodes. + + Args: + actions_func: Function(state) -> List[str] of valid actions + result_func: Function(state, action) -> new_state + cost_func: Function(state, action, new_state) -> step_cost + heuristic_func: Optional Function(state, goal) -> h(n) for A*/Greedy + + Returns: + List of child SearchNode objects + """ + children = [] + for action in actions_func(self.state): + new_state = result_func(self.state, action) + step_cost = cost_func(self.state, action, new_state) + child = SearchNode( + state=new_state, + parent=self, + action=action, + path_cost=self.path_cost + step_cost, + depth=self.depth + 1 + ) + # Set priority if heuristic is provided (for A*) + if heuristic_func is not None: + child.priority = child.path_cost + heuristic_func(new_state) + else: + child.priority = child.path_cost + children.append(child) + return children + + def __repr__(self) -> str: + return f"SearchNode(state={self.state}, depth={self.depth}, cost={self.path_cost})" diff --git a/backend/app/heuristics/__init__.py b/backend/app/heuristics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..14059e7e1b8242a19e4fe1593d643e47ebd97e46 --- /dev/null +++ b/backend/app/heuristics/__init__.py @@ -0,0 +1,14 @@ +"""Heuristics package for informed search algorithms.""" +from .manhattan import manhattan_heuristic +from .euclidean import euclidean_heuristic +from .traffic_weighted import traffic_weighted_heuristic, create_traffic_weighted_heuristic +from .tunnel_aware import tunnel_aware_heuristic, create_tunnel_aware_heuristic + +__all__ = [ + "manhattan_heuristic", + "euclidean_heuristic", + "traffic_weighted_heuristic", + "create_traffic_weighted_heuristic", + "tunnel_aware_heuristic", + "create_tunnel_aware_heuristic", +] diff --git a/backend/app/heuristics/euclidean.py b/backend/app/heuristics/euclidean.py new file mode 100644 index 0000000000000000000000000000000000000000..2da1e9c7f8e01bed900ab1855c4485fc179396bb --- /dev/null +++ b/backend/app/heuristics/euclidean.py @@ -0,0 +1,24 @@ +"""Euclidean distance heuristic.""" +import math +from typing import Tuple + + +def euclidean_heuristic(state: Tuple[int, int], goal: Tuple[int, int]) -> float: + """ + Euclidean distance heuristic. + + h(n) = sqrt((x1 - x2)^2 + (y1 - y2)^2) + + Admissible: Straight-line distance is always <= actual path distance. + Since we can only move in cardinal directions, this will never overestimate the actual cost. + + Args: + state: Current position (x, y) + goal: Goal position (x, y) + + Returns: + Estimated cost to reach goal + """ + if goal is None: + return 0.0 + return math.sqrt((state[0] - goal[0]) ** 2 + (state[1] - goal[1]) ** 2) diff --git a/backend/app/heuristics/manhattan.py b/backend/app/heuristics/manhattan.py new file mode 100644 index 0000000000000000000000000000000000000000..35d428cc86c8108871d0f718ac71ce8608dc7929 --- /dev/null +++ b/backend/app/heuristics/manhattan.py @@ -0,0 +1,22 @@ +"""Manhattan distance heuristic.""" +from typing import Tuple + + +def manhattan_heuristic(state: Tuple[int, int], goal: Tuple[int, int]) -> float: + """ + Manhattan distance heuristic. + + h(n) = |x1 - x2| + |y1 - y2| + + Admissible: Assumes minimum cost of 1 per step, which is the minimum possible traffic level. + + Args: + state: Current position (x, y) + goal: Goal position (x, y) + + Returns: + Estimated cost to reach goal + """ + if goal is None: + return 0.0 + return abs(state[0] - goal[0]) + abs(state[1] - goal[1]) diff --git a/backend/app/heuristics/traffic_weighted.py b/backend/app/heuristics/traffic_weighted.py new file mode 100644 index 0000000000000000000000000000000000000000..75e62b330a53fe672d17a050d3757193229293d4 --- /dev/null +++ b/backend/app/heuristics/traffic_weighted.py @@ -0,0 +1,43 @@ +"""Traffic-weighted Manhattan heuristic.""" +from typing import Tuple + + +def traffic_weighted_heuristic( + state: Tuple[int, int], + goal: Tuple[int, int], + min_traffic: float = 1.0 +) -> float: + """ + Traffic-weighted Manhattan distance heuristic. + + h(n) = manhattan_distance * minimum_traffic_cost + + Admissible: Uses the minimum possible traffic cost to ensure we never overestimate the actual cost. + + Args: + state: Current position (x, y) + goal: Goal position (x, y) + min_traffic: Minimum traffic level in the grid (default 1.0) + + Returns: + Estimated cost to reach goal + """ + if goal is None: + return 0.0 + manhattan = abs(state[0] - goal[0]) + abs(state[1] - goal[1]) + return manhattan * min_traffic + + +def create_traffic_weighted_heuristic(min_traffic: float = 1.0): + """ + Factory function to create a traffic-weighted heuristic with specific min_traffic. + + Args: + min_traffic: Minimum traffic level in the grid + + Returns: + Heuristic function + """ + def heuristic(state: Tuple[int, int], goal: Tuple[int, int]) -> float: + return traffic_weighted_heuristic(state, goal, min_traffic) + return heuristic diff --git a/backend/app/heuristics/tunnel_aware.py b/backend/app/heuristics/tunnel_aware.py new file mode 100644 index 0000000000000000000000000000000000000000..c6309048b9aaf145f5b026978291c3e2979acb47 --- /dev/null +++ b/backend/app/heuristics/tunnel_aware.py @@ -0,0 +1,77 @@ +"""Tunnel-aware Manhattan heuristic.""" +from typing import Tuple, List, Optional +from .manhattan import manhattan_heuristic + + +def tunnel_aware_heuristic( + state: Tuple[int, int], + goal: Tuple[int, int], + tunnels: Optional[List] = None +) -> float: + """ + Tunnel-aware Manhattan distance heuristic. + + h(n) = min(direct_manhattan, tunnel_shortcuts) + + Considers potential tunnel shortcuts that might reduce the distance. + For each tunnel, calculates the cost of going to entrance, through tunnel, + and from exit to goal. + + Admissible: Takes minimum of all options, so never overestimates. + + Args: + state: Current position (x, y) + goal: Goal position (x, y) + tunnels: List of Tunnel objects with entrance1, entrance2, and cost + + Returns: + Estimated cost to reach goal + """ + if goal is None: + return 0.0 + + # Direct Manhattan distance + direct = manhattan_heuristic(state, goal) + + if not tunnels: + return direct + + # Check each tunnel for potential shortcut + best = direct + for tunnel in tunnels: + entrance1 = tunnel.entrance1 + entrance2 = tunnel.entrance2 + tunnel_cost = tunnel.cost + + # Path: state -> entrance1 -> (tunnel) -> entrance2 -> goal + via_tunnel_1 = ( + manhattan_heuristic(state, entrance1) + + tunnel_cost + + manhattan_heuristic(entrance2, goal) + ) + + # Path: state -> entrance2 -> (tunnel) -> entrance1 -> goal + via_tunnel_2 = ( + manhattan_heuristic(state, entrance2) + + tunnel_cost + + manhattan_heuristic(entrance1, goal) + ) + + best = min(best, via_tunnel_1, via_tunnel_2) + + return best + + +def create_tunnel_aware_heuristic(tunnels: List): + """ + Factory function to create a tunnel-aware heuristic with specific tunnels. + + Args: + tunnels: List of Tunnel objects + + Returns: + Heuristic function + """ + def heuristic(state: Tuple[int, int], goal: Tuple[int, int]) -> float: + return tunnel_aware_heuristic(state, goal, tunnels) + return heuristic diff --git a/backend/app/main.py b/backend/app/main.py new file mode 100644 index 0000000000000000000000000000000000000000..a783b93cc8b0506c46941f1cb3df978f61fecb52 --- /dev/null +++ b/backend/app/main.py @@ -0,0 +1,47 @@ +"""FastAPI application entry point.""" +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware +import uvicorn + +from .api.routes import router + +# Create FastAPI app +app = FastAPI( + title="Package Delivery Search API", + description="Search algorithms for package delivery optimization", + version="1.0.0", +) + +# Configure CORS +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + +# Include routes +app.include_router(router) + + +@app.get("/") +async def root(): + """Root endpoint.""" + return { + "name": "Package Delivery Search API", + "version": "1.0.0", + "endpoints": { + "health": "/api/health", + "algorithms": "/api/algorithms", + "generate": "/api/grid/generate", + "path": "/api/search/path", + "plan": "/api/search/plan", + "compare": "/api/search/compare", + "visualize": "ws://localhost:8000/ws/visualize" + } + } + + +if __name__ == "__main__": + uvicorn.run(app, host="0.0.0.0", port=8000) diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6df0a205caf8e712d6f8651b8b07f1469fa3c920 --- /dev/null +++ b/backend/app/models/__init__.py @@ -0,0 +1,63 @@ +"""Models package - exports all model classes.""" +from .grid import Grid, Segment +from .entities import Store, Destination, Tunnel, Truck +from .state import SearchState, PathResult, DeliveryAssignment, PlanResult, SearchStep, SearchMetrics +from .requests import ( + Algorithm, + Position, + SegmentData, + StoreData, + DestinationData, + TunnelData, + GridConfig, + SearchRequest, + PathRequest, + CompareRequest, + PathData, + GridData, + GenerateResponse, + SearchResponse, + PlanResponse, + ComparisonResult, + CompareResponse, + AlgorithmInfo, + AlgorithmsResponse, +) + +__all__ = [ + # Grid models + "Grid", + "Segment", + # Entity models + "Store", + "Destination", + "Tunnel", + "Truck", + # State models + "SearchState", + "PathResult", + "DeliveryAssignment", + "PlanResult", + "SearchStep", + "SearchMetrics", + # Request/Response models + "Algorithm", + "Position", + "SegmentData", + "StoreData", + "DestinationData", + "TunnelData", + "GridConfig", + "SearchRequest", + "PathRequest", + "CompareRequest", + "PathData", + "GridData", + "GenerateResponse", + "SearchResponse", + "PlanResponse", + "ComparisonResult", + "CompareResponse", + "AlgorithmInfo", + "AlgorithmsResponse", +] diff --git a/backend/app/models/entities.py b/backend/app/models/entities.py new file mode 100644 index 0000000000000000000000000000000000000000..017ef2f9749852c15d1a0bb4ef57ffd989caf7fd --- /dev/null +++ b/backend/app/models/entities.py @@ -0,0 +1,75 @@ +"""Entity models for stores, destinations, tunnels, and trucks.""" +from dataclasses import dataclass +from typing import Tuple + + +@dataclass +class Store: + """Represents a storage location / starting point for trucks.""" + id: int + position: Tuple[int, int] + + def to_dict(self) -> dict: + return { + "id": self.id, + "position": {"x": self.position[0], "y": self.position[1]} + } + + +@dataclass +class Destination: + """Represents a customer destination for package delivery.""" + id: int + position: Tuple[int, int] + + def to_dict(self) -> dict: + return { + "id": self.id, + "position": {"x": self.position[0], "y": self.position[1]} + } + + +@dataclass +class Tunnel: + """Represents an underground tunnel connecting two points.""" + entrance1: Tuple[int, int] + entrance2: Tuple[int, int] + + @property + def cost(self) -> int: + """Tunnel cost is Manhattan distance between entrances.""" + return abs(self.entrance1[0] - self.entrance2[0]) + abs(self.entrance1[1] - self.entrance2[1]) + + def get_other_entrance(self, entrance: Tuple[int, int]) -> Tuple[int, int]: + """Get the other entrance of the tunnel.""" + if entrance == self.entrance1: + return self.entrance2 + elif entrance == self.entrance2: + return self.entrance1 + raise ValueError(f"Position {entrance} is not an entrance of this tunnel") + + def has_entrance_at(self, pos: Tuple[int, int]) -> bool: + """Check if tunnel has an entrance at given position.""" + return pos == self.entrance1 or pos == self.entrance2 + + def to_dict(self) -> dict: + return { + "entrance1": {"x": self.entrance1[0], "y": self.entrance1[1]}, + "entrance2": {"x": self.entrance2[0], "y": self.entrance2[1]}, + "cost": self.cost + } + + +@dataclass +class Truck: + """Represents a delivery truck.""" + id: int + store_id: int + current_position: Tuple[int, int] + + def to_dict(self) -> dict: + return { + "id": self.id, + "store_id": self.store_id, + "position": {"x": self.current_position[0], "y": self.current_position[1]} + } diff --git a/backend/app/models/grid.py b/backend/app/models/grid.py new file mode 100644 index 0000000000000000000000000000000000000000..5de0a02812a73e112767403de2a551f636b25d92 --- /dev/null +++ b/backend/app/models/grid.py @@ -0,0 +1,84 @@ +"""Grid and Segment models for the delivery search problem.""" +from dataclasses import dataclass, field +from typing import Dict, Tuple, Optional + + +@dataclass +class Segment: + """Represents a road segment between two adjacent grid points.""" + src: Tuple[int, int] + dst: Tuple[int, int] + traffic: int # 0 = blocked, 1-4 = traffic level + + def __post_init__(self): + # Normalize segment direction (ensure src < dst lexicographically) + if self.src > self.dst: + self.src, self.dst = self.dst, self.src + + @property + def is_blocked(self) -> bool: + return self.traffic == 0 + + def get_key(self) -> Tuple[Tuple[int, int], Tuple[int, int]]: + """Get normalized key for segment lookup.""" + return (self.src, self.dst) + + +@dataclass +class Grid: + """Represents the city grid with all road segments.""" + width: int + height: int + segments: Dict[Tuple[Tuple[int, int], Tuple[int, int]], Segment] = field(default_factory=dict) + + def get_segment(self, src: Tuple[int, int], dst: Tuple[int, int]) -> Optional[Segment]: + """Get segment between two points (order doesn't matter).""" + key = (src, dst) if src < dst else (dst, src) + return self.segments.get(key) + + def get_traffic(self, src: Tuple[int, int], dst: Tuple[int, int]) -> int: + """Get traffic level for segment between two points.""" + segment = self.get_segment(src, dst) + return segment.traffic if segment else 0 + + def is_blocked(self, src: Tuple[int, int], dst: Tuple[int, int]) -> bool: + """Check if segment between two points is blocked.""" + return self.get_traffic(src, dst) == 0 + + def is_valid_position(self, pos: Tuple[int, int]) -> bool: + """Check if position is within grid bounds.""" + x, y = pos + return 0 <= x < self.width and 0 <= y < self.height + + def add_segment(self, src: Tuple[int, int], dst: Tuple[int, int], traffic: int): + """Add or update a segment.""" + segment = Segment(src, dst, traffic) + self.segments[segment.get_key()] = segment + + def get_neighbors(self, pos: Tuple[int, int]) -> list[Tuple[int, int]]: + """Get all valid neighboring positions (not blocked).""" + x, y = pos + neighbors = [] + directions = [(0, 1), (0, -1), (1, 0), (-1, 0)] # up, down, right, left + + for dx, dy in directions: + new_pos = (x + dx, y + dy) + if self.is_valid_position(new_pos) and not self.is_blocked(pos, new_pos): + neighbors.append(new_pos) + + return neighbors + + def to_dict(self) -> dict: + """Convert grid to dictionary for JSON serialization.""" + return { + "width": self.width, + "height": self.height, + "segments": [ + { + "src": {"x": seg.src[0], "y": seg.src[1]}, + "dst": {"x": seg.dst[0], "y": seg.dst[1]}, + "traffic": seg.traffic + } + for seg in self.segments.values() + ] + } diff --git a/backend/app/models/requests.py b/backend/app/models/requests.py new file mode 100644 index 0000000000000000000000000000000000000000..5d7134e5a0bb421ff6529f5b5794eb76292545e3 --- /dev/null +++ b/backend/app/models/requests.py @@ -0,0 +1,169 @@ +"""Pydantic models for API requests and responses.""" +from pydantic import BaseModel, Field +from typing import Optional, List, Tuple +from enum import Enum + + +class Algorithm(str, Enum): + """Available search algorithms.""" + BF = "BF" # Breadth-first search + DF = "DF" # Depth-first search + ID = "ID" # Iterative deepening + UC = "UC" # Uniform cost search + GR1 = "GR1" # Greedy with Manhattan heuristic + GR2 = "GR2" # Greedy with Euclidean heuristic + AS1 = "AS1" # A* with Manhattan heuristic + AS2 = "AS2" # A* with Tunnel-aware heuristic + + +class Position(BaseModel): + """A position on the grid.""" + x: int + y: int + + def to_tuple(self) -> Tuple[int, int]: + return (self.x, self.y) + + +class SegmentData(BaseModel): + """Segment data for API.""" + src: Position + dst: Position + traffic: int = Field(ge=0, le=4) + + +class StoreData(BaseModel): + """Store data for API.""" + id: int + position: Position + + +class DestinationData(BaseModel): + """Destination data for API.""" + id: int + position: Position + + +class TunnelData(BaseModel): + """Tunnel data for API.""" + entrance1: Position + entrance2: Position + cost: Optional[int] = None + + +# Request Models + +class GridConfig(BaseModel): + """Configuration for grid generation.""" + width: Optional[int] = Field(None, ge=5, le=50) + height: Optional[int] = Field(None, ge=5, le=50) + num_stores: Optional[int] = Field(None, ge=1, le=3) + num_destinations: Optional[int] = Field(None, ge=1, le=10) + num_tunnels: Optional[int] = Field(None, ge=0, le=10) + obstacle_density: float = Field(0.1, ge=0.0, le=0.5) + + +class SearchRequest(BaseModel): + """Request for running a search/plan.""" + initial_state: str + traffic: str + strategy: Algorithm + visualize: bool = False + + +class PathRequest(BaseModel): + """Request for finding a single path.""" + grid_width: int + grid_height: int + start: Position + goal: Position + segments: List[SegmentData] + tunnels: List[TunnelData] = [] + strategy: Algorithm + + +class CompareRequest(BaseModel): + """Request for comparing all algorithms.""" + initial_state: str + traffic: str + + +# Response Models + +class PathData(BaseModel): + """Path result data.""" + plan: str + cost: float + nodes_expanded: int + path: List[Position] + + +class GridData(BaseModel): + """Complete grid state data.""" + width: int + height: int + stores: List[StoreData] + destinations: List[DestinationData] + tunnels: List[TunnelData] + segments: List[SegmentData] + + +class GenerateResponse(BaseModel): + """Response from grid generation.""" + initial_state: str + traffic: str + parsed: GridData + + +class SearchResponse(BaseModel): + """Response from search/plan execution.""" + plan: str + cost: float + nodes_expanded: int + runtime_ms: float + memory_mb: float + cpu_percent: float + path: List[Position] + steps: Optional[List[dict]] = None + + +class PlanResponse(BaseModel): + """Response from delivery planning.""" + output: str + assignments: List[dict] + total_cost: float + total_nodes_expanded: int + runtime_ms: float + memory_mb: float + cpu_percent: float + + +class ComparisonResult(BaseModel): + """Result of comparing a single algorithm.""" + algorithm: str + name: str + plan: str + cost: float + nodes_expanded: int + runtime_ms: float + memory_mb: float + cpu_percent: float + is_optimal: bool = False + + +class CompareResponse(BaseModel): + """Response from algorithm comparison.""" + comparisons: List[ComparisonResult] + optimal_cost: float + + +class AlgorithmInfo(BaseModel): + """Information about an algorithm.""" + code: str + name: str + description: str + + +class AlgorithmsResponse(BaseModel): + """List of available algorithms.""" + algorithms: List[AlgorithmInfo] diff --git a/backend/app/models/state.py b/backend/app/models/state.py new file mode 100644 index 0000000000000000000000000000000000000000..0e53a4fb703ea89931ad3fa9e6dfcd66c6735061 --- /dev/null +++ b/backend/app/models/state.py @@ -0,0 +1,133 @@ +"""State models for search and planning results.""" +from dataclasses import dataclass, field +from typing import List, Optional, Tuple +from .grid import Grid +from .entities import Store, Destination, Tunnel + + +@dataclass +class SearchState: + """Represents the complete state for a delivery search problem.""" + grid: Grid + stores: List[Store] + destinations: List[Destination] + tunnels: List[Tunnel] + + def get_tunnel_at(self, pos: Tuple[int, int]) -> Optional[Tunnel]: + """Get tunnel with entrance at given position.""" + for tunnel in self.tunnels: + if tunnel.has_entrance_at(pos): + return tunnel + return None + + def to_dict(self) -> dict: + return { + "grid": self.grid.to_dict(), + "stores": [s.to_dict() for s in self.stores], + "destinations": [d.to_dict() for d in self.destinations], + "tunnels": [t.to_dict() for t in self.tunnels] + } + + +@dataclass +class PathResult: + """Result of finding a path from start to goal.""" + plan: str # Comma-separated actions: "up,down,left,right,tunnel" + cost: float # Total traffic cost + nodes_expanded: int # Number of nodes expanded during search + path: List[Tuple[int, int]] = field(default_factory=list) # Actual positions in path + + def to_string(self) -> str: + """Format as required: plan;cost;nodesExpanded""" + return f"{self.plan};{self.cost};{self.nodes_expanded}" + + def to_dict(self) -> dict: + return { + "plan": self.plan, + "cost": self.cost, + "nodes_expanded": self.nodes_expanded, + "path": [{"x": p[0], "y": p[1]} for p in self.path] + } + + +@dataclass +class DeliveryAssignment: + """Assignment of a destination to a store/truck.""" + store_id: int + destination_id: int + path_result: PathResult + + def to_dict(self) -> dict: + return { + "store_id": self.store_id, + "destination_id": self.destination_id, + "path": self.path_result.to_dict() + } + + +@dataclass +class PlanResult: + """Result of the complete delivery planning.""" + assignments: List[DeliveryAssignment] + total_cost: float + total_nodes_expanded: int + + def to_string(self) -> str: + """Format output as specified.""" + parts = [] + for assignment in self.assignments: + parts.append( + f"({assignment.store_id},{assignment.destination_id}):{assignment.path_result.to_string()}" + ) + return ";".join(parts) + + def to_dict(self) -> dict: + return { + "assignments": [a.to_dict() for a in self.assignments], + "total_cost": self.total_cost, + "total_nodes_expanded": self.total_nodes_expanded + } + + +@dataclass +class SearchStep: + """Represents a single step in the search process for visualization.""" + step_number: int + current_node: Tuple[int, int] + action: Optional[str] + frontier: List[Tuple[int, int]] + explored: List[Tuple[int, int]] + current_path: List[Tuple[int, int]] + path_cost: float + + def to_dict(self) -> dict: + return { + "stepNumber": self.step_number, + "currentNode": {"x": self.current_node[0], "y": self.current_node[1]}, + "action": self.action, + "frontier": [{"x": p[0], "y": p[1]} for p in self.frontier], + "explored": [{"x": p[0], "y": p[1]} for p in self.explored], + "currentPath": [{"x": p[0], "y": p[1]} for p in self.current_path], + "pathCost": self.path_cost + } + + +@dataclass +class SearchMetrics: + """Performance metrics for a search execution.""" + runtime_ms: float + memory_mb: float + cpu_percent: float + nodes_expanded: int + path_cost: float + path_length: int + + def to_dict(self) -> dict: + return { + "runtime_ms": self.runtime_ms, + "memory_mb": self.memory_mb, + "cpu_percent": self.cpu_percent, + "nodes_expanded": self.nodes_expanded, + "path_cost": self.path_cost, + "path_length": self.path_length + } diff --git a/backend/app/services/__init__.py b/backend/app/services/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9802be9d6d1a0571b3316ac0743c8a019e166bd0 --- /dev/null +++ b/backend/app/services/__init__.py @@ -0,0 +1,28 @@ +"""Services package.""" +from .parser import ( + parse_initial_state, + parse_traffic, + parse_full_state, + format_initial_state, + format_traffic, +) +from .grid_generator import gen_grid +from .metrics import ( + MetricsCollector, + measure_performance, + run_with_metrics, + format_metrics, +) + +__all__ = [ + "parse_initial_state", + "parse_traffic", + "parse_full_state", + "format_initial_state", + "format_traffic", + "gen_grid", + "MetricsCollector", + "measure_performance", + "run_with_metrics", + "format_metrics", +] diff --git a/backend/app/services/grid_generator.py b/backend/app/services/grid_generator.py new file mode 100644 index 0000000000000000000000000000000000000000..834c36e035e9372426de611215140bcda03ca461 --- /dev/null +++ b/backend/app/services/grid_generator.py @@ -0,0 +1,281 @@ +"""Grid generator service for random grid creation.""" +import random +from typing import Tuple, List, Set, Optional +from ..models.grid import Grid +from ..models.entities import Store, Destination, Tunnel +from ..models.state import SearchState +from .parser import format_initial_state, format_traffic + + +def gen_grid( + width: Optional[int] = None, + height: Optional[int] = None, + num_stores: Optional[int] = None, + num_destinations: Optional[int] = None, + num_tunnels: Optional[int] = None, + obstacle_density: float = 0.1, + seed: Optional[int] = None +) -> Tuple[str, str, SearchState]: + """ + Randomly generate a valid grid configuration. + + Args: + width: Grid width (random 5-15 if None) + height: Grid height (random 5-15 if None) + num_stores: Number of stores (random 1-3 if None) + num_destinations: Number of destinations (random 1-10 if None) + num_tunnels: Number of tunnels (random 0-5 if None) + obstacle_density: Fraction of segments to block (0.0-0.5) + seed: Random seed for reproducibility + + Returns: + Tuple of (initial_state_string, traffic_string, SearchState) + """ + if seed is not None: + random.seed(seed) + + # Set defaults + width = width or random.randint(5, 15) + height = height or random.randint(5, 15) + num_stores = num_stores or random.randint(1, 3) + num_destinations = num_destinations or random.randint(1, min(10, width * height // 4)) + num_tunnels = num_tunnels or random.randint(0, min(5, width * height // 10)) + + # Validate constraints + num_stores = min(num_stores, 3) + num_destinations = min(num_destinations, 10) + + # Track occupied positions + occupied: Set[Tuple[int, int]] = set() + + # Generate stores + stores = _generate_stores(width, height, num_stores, occupied) + + # Generate destinations + destinations = _generate_destinations(width, height, num_destinations, occupied) + + # Generate tunnels + tunnels = _generate_tunnels(width, height, num_tunnels, occupied) + + # Generate grid with traffic + grid = _generate_traffic(width, height, obstacle_density, stores, destinations) + + # Create search state + state = SearchState(grid=grid, stores=stores, destinations=destinations, tunnels=tunnels) + + # Format strings + initial_state = format_initial_state(width, height, stores, destinations, tunnels) + traffic = format_traffic(grid) + + return initial_state, traffic, state + + +def _generate_stores( + width: int, + height: int, + num_stores: int, + occupied: Set[Tuple[int, int]] +) -> List[Store]: + """Generate store positions at corners/edges.""" + stores = [] + + # Prefer corners + corners = [ + (0, 0), + (width - 1, 0), + (0, height - 1), + (width - 1, height - 1), + ] + random.shuffle(corners) + + for i, pos in enumerate(corners[:num_stores]): + stores.append(Store(id=i + 1, position=pos)) + occupied.add(pos) + + # If need more, use edges + if len(stores) < num_stores: + edges = [] + for x in range(1, width - 1): + edges.append((x, 0)) + edges.append((x, height - 1)) + for y in range(1, height - 1): + edges.append((0, y)) + edges.append((width - 1, y)) + + random.shuffle(edges) + for pos in edges: + if pos not in occupied and len(stores) < num_stores: + stores.append(Store(id=len(stores) + 1, position=pos)) + occupied.add(pos) + + return stores + + +def _generate_destinations( + width: int, + height: int, + num_destinations: int, + occupied: Set[Tuple[int, int]] +) -> List[Destination]: + """Generate random destination positions.""" + destinations = [] + + # Try to spread destinations across the grid + available = [] + for x in range(width): + for y in range(height): + if (x, y) not in occupied: + available.append((x, y)) + + random.shuffle(available) + + for i, pos in enumerate(available[:num_destinations]): + destinations.append(Destination(id=i + 1, position=pos)) + occupied.add(pos) + + return destinations + + +def _generate_tunnels( + width: int, + height: int, + num_tunnels: int, + occupied: Set[Tuple[int, int]] +) -> List[Tunnel]: + """Generate random tunnel pairs.""" + tunnels = [] + + # Find available positions for tunnel entrances + available = [] + for x in range(width): + for y in range(height): + if (x, y) not in occupied: + available.append((x, y)) + + random.shuffle(available) + + # Need at least 2 positions per tunnel + for i in range(min(num_tunnels, len(available) // 2)): + entrance1 = available[i * 2] + entrance2 = available[i * 2 + 1] + + # Ensure tunnels are useful (span reasonable distance) + dist = abs(entrance1[0] - entrance2[0]) + abs(entrance1[1] - entrance2[1]) + if dist >= 3: # Only create if Manhattan distance >= 3 + tunnels.append(Tunnel(entrance1=entrance1, entrance2=entrance2)) + occupied.add(entrance1) + occupied.add(entrance2) + + return tunnels + + +def _generate_traffic( + width: int, + height: int, + obstacle_density: float, + stores: List[Store], + destinations: List[Destination] +) -> Grid: + """ + Generate traffic levels for all segments. + + Ensures connectivity between stores and destinations. + """ + grid = Grid(width=width, height=height) + + # First, add all segments with random traffic + all_segments = [] + + # Horizontal segments + for x in range(width - 1): + for y in range(height): + all_segments.append(((x, y), (x + 1, y))) + + # Vertical segments + for x in range(width): + for y in range(height - 1): + all_segments.append(((x, y), (x, y + 1))) + + # Add segments with traffic + for src, dst in all_segments: + # Random traffic level 1-4 or blocked (0) + if random.random() < obstacle_density: + traffic = 0 # Blocked + else: + traffic = random.randint(1, 4) + grid.add_segment(src, dst, traffic) + + # Ensure connectivity - make sure there's a path from each store to each destination + _ensure_connectivity(grid, stores, destinations) + + return grid + + +def _ensure_connectivity( + grid: Grid, + stores: List[Store], + destinations: List[Destination] +) -> None: + """ + Ensure the grid is connected between stores and destinations. + + Uses BFS to check connectivity and unblocks segments if needed. + """ + # Get all important positions + important_positions = [s.position for s in stores] + [d.position for d in destinations] + + if len(important_positions) < 2: + return + + # Check connectivity from first store to all destinations + start = stores[0].position if stores else important_positions[0] + + # BFS to find reachable positions + visited = {start} + queue = [start] + + while queue: + current = queue.pop(0) + for neighbor in grid.get_neighbors(current): + if neighbor not in visited: + visited.add(neighbor) + queue.append(neighbor) + + # Check if all important positions are reachable + unreachable = [pos for pos in important_positions if pos not in visited] + + # If some positions are unreachable, create paths to them + for pos in unreachable: + _create_path_to(grid, start, pos, visited) + + +def _create_path_to( + grid: Grid, + start: Tuple[int, int], + goal: Tuple[int, int], + visited: Set[Tuple[int, int]] +) -> None: + """Create a path from visited area to goal by unblocking segments.""" + # Simple approach: find closest visited cell to goal and unblock path + closest = min(visited, key=lambda p: abs(p[0] - goal[0]) + abs(p[1] - goal[1])) + + # Create path from closest to goal + current = closest + while current != goal: + dx = 0 if goal[0] == current[0] else (1 if goal[0] > current[0] else -1) + dy = 0 if goal[1] == current[1] else (1 if goal[1] > current[1] else -1) + + # Prefer moving in direction with larger difference + if abs(goal[0] - current[0]) >= abs(goal[1] - current[1]) and dx != 0: + next_pos = (current[0] + dx, current[1]) + elif dy != 0: + next_pos = (current[0], current[1] + dy) + else: + next_pos = (current[0] + dx, current[1]) + + # Unblock segment if blocked + if grid.is_blocked(current, next_pos): + grid.add_segment(current, next_pos, random.randint(1, 4)) + + visited.add(next_pos) + current = next_pos diff --git a/backend/app/services/metrics.py b/backend/app/services/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..1344d8a5c1e9dee17952ba214cb9aa3731cf0c5b --- /dev/null +++ b/backend/app/services/metrics.py @@ -0,0 +1,126 @@ +"""Performance metrics collection service.""" +import time +import psutil +from contextlib import contextmanager +from dataclasses import dataclass +from typing import Generator, Callable, Any, Tuple +from ..models.state import SearchMetrics + + +@dataclass +class MetricsCollector: + """Collects performance metrics during search execution.""" + + def __init__(self): + self.start_time: float = 0 + self.end_time: float = 0 + self.start_memory: int = 0 + self.end_memory: int = 0 + self.peak_memory: int = 0 + self.cpu_samples: list = [] + self._process = psutil.Process() + + def start(self) -> None: + """Start collecting metrics.""" + self.start_time = time.perf_counter() + self.start_memory = self._process.memory_info().rss + self.peak_memory = self.start_memory + self.cpu_samples = [] + # Initial CPU sample + self._process.cpu_percent() + + def sample(self) -> None: + """Take a sample of current metrics.""" + current_memory = self._process.memory_info().rss + self.peak_memory = max(self.peak_memory, current_memory) + self.cpu_samples.append(self._process.cpu_percent()) + + def stop(self) -> None: + """Stop collecting metrics.""" + self.end_time = time.perf_counter() + self.end_memory = self._process.memory_info().rss + # Final CPU sample + self.cpu_samples.append(self._process.cpu_percent()) + + @property + def runtime_ms(self) -> float: + """Get runtime in milliseconds.""" + return (self.end_time - self.start_time) * 1000 + + @property + def memory_mb(self) -> float: + """Get peak memory usage in MB.""" + return (self.peak_memory - self.start_memory) / (1024 * 1024) + + @property + def cpu_percent(self) -> float: + """Get average CPU percentage.""" + if not self.cpu_samples: + return 0.0 + return sum(self.cpu_samples) / len(self.cpu_samples) + + def to_metrics(self, nodes_expanded: int, path_cost: float, path_length: int) -> SearchMetrics: + """Convert to SearchMetrics object.""" + return SearchMetrics( + runtime_ms=self.runtime_ms, + memory_mb=max(0, self.memory_mb), # Ensure non-negative + cpu_percent=self.cpu_percent, + nodes_expanded=nodes_expanded, + path_cost=path_cost, + path_length=path_length + ) + + +@contextmanager +def measure_performance() -> Generator[MetricsCollector, None, None]: + """ + Context manager for measuring search performance. + + Usage: + with measure_performance() as metrics: + result = search.solve(strategy) + print(f"Runtime: {metrics.runtime_ms}ms") + """ + collector = MetricsCollector() + collector.start() + try: + yield collector + finally: + collector.stop() + + +def run_with_metrics( + func: Callable[..., Any], + *args, + **kwargs +) -> Tuple[Any, MetricsCollector]: + """ + Run a function and collect performance metrics. + + Args: + func: Function to run + *args: Positional arguments for func + **kwargs: Keyword arguments for func + + Returns: + Tuple of (function result, MetricsCollector) + """ + collector = MetricsCollector() + collector.start() + try: + result = func(*args, **kwargs) + finally: + collector.stop() + return result, collector + + +def format_metrics(metrics: SearchMetrics) -> str: + """Format metrics for display.""" + return ( + f"Runtime: {metrics.runtime_ms:.2f}ms | " + f"Memory: {metrics.memory_mb:.2f}MB | " + f"CPU: {metrics.cpu_percent:.1f}% | " + f"Nodes: {metrics.nodes_expanded} | " + f"Cost: {metrics.path_cost} | " + f"Path Length: {metrics.path_length}" + ) diff --git a/backend/app/services/parser.py b/backend/app/services/parser.py new file mode 100644 index 0000000000000000000000000000000000000000..a6f6cb88e6c322e0572ea376b0c1a37247141e94 --- /dev/null +++ b/backend/app/services/parser.py @@ -0,0 +1,249 @@ +"""Parser service for initial state and traffic strings.""" +from typing import Tuple, List +from ..models.grid import Grid +from ..models.entities import Store, Destination, Tunnel +from ..models.state import SearchState + + +def parse_initial_state(initial_state: str) -> Tuple[int, int, List[Store], List[Destination], List[Tunnel]]: + """ + Parse the initial state string. + + Format: + m;n;P;S;CustomerX_1,CustomerY_1,CustomerX_2,CustomerY_2,...; + TunnelX_1,TunnelY_1,TunnelX_1',TunnelY_1',TunnelX_2,TunnelY_2,TunnelX_2',TunnelY_2',... + + Args: + initial_state: The initial state string + + Returns: + Tuple of (width, height, stores, destinations, tunnels) + """ + parts = initial_state.strip().split(';') + + # Grid dimensions + width = int(parts[0]) # m + height = int(parts[1]) # n + + # Number of packages/customers and stores + num_packages = int(parts[2]) # P + num_stores = int(parts[3]) # S + + # Parse customer locations + destinations: List[Destination] = [] + if len(parts) > 4 and parts[4]: + customer_coords = parts[4].split(',') + for i in range(0, len(customer_coords), 2): + if i + 1 < len(customer_coords): + x = int(customer_coords[i]) + y = int(customer_coords[i + 1]) + dest_id = len(destinations) + 1 + destinations.append(Destination(id=dest_id, position=(x, y))) + + # Parse tunnel locations + tunnels: List[Tunnel] = [] + if len(parts) > 5 and parts[5]: + tunnel_coords = parts[5].split(',') + for i in range(0, len(tunnel_coords), 4): + if i + 3 < len(tunnel_coords): + x1 = int(tunnel_coords[i]) + y1 = int(tunnel_coords[i + 1]) + x2 = int(tunnel_coords[i + 2]) + y2 = int(tunnel_coords[i + 3]) + tunnels.append(Tunnel(entrance1=(x1, y1), entrance2=(x2, y2))) + + # Generate stores (positions need to be provided or generated) + # For now, place stores at corners/edges + stores: List[Store] = [] + store_positions = _generate_store_positions(width, height, num_stores, destinations, tunnels) + for i, pos in enumerate(store_positions): + stores.append(Store(id=i + 1, position=pos)) + + return width, height, stores, destinations, tunnels + + +def _generate_store_positions( + width: int, + height: int, + num_stores: int, + destinations: List[Destination], + tunnels: List[Tunnel] +) -> List[Tuple[int, int]]: + """ + Generate store positions avoiding conflicts. + + Places stores at corners and edges of the grid. + """ + occupied = set() + for dest in destinations: + occupied.add(dest.position) + for tunnel in tunnels: + occupied.add(tunnel.entrance1) + occupied.add(tunnel.entrance2) + + # Preferred positions (corners first, then edges) + preferred = [ + (0, 0), + (width - 1, 0), + (0, height - 1), + (width - 1, height - 1), + (width // 2, 0), + (0, height // 2), + (width - 1, height // 2), + (width // 2, height - 1), + ] + + positions = [] + for pos in preferred: + if pos not in occupied and len(positions) < num_stores: + positions.append(pos) + occupied.add(pos) + + # If still need more positions, find any valid position + if len(positions) < num_stores: + for x in range(width): + for y in range(height): + if (x, y) not in occupied and len(positions) < num_stores: + positions.append((x, y)) + occupied.add((x, y)) + + return positions + + +def parse_traffic(traffic_str: str, width: int, height: int) -> Grid: + """ + Parse the traffic string and create a Grid. + + Format: + SrcX_1,SrcY_1,DstX_1,DstY_1,Traffic_1;SrcX_2,SrcY_2,DstX_2,DstY_2,Traffic_2;... + + Args: + traffic_str: Traffic string + width: Grid width + height: Grid height + + Returns: + Grid with traffic information + """ + grid = Grid(width=width, height=height) + + if not traffic_str: + # Initialize all segments with default traffic level 1 + _initialize_default_traffic(grid) + return grid + + segments = traffic_str.strip().split(';') + for segment in segments: + if not segment: + continue + parts = segment.split(',') + if len(parts) >= 5: + src_x = int(parts[0]) + src_y = int(parts[1]) + dst_x = int(parts[2]) + dst_y = int(parts[3]) + traffic = int(parts[4]) + grid.add_segment((src_x, src_y), (dst_x, dst_y), traffic) + + return grid + + +def _initialize_default_traffic(grid: Grid, default_traffic: int = 1) -> None: + """ + Initialize all grid segments with default traffic. + + Creates horizontal and vertical segments between adjacent cells. + """ + for x in range(grid.width): + for y in range(grid.height): + # Horizontal segment (right) + if x + 1 < grid.width: + grid.add_segment((x, y), (x + 1, y), default_traffic) + # Vertical segment (up) + if y + 1 < grid.height: + grid.add_segment((x, y), (x, y + 1), default_traffic) + + +def parse_full_state(initial_state: str, traffic_str: str) -> SearchState: + """ + Parse both initial state and traffic into a complete SearchState. + + Args: + initial_state: Initial state string + traffic_str: Traffic string + + Returns: + Complete SearchState object + """ + width, height, stores, destinations, tunnels = parse_initial_state(initial_state) + grid = parse_traffic(traffic_str, width, height) + + return SearchState( + grid=grid, + stores=stores, + destinations=destinations, + tunnels=tunnels + ) + + +def format_initial_state( + width: int, + height: int, + stores: List[Store], + destinations: List[Destination], + tunnels: List[Tunnel] +) -> str: + """ + Format state back into initial state string. + + Args: + width: Grid width + height: Grid height + stores: List of stores + destinations: List of destinations + tunnels: List of tunnels + + Returns: + Formatted initial state string + """ + parts = [ + str(width), + str(height), + str(len(destinations)), + str(len(stores)), + ] + + # Customer coordinates + customer_coords = [] + for dest in destinations: + customer_coords.extend([str(dest.position[0]), str(dest.position[1])]) + parts.append(','.join(customer_coords)) + + # Tunnel coordinates + tunnel_coords = [] + for tunnel in tunnels: + tunnel_coords.extend([ + str(tunnel.entrance1[0]), str(tunnel.entrance1[1]), + str(tunnel.entrance2[0]), str(tunnel.entrance2[1]) + ]) + parts.append(','.join(tunnel_coords)) + + return ';'.join(parts) + + +def format_traffic(grid: Grid) -> str: + """ + Format grid traffic into traffic string. + + Args: + grid: Grid with traffic information + + Returns: + Formatted traffic string + """ + segments = [] + for (src, dst), segment in grid.segments.items(): + segments.append( + f"{src[0]},{src[1]},{dst[0]},{dst[1]},{segment.traffic}" + ) + return ';'.join(segments) diff --git a/backend/pyproject.toml b/backend/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..d94e1d45f407a569165b9c731ec2c73904cdc38e --- /dev/null +++ b/backend/pyproject.toml @@ -0,0 +1,18 @@ +[project] +name = "backend" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "fastapi>=0.122.0", + "httpx>=0.28.1", + "psutil>=7.1.3", + "pydantic>=2.12.5", + "pydantic-settings>=2.12.0", + "pytest>=9.0.1", + "pytest-asyncio>=1.3.0", + "python-dotenv>=1.2.1", + "uvicorn>=0.38.0", + "websockets>=15.0.1", +] diff --git a/backend/uv.lock b/backend/uv.lock new file mode 100644 index 0000000000000000000000000000000000000000..47529c4d34abedcb6e6b9eee96ac15d15a37b6ae --- /dev/null +++ b/backend/uv.lock @@ -0,0 +1,584 @@ +version = 1 +revision = 2 +requires-python = ">=3.10" + +[[package]] +name = "annotated-doc" +version = "0.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, +] + +[[package]] +name = "backend" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "fastapi" }, + { name = "httpx" }, + { name = "psutil" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "python-dotenv" }, + { name = "uvicorn" }, + { name = "websockets" }, +] + +[package.metadata] +requires-dist = [ + { name = "fastapi", specifier = ">=0.122.0" }, + { name = "httpx", specifier = ">=0.28.1" }, + { name = "psutil", specifier = ">=7.1.3" }, + { name = "pydantic", specifier = ">=2.12.5" }, + { name = "pydantic-settings", specifier = ">=2.12.0" }, + { name = "pytest", specifier = ">=9.0.1" }, + { name = "pytest-asyncio", specifier = ">=1.3.0" }, + { name = "python-dotenv", specifier = ">=1.2.1" }, + { name = "uvicorn", specifier = ">=0.38.0" }, + { name = "websockets", specifier = ">=15.0.1" }, +] + +[[package]] +name = "backports-asyncio-runner" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8e/ff/70dca7d7cb1cbc0edb2c6cc0c38b65cba36cccc491eca64cabd5fe7f8670/backports_asyncio_runner-1.2.0.tar.gz", hash = "sha256:a5aa7b2b7d8f8bfcaa2b57313f70792df84e32a2a746f585213373f900b42162", size = 69893, upload-time = "2025-07-02T02:27:15.685Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/59/76ab57e3fe74484f48a53f8e337171b4a2349e506eabe136d7e01d059086/backports_asyncio_runner-1.2.0-py3-none-any.whl", hash = "sha256:0da0a936a8aeb554eccb426dc55af3ba63bcdc69fa1a600b5bb305413a4477b5", size = 12313, upload-time = "2025-07-02T02:27:14.263Z" }, +] + +[[package]] +name = "certifi" +version = "2025.11.12" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, +] + +[[package]] +name = "click" +version = "8.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "fastapi" +version = "0.122.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "pydantic" }, + { name = "starlette" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/de/3ee97a4f6ffef1fb70bf20561e4f88531633bb5045dc6cebc0f8471f764d/fastapi-0.122.0.tar.gz", hash = "sha256:cd9b5352031f93773228af8b4c443eedc2ac2aa74b27780387b853c3726fb94b", size = 346436, upload-time = "2025-11-24T19:17:47.95Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7a/93/aa8072af4ff37b795f6bbf43dcaf61115f40f49935c7dbb180c9afc3f421/fastapi-0.122.0-py3-none-any.whl", hash = "sha256:a456e8915dfc6c8914a50d9651133bd47ec96d331c5b44600baa635538a30d67", size = 110671, upload-time = "2025-11-24T19:17:45.96Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "packaging" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "psutil" +version = "7.1.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/88/bdd0a41e5857d5d703287598cbf08dad90aed56774ea52ae071bae9071b6/psutil-7.1.3.tar.gz", hash = "sha256:6c86281738d77335af7aec228328e944b30930899ea760ecf33a4dba66be5e74", size = 489059, upload-time = "2025-11-02T12:25:54.619Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/93/0c49e776b8734fef56ec9c5c57f923922f2cf0497d62e0f419465f28f3d0/psutil-7.1.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0005da714eee687b4b8decd3d6cc7c6db36215c9e74e5ad2264b90c3df7d92dc", size = 239751, upload-time = "2025-11-02T12:25:58.161Z" }, + { url = "https://files.pythonhosted.org/packages/6f/8d/b31e39c769e70780f007969815195a55c81a63efebdd4dbe9e7a113adb2f/psutil-7.1.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:19644c85dcb987e35eeeaefdc3915d059dac7bd1167cdcdbf27e0ce2df0c08c0", size = 240368, upload-time = "2025-11-02T12:26:00.491Z" }, + { url = "https://files.pythonhosted.org/packages/62/61/23fd4acc3c9eebbf6b6c78bcd89e5d020cfde4acf0a9233e9d4e3fa698b4/psutil-7.1.3-cp313-cp313t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:95ef04cf2e5ba0ab9eaafc4a11eaae91b44f4ef5541acd2ee91d9108d00d59a7", size = 287134, upload-time = "2025-11-02T12:26:02.613Z" }, + { url = "https://files.pythonhosted.org/packages/30/1c/f921a009ea9ceb51aa355cb0cc118f68d354db36eae18174bab63affb3e6/psutil-7.1.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1068c303be3a72f8e18e412c5b2a8f6d31750fb152f9cb106b54090296c9d251", size = 289904, upload-time = "2025-11-02T12:26:05.207Z" }, + { url = "https://files.pythonhosted.org/packages/a6/82/62d68066e13e46a5116df187d319d1724b3f437ddd0f958756fc052677f4/psutil-7.1.3-cp313-cp313t-win_amd64.whl", hash = "sha256:18349c5c24b06ac5612c0428ec2a0331c26443d259e2a0144a9b24b4395b58fa", size = 249642, upload-time = "2025-11-02T12:26:07.447Z" }, + { url = "https://files.pythonhosted.org/packages/df/ad/c1cd5fe965c14a0392112f68362cfceb5230819dbb5b1888950d18a11d9f/psutil-7.1.3-cp313-cp313t-win_arm64.whl", hash = "sha256:c525ffa774fe4496282fb0b1187725793de3e7c6b29e41562733cae9ada151ee", size = 245518, upload-time = "2025-11-02T12:26:09.719Z" }, + { url = "https://files.pythonhosted.org/packages/2e/bb/6670bded3e3236eb4287c7bcdc167e9fae6e1e9286e437f7111caed2f909/psutil-7.1.3-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b403da1df4d6d43973dc004d19cee3b848e998ae3154cc8097d139b77156c353", size = 239843, upload-time = "2025-11-02T12:26:11.968Z" }, + { url = "https://files.pythonhosted.org/packages/b8/66/853d50e75a38c9a7370ddbeefabdd3d3116b9c31ef94dc92c6729bc36bec/psutil-7.1.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ad81425efc5e75da3f39b3e636293360ad8d0b49bed7df824c79764fb4ba9b8b", size = 240369, upload-time = "2025-11-02T12:26:14.358Z" }, + { url = "https://files.pythonhosted.org/packages/41/bd/313aba97cb5bfb26916dc29cf0646cbe4dd6a89ca69e8c6edce654876d39/psutil-7.1.3-cp314-cp314t-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f33a3702e167783a9213db10ad29650ebf383946e91bc77f28a5eb083496bc9", size = 288210, upload-time = "2025-11-02T12:26:16.699Z" }, + { url = "https://files.pythonhosted.org/packages/c2/fa/76e3c06e760927a0cfb5705eb38164254de34e9bd86db656d4dbaa228b04/psutil-7.1.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fac9cd332c67f4422504297889da5ab7e05fd11e3c4392140f7370f4208ded1f", size = 291182, upload-time = "2025-11-02T12:26:18.848Z" }, + { url = "https://files.pythonhosted.org/packages/0f/1d/5774a91607035ee5078b8fd747686ebec28a962f178712de100d00b78a32/psutil-7.1.3-cp314-cp314t-win_amd64.whl", hash = "sha256:3792983e23b69843aea49c8f5b8f115572c5ab64c153bada5270086a2123c7e7", size = 250466, upload-time = "2025-11-02T12:26:21.183Z" }, + { url = "https://files.pythonhosted.org/packages/00/ca/e426584bacb43a5cb1ac91fae1937f478cd8fbe5e4ff96574e698a2c77cd/psutil-7.1.3-cp314-cp314t-win_arm64.whl", hash = "sha256:31d77fcedb7529f27bb3a0472bea9334349f9a04160e8e6e5020f22c59893264", size = 245756, upload-time = "2025-11-02T12:26:23.148Z" }, + { url = "https://files.pythonhosted.org/packages/ef/94/46b9154a800253e7ecff5aaacdf8ebf43db99de4a2dfa18575b02548654e/psutil-7.1.3-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:2bdbcd0e58ca14996a42adf3621a6244f1bb2e2e528886959c72cf1e326677ab", size = 238359, upload-time = "2025-11-02T12:26:25.284Z" }, + { url = "https://files.pythonhosted.org/packages/68/3a/9f93cff5c025029a36d9a92fef47220ab4692ee7f2be0fba9f92813d0cb8/psutil-7.1.3-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:bc31fa00f1fbc3c3802141eede66f3a2d51d89716a194bf2cd6fc68310a19880", size = 239171, upload-time = "2025-11-02T12:26:27.23Z" }, + { url = "https://files.pythonhosted.org/packages/ce/b1/5f49af514f76431ba4eea935b8ad3725cdeb397e9245ab919dbc1d1dc20f/psutil-7.1.3-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3bb428f9f05c1225a558f53e30ccbad9930b11c3fc206836242de1091d3e7dd3", size = 263261, upload-time = "2025-11-02T12:26:29.48Z" }, + { url = "https://files.pythonhosted.org/packages/e0/95/992c8816a74016eb095e73585d747e0a8ea21a061ed3689474fabb29a395/psutil-7.1.3-cp36-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:56d974e02ca2c8eb4812c3f76c30e28836fffc311d55d979f1465c1feeb2b68b", size = 264635, upload-time = "2025-11-02T12:26:31.74Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/c3ed1a622b6ae2fd3c945a366e64eb35247a31e4db16cf5095e269e8eb3c/psutil-7.1.3-cp37-abi3-win_amd64.whl", hash = "sha256:f39c2c19fe824b47484b96f9692932248a54c43799a84282cfe58d05a6449efd", size = 247633, upload-time = "2025-11-02T12:26:33.887Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ad/33b2ccec09bf96c2b2ef3f9a6f66baac8253d7565d8839e024a6b905d45d/psutil-7.1.3-cp37-abi3-win_arm64.whl", hash = "sha256:bd0d69cee829226a761e92f28140bec9a5ee9d5b4fb4b0cc589068dbfff559b1", size = 244608, upload-time = "2025-11-02T12:26:36.136Z" }, +] + +[[package]] +name = "pydantic" +version = "2.12.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.41.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c6/90/32c9941e728d564b411d574d8ee0cf09b12ec978cb22b294995bae5549a5/pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146", size = 2107298, upload-time = "2025-11-04T13:39:04.116Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a8/61c96a77fe28993d9a6fb0f4127e05430a267b235a124545d79fea46dd65/pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2", size = 1901475, upload-time = "2025-11-04T13:39:06.055Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b6/338abf60225acc18cdc08b4faef592d0310923d19a87fba1faf05af5346e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97", size = 1918815, upload-time = "2025-11-04T13:39:10.41Z" }, + { url = "https://files.pythonhosted.org/packages/d1/1c/2ed0433e682983d8e8cba9c8d8ef274d4791ec6a6f24c58935b90e780e0a/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9", size = 2065567, upload-time = "2025-11-04T13:39:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/b3/24/cf84974ee7d6eae06b9e63289b7b8f6549d416b5c199ca2d7ce13bbcf619/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52", size = 2230442, upload-time = "2025-11-04T13:39:13.962Z" }, + { url = "https://files.pythonhosted.org/packages/fd/21/4e287865504b3edc0136c89c9c09431be326168b1eb7841911cbc877a995/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941", size = 2350956, upload-time = "2025-11-04T13:39:15.889Z" }, + { url = "https://files.pythonhosted.org/packages/a8/76/7727ef2ffa4b62fcab916686a68a0426b9b790139720e1934e8ba797e238/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a", size = 2068253, upload-time = "2025-11-04T13:39:17.403Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8c/a4abfc79604bcb4c748e18975c44f94f756f08fb04218d5cb87eb0d3a63e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c", size = 2177050, upload-time = "2025-11-04T13:39:19.351Z" }, + { url = "https://files.pythonhosted.org/packages/67/b1/de2e9a9a79b480f9cb0b6e8b6ba4c50b18d4e89852426364c66aa82bb7b3/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2", size = 2147178, upload-time = "2025-11-04T13:39:21Z" }, + { url = "https://files.pythonhosted.org/packages/16/c1/dfb33f837a47b20417500efaa0378adc6635b3c79e8369ff7a03c494b4ac/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556", size = 2341833, upload-time = "2025-11-04T13:39:22.606Z" }, + { url = "https://files.pythonhosted.org/packages/47/36/00f398642a0f4b815a9a558c4f1dca1b4020a7d49562807d7bc9ff279a6c/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49", size = 2321156, upload-time = "2025-11-04T13:39:25.843Z" }, + { url = "https://files.pythonhosted.org/packages/7e/70/cad3acd89fde2010807354d978725ae111ddf6d0ea46d1ea1775b5c1bd0c/pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba", size = 1989378, upload-time = "2025-11-04T13:39:27.92Z" }, + { url = "https://files.pythonhosted.org/packages/76/92/d338652464c6c367e5608e4488201702cd1cbb0f33f7b6a85a60fe5f3720/pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9", size = 2013622, upload-time = "2025-11-04T13:39:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" }, + { url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" }, + { url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" }, + { url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" }, + { url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" }, + { url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" }, + { url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" }, + { url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" }, + { url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" }, + { url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" }, + { url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" }, + { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, + { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, + { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, + { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, + { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, + { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, + { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, + { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, + { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, + { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, + { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, + { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, + { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, + { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, + { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, + { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, + { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, + { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, + { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, + { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, + { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, + { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, + { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, + { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, + { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, + { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, + { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, + { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, + { url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" }, + { url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" }, + { url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" }, + { url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" }, + { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, + { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, + { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, + { url = "https://files.pythonhosted.org/packages/e6/b0/1a2aa41e3b5a4ba11420aba2d091b2d17959c8d1519ece3627c371951e73/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8", size = 2103351, upload-time = "2025-11-04T13:43:02.058Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ee/31b1f0020baaf6d091c87900ae05c6aeae101fa4e188e1613c80e4f1ea31/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a", size = 1925363, upload-time = "2025-11-04T13:43:05.159Z" }, + { url = "https://files.pythonhosted.org/packages/e1/89/ab8e86208467e467a80deaca4e434adac37b10a9d134cd2f99b28a01e483/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b", size = 2135615, upload-time = "2025-11-04T13:43:08.116Z" }, + { url = "https://files.pythonhosted.org/packages/99/0a/99a53d06dd0348b2008f2f30884b34719c323f16c3be4e6cc1203b74a91d/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2", size = 2175369, upload-time = "2025-11-04T13:43:12.49Z" }, + { url = "https://files.pythonhosted.org/packages/6d/94/30ca3b73c6d485b9bb0bc66e611cff4a7138ff9736b7e66bcf0852151636/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093", size = 2144218, upload-time = "2025-11-04T13:43:15.431Z" }, + { url = "https://files.pythonhosted.org/packages/87/57/31b4f8e12680b739a91f472b5671294236b82586889ef764b5fbc6669238/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a", size = 2329951, upload-time = "2025-11-04T13:43:18.062Z" }, + { url = "https://files.pythonhosted.org/packages/7d/73/3c2c8edef77b8f7310e6fb012dbc4b8551386ed575b9eb6fb2506e28a7eb/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963", size = 2318428, upload-time = "2025-11-04T13:43:20.679Z" }, + { url = "https://files.pythonhosted.org/packages/2f/02/8559b1f26ee0d502c74f9cca5c0d2fd97e967e083e006bbbb4e97f3a043a/pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a", size = 2147009, upload-time = "2025-11-04T13:43:23.286Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" }, + { url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" }, + { url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" }, + { url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.12.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/4b/ac7e0aae12027748076d72a8764ff1c9d82ca75a7a52622e67ed3f765c54/pydantic_settings-2.12.0.tar.gz", hash = "sha256:005538ef951e3c2a68e1c08b292b5f2e71490def8589d4221b95dab00dafcfd0", size = 194184, upload-time = "2025-11-10T14:25:47.013Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/60/5d4751ba3f4a40a6891f24eec885f51afd78d208498268c734e256fb13c4/pydantic_settings-2.12.0-py3-none-any.whl", hash = "sha256:fddb9fd99a5b18da837b29710391e945b1e30c135477f484084ee513adb93809", size = 51880, upload-time = "2025-11-10T14:25:45.546Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, + { name = "pytest" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" }, +] + +[[package]] +name = "starlette" +version = "0.50.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz", hash = "sha256:a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca", size = 2646985, upload-time = "2025-11-01T15:25:27.516Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d9/52/1064f510b141bd54025f9b55105e26d1fa970b9be67ad766380a3c9b74b0/starlette-0.50.0-py3-none-any.whl", hash = "sha256:9e5391843ec9b6e472eed1365a78c8098cfceb7a74bfd4d6b1c0c0095efb3bca", size = 74033, upload-time = "2025-11-01T15:25:25.461Z" }, +] + +[[package]] +name = "tomli" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, + { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, + { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, + { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, + { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, + { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, + { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, + { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, + { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, + { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, + { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, + { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, + { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, + { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, + { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, + { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, + { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, + { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, + { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, + { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, + { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, + { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, + { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, + { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, + { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, +] + +[[package]] +name = "uvicorn" +version = "0.38.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/ce/f06b84e2697fef4688ca63bdb2fdf113ca0a3be33f94488f2cadb690b0cf/uvicorn-0.38.0.tar.gz", hash = "sha256:fd97093bdd120a2609fc0d3afe931d4d4ad688b6e75f0f929fde1bc36fe0e91d", size = 80605, upload-time = "2025-10-18T13:46:44.63Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ee/d9/d88e73ca598f4f6ff671fb5fde8a32925c2e08a637303a1d12883c7305fa/uvicorn-0.38.0-py3-none-any.whl", hash = "sha256:48c0afd214ceb59340075b4a052ea1ee91c16fbc2a9b1469cca0e54566977b02", size = 68109, upload-time = "2025-10-18T13:46:42.958Z" }, +] + +[[package]] +name = "websockets" +version = "15.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/da/6462a9f510c0c49837bbc9345aca92d767a56c1fb2939e1579df1e1cdcf7/websockets-15.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d63efaa0cd96cf0c5fe4d581521d9fa87744540d4bc999ae6e08595a1014b45b", size = 175423, upload-time = "2025-03-05T20:01:35.363Z" }, + { url = "https://files.pythonhosted.org/packages/1c/9f/9d11c1a4eb046a9e106483b9ff69bce7ac880443f00e5ce64261b47b07e7/websockets-15.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac60e3b188ec7574cb761b08d50fcedf9d77f1530352db4eef1707fe9dee7205", size = 173080, upload-time = "2025-03-05T20:01:37.304Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4f/b462242432d93ea45f297b6179c7333dd0402b855a912a04e7fc61c0d71f/websockets-15.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5756779642579d902eed757b21b0164cd6fe338506a8083eb58af5c372e39d9a", size = 173329, upload-time = "2025-03-05T20:01:39.668Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0c/6afa1f4644d7ed50284ac59cc70ef8abd44ccf7d45850d989ea7310538d0/websockets-15.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdfe3e2a29e4db3659dbd5bbf04560cea53dd9610273917799f1cde46aa725e", size = 182312, upload-time = "2025-03-05T20:01:41.815Z" }, + { url = "https://files.pythonhosted.org/packages/dd/d4/ffc8bd1350b229ca7a4db2a3e1c482cf87cea1baccd0ef3e72bc720caeec/websockets-15.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c2529b320eb9e35af0fa3016c187dffb84a3ecc572bcee7c3ce302bfeba52bf", size = 181319, upload-time = "2025-03-05T20:01:43.967Z" }, + { url = "https://files.pythonhosted.org/packages/97/3a/5323a6bb94917af13bbb34009fac01e55c51dfde354f63692bf2533ffbc2/websockets-15.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac1e5c9054fe23226fb11e05a6e630837f074174c4c2f0fe442996112a6de4fb", size = 181631, upload-time = "2025-03-05T20:01:46.104Z" }, + { url = "https://files.pythonhosted.org/packages/a6/cc/1aeb0f7cee59ef065724041bb7ed667b6ab1eeffe5141696cccec2687b66/websockets-15.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5df592cd503496351d6dc14f7cdad49f268d8e618f80dce0cd5a36b93c3fc08d", size = 182016, upload-time = "2025-03-05T20:01:47.603Z" }, + { url = "https://files.pythonhosted.org/packages/79/f9/c86f8f7af208e4161a7f7e02774e9d0a81c632ae76db2ff22549e1718a51/websockets-15.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0a34631031a8f05657e8e90903e656959234f3a04552259458aac0b0f9ae6fd9", size = 181426, upload-time = "2025-03-05T20:01:48.949Z" }, + { url = "https://files.pythonhosted.org/packages/c7/b9/828b0bc6753db905b91df6ae477c0b14a141090df64fb17f8a9d7e3516cf/websockets-15.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3d00075aa65772e7ce9e990cab3ff1de702aa09be3940d1dc88d5abf1ab8a09c", size = 181360, upload-time = "2025-03-05T20:01:50.938Z" }, + { url = "https://files.pythonhosted.org/packages/89/fb/250f5533ec468ba6327055b7d98b9df056fb1ce623b8b6aaafb30b55d02e/websockets-15.0.1-cp310-cp310-win32.whl", hash = "sha256:1234d4ef35db82f5446dca8e35a7da7964d02c127b095e172e54397fb6a6c256", size = 176388, upload-time = "2025-03-05T20:01:52.213Z" }, + { url = "https://files.pythonhosted.org/packages/1c/46/aca7082012768bb98e5608f01658ff3ac8437e563eca41cf068bd5849a5e/websockets-15.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:39c1fec2c11dc8d89bba6b2bf1556af381611a173ac2b511cf7231622058af41", size = 176830, upload-time = "2025-03-05T20:01:53.922Z" }, + { url = "https://files.pythonhosted.org/packages/9f/32/18fcd5919c293a398db67443acd33fde142f283853076049824fc58e6f75/websockets-15.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:823c248b690b2fd9303ba00c4f66cd5e2d8c3ba4aa968b2779be9532a4dad431", size = 175423, upload-time = "2025-03-05T20:01:56.276Z" }, + { url = "https://files.pythonhosted.org/packages/76/70/ba1ad96b07869275ef42e2ce21f07a5b0148936688c2baf7e4a1f60d5058/websockets-15.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678999709e68425ae2593acf2e3ebcbcf2e69885a5ee78f9eb80e6e371f1bf57", size = 173082, upload-time = "2025-03-05T20:01:57.563Z" }, + { url = "https://files.pythonhosted.org/packages/86/f2/10b55821dd40eb696ce4704a87d57774696f9451108cff0d2824c97e0f97/websockets-15.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d50fd1ee42388dcfb2b3676132c78116490976f1300da28eb629272d5d93e905", size = 173330, upload-time = "2025-03-05T20:01:59.063Z" }, + { url = "https://files.pythonhosted.org/packages/a5/90/1c37ae8b8a113d3daf1065222b6af61cc44102da95388ac0018fcb7d93d9/websockets-15.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d99e5546bf73dbad5bf3547174cd6cb8ba7273062a23808ffea025ecb1cf8562", size = 182878, upload-time = "2025-03-05T20:02:00.305Z" }, + { url = "https://files.pythonhosted.org/packages/8e/8d/96e8e288b2a41dffafb78e8904ea7367ee4f891dafc2ab8d87e2124cb3d3/websockets-15.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66dd88c918e3287efc22409d426c8f729688d89a0c587c88971a0faa2c2f3792", size = 181883, upload-time = "2025-03-05T20:02:03.148Z" }, + { url = "https://files.pythonhosted.org/packages/93/1f/5d6dbf551766308f6f50f8baf8e9860be6182911e8106da7a7f73785f4c4/websockets-15.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dd8327c795b3e3f219760fa603dcae1dcc148172290a8ab15158cf85a953413", size = 182252, upload-time = "2025-03-05T20:02:05.29Z" }, + { url = "https://files.pythonhosted.org/packages/d4/78/2d4fed9123e6620cbf1706c0de8a1632e1a28e7774d94346d7de1bba2ca3/websockets-15.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fdc51055e6ff4adeb88d58a11042ec9a5eae317a0a53d12c062c8a8865909e8", size = 182521, upload-time = "2025-03-05T20:02:07.458Z" }, + { url = "https://files.pythonhosted.org/packages/e7/3b/66d4c1b444dd1a9823c4a81f50231b921bab54eee2f69e70319b4e21f1ca/websockets-15.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:693f0192126df6c2327cce3baa7c06f2a117575e32ab2308f7f8216c29d9e2e3", size = 181958, upload-time = "2025-03-05T20:02:09.842Z" }, + { url = "https://files.pythonhosted.org/packages/08/ff/e9eed2ee5fed6f76fdd6032ca5cd38c57ca9661430bb3d5fb2872dc8703c/websockets-15.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:54479983bd5fb469c38f2f5c7e3a24f9a4e70594cd68cd1fa6b9340dadaff7cf", size = 181918, upload-time = "2025-03-05T20:02:11.968Z" }, + { url = "https://files.pythonhosted.org/packages/d8/75/994634a49b7e12532be6a42103597b71098fd25900f7437d6055ed39930a/websockets-15.0.1-cp311-cp311-win32.whl", hash = "sha256:16b6c1b3e57799b9d38427dda63edcbe4926352c47cf88588c0be4ace18dac85", size = 176388, upload-time = "2025-03-05T20:02:13.32Z" }, + { url = "https://files.pythonhosted.org/packages/98/93/e36c73f78400a65f5e236cd376713c34182e6663f6889cd45a4a04d8f203/websockets-15.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:27ccee0071a0e75d22cb35849b1db43f2ecd3e161041ac1ee9d2352ddf72f065", size = 176828, upload-time = "2025-03-05T20:02:14.585Z" }, + { url = "https://files.pythonhosted.org/packages/51/6b/4545a0d843594f5d0771e86463606a3988b5a09ca5123136f8a76580dd63/websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3", size = 175437, upload-time = "2025-03-05T20:02:16.706Z" }, + { url = "https://files.pythonhosted.org/packages/f4/71/809a0f5f6a06522af902e0f2ea2757f71ead94610010cf570ab5c98e99ed/websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665", size = 173096, upload-time = "2025-03-05T20:02:18.832Z" }, + { url = "https://files.pythonhosted.org/packages/3d/69/1a681dd6f02180916f116894181eab8b2e25b31e484c5d0eae637ec01f7c/websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2", size = 173332, upload-time = "2025-03-05T20:02:20.187Z" }, + { url = "https://files.pythonhosted.org/packages/a6/02/0073b3952f5bce97eafbb35757f8d0d54812b6174ed8dd952aa08429bcc3/websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215", size = 183152, upload-time = "2025-03-05T20:02:22.286Z" }, + { url = "https://files.pythonhosted.org/packages/74/45/c205c8480eafd114b428284840da0b1be9ffd0e4f87338dc95dc6ff961a1/websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5", size = 182096, upload-time = "2025-03-05T20:02:24.368Z" }, + { url = "https://files.pythonhosted.org/packages/14/8f/aa61f528fba38578ec553c145857a181384c72b98156f858ca5c8e82d9d3/websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65", size = 182523, upload-time = "2025-03-05T20:02:25.669Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6d/0267396610add5bc0d0d3e77f546d4cd287200804fe02323797de77dbce9/websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe", size = 182790, upload-time = "2025-03-05T20:02:26.99Z" }, + { url = "https://files.pythonhosted.org/packages/02/05/c68c5adbf679cf610ae2f74a9b871ae84564462955d991178f95a1ddb7dd/websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4", size = 182165, upload-time = "2025-03-05T20:02:30.291Z" }, + { url = "https://files.pythonhosted.org/packages/29/93/bb672df7b2f5faac89761cb5fa34f5cec45a4026c383a4b5761c6cea5c16/websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597", size = 182160, upload-time = "2025-03-05T20:02:31.634Z" }, + { url = "https://files.pythonhosted.org/packages/ff/83/de1f7709376dc3ca9b7eeb4b9a07b4526b14876b6d372a4dc62312bebee0/websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9", size = 176395, upload-time = "2025-03-05T20:02:33.017Z" }, + { url = "https://files.pythonhosted.org/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7", size = 176841, upload-time = "2025-03-05T20:02:34.498Z" }, + { url = "https://files.pythonhosted.org/packages/cb/9f/51f0cf64471a9d2b4d0fc6c534f323b664e7095640c34562f5182e5a7195/websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931", size = 175440, upload-time = "2025-03-05T20:02:36.695Z" }, + { url = "https://files.pythonhosted.org/packages/8a/05/aa116ec9943c718905997412c5989f7ed671bc0188ee2ba89520e8765d7b/websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675", size = 173098, upload-time = "2025-03-05T20:02:37.985Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0b/33cef55ff24f2d92924923c99926dcce78e7bd922d649467f0eda8368923/websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151", size = 173329, upload-time = "2025-03-05T20:02:39.298Z" }, + { url = "https://files.pythonhosted.org/packages/31/1d/063b25dcc01faa8fada1469bdf769de3768b7044eac9d41f734fd7b6ad6d/websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22", size = 183111, upload-time = "2025-03-05T20:02:40.595Z" }, + { url = "https://files.pythonhosted.org/packages/93/53/9a87ee494a51bf63e4ec9241c1ccc4f7c2f45fff85d5bde2ff74fcb68b9e/websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f", size = 182054, upload-time = "2025-03-05T20:02:41.926Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b2/83a6ddf56cdcbad4e3d841fcc55d6ba7d19aeb89c50f24dd7e859ec0805f/websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8", size = 182496, upload-time = "2025-03-05T20:02:43.304Z" }, + { url = "https://files.pythonhosted.org/packages/98/41/e7038944ed0abf34c45aa4635ba28136f06052e08fc2168520bb8b25149f/websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375", size = 182829, upload-time = "2025-03-05T20:02:48.812Z" }, + { url = "https://files.pythonhosted.org/packages/e0/17/de15b6158680c7623c6ef0db361da965ab25d813ae54fcfeae2e5b9ef910/websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d", size = 182217, upload-time = "2025-03-05T20:02:50.14Z" }, + { url = "https://files.pythonhosted.org/packages/33/2b/1f168cb6041853eef0362fb9554c3824367c5560cbdaad89ac40f8c2edfc/websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4", size = 182195, upload-time = "2025-03-05T20:02:51.561Z" }, + { url = "https://files.pythonhosted.org/packages/86/eb/20b6cdf273913d0ad05a6a14aed4b9a85591c18a987a3d47f20fa13dcc47/websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa", size = 176393, upload-time = "2025-03-05T20:02:53.814Z" }, + { url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" }, + { url = "https://files.pythonhosted.org/packages/02/9e/d40f779fa16f74d3468357197af8d6ad07e7c5a27ea1ca74ceb38986f77a/websockets-15.0.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0c9e74d766f2818bb95f84c25be4dea09841ac0f734d1966f415e4edfc4ef1c3", size = 173109, upload-time = "2025-03-05T20:03:17.769Z" }, + { url = "https://files.pythonhosted.org/packages/bc/cd/5b887b8585a593073fd92f7c23ecd3985cd2c3175025a91b0d69b0551372/websockets-15.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1009ee0c7739c08a0cd59de430d6de452a55e42d6b522de7aa15e6f67db0b8e1", size = 173343, upload-time = "2025-03-05T20:03:19.094Z" }, + { url = "https://files.pythonhosted.org/packages/fe/ae/d34f7556890341e900a95acf4886833646306269f899d58ad62f588bf410/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76d1f20b1c7a2fa82367e04982e708723ba0e7b8d43aa643d3dcd404d74f1475", size = 174599, upload-time = "2025-03-05T20:03:21.1Z" }, + { url = "https://files.pythonhosted.org/packages/71/e6/5fd43993a87db364ec60fc1d608273a1a465c0caba69176dd160e197ce42/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f29d80eb9a9263b8d109135351caf568cc3f80b9928bccde535c235de55c22d9", size = 174207, upload-time = "2025-03-05T20:03:23.221Z" }, + { url = "https://files.pythonhosted.org/packages/2b/fb/c492d6daa5ec067c2988ac80c61359ace5c4c674c532985ac5a123436cec/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b359ed09954d7c18bbc1680f380c7301f92c60bf924171629c5db97febb12f04", size = 174155, upload-time = "2025-03-05T20:03:25.321Z" }, + { url = "https://files.pythonhosted.org/packages/68/a1/dcb68430b1d00b698ae7a7e0194433bce4f07ded185f0ee5fb21e2a2e91e/websockets-15.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:cad21560da69f4ce7658ca2cb83138fb4cf695a2ba3e475e0559e05991aa8122", size = 176884, upload-time = "2025-03-05T20:03:27.934Z" }, + { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" }, +] diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..49ad59ef56376857361f2d98f99032a5d9332142 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,34 @@ +# Dependencies +node_modules/ + +# Build output +dist/ +build/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# Testing +coverage/ +.nyc_output/ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* + +# Environment +.env +.env.* +!.env.example + +# Cache +.cache/ +.parcel-cache/ +.turbo/ diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..19ccda1c5894cb6b8ae417a78eb62e089bd8e808 --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,3 @@ +# API URL for development +# Leave empty for production (uses relative URLs) +VITE_API_URL=http://localhost:8000 diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a547bf36d8d11a4f89c59c144f24795749086dd1 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d2e77611fd3d959fee0487c41bd27b318be32b04 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,73 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/frontend/components.json b/frontend/components.json new file mode 100644 index 0000000000000000000000000000000000000000..2b0833f0977df39fe315f4da463ce4cf2754815f --- /dev/null +++ b/frontend/components.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/index.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "registries": {} +} diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 0000000000000000000000000000000000000000..5e6b472f583e34a1cca751440d4f241495475723 --- /dev/null +++ b/frontend/eslint.config.js @@ -0,0 +1,23 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000000000000000000000000000000000000..072a57e8e46c28ad65b5b51b3405b16c37d91667 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + +
+ + + +Search Algorithm Analysis
+Legend
+Edge Costs
+Uninformed
+Informed
++ ({steps[currentStep].currentNode.x}, {steps[currentStep].currentNode.y}) +
++ {steps[currentStep].pathCost} +
++ {steps[currentStep].frontier.length} +
++ {steps[currentStep].explored.length} +
+No Grid Generated
+Configure and generate a grid from the sidebar
++ Artificial Intelligence Project +
+{author.name}
+{author.role}
++ This project presents an interactive visualization tool for comparing search algorithms in the context + of package delivery optimization. We implement and analyze six fundamental search strategies: Breadth-First + Search (BFS), Depth-First Search (DFS), Iterative Deepening Search (IDS), Uniform Cost Search (UCS), + Greedy Best-First Search, and A* Search. The system models a grid-based city environment with varying + traffic conditions, blocked roads, and tunnel shortcuts, providing a comprehensive testbed for evaluating + algorithm performance in terms of path optimality, computational efficiency, and memory utilization. +
+
+ Backend
+Python 3.11 + FastAPI
+Frontend
+React 19 + TypeScript + Vite
+State Management
+Zustand
+Visualization
+SVG + Recharts
+Styling
+Tailwind CSS v4
+Communication
+REST API + WebSocket
+| Algorithm | +Type | +Optimal | +Complete | +
|---|---|---|---|
| + {algo.name} + ({algo.code}) + | +{algo.type} | +{algo.optimal} | +{algo.complete} | +
* When step costs are uniform
+Manhattan Distance
+h(n) = |xn - xg| + |yn - yg|
+Euclidean Distance
+h(n) = sqrt((xn - xg)2 + (yn - yg)2)
+Tunnel-Aware Heuristic
+Considers available tunnel shortcuts to improve estimate accuracy
++ Russell, S., & Norvig, P. (2020). Artificial Intelligence: A Modern Approach (4th ed.). Pearson. +
++ Hart, P. E., Nilsson, N. J., & Raphael, B. (1968). A Formal Basis for the Heuristic Determination of Minimum Cost Paths. IEEE Transactions on Systems Science and Cybernetics, 4(2), 100-107. +
++ Korf, R. E. (1985). Depth-first iterative-deepening: An optimal admissible tree search. Artificial Intelligence, 27(1), 97-109. +
+Generate a grid first
+Then compare all algorithms
+Compare Search Algorithms
+ +{data.fullName}
++ {payload[0].name}: {typeof payload[0].value === 'number' ? payload[0].value.toLocaleString(undefined, { maximumFractionDigits: 2 }) : payload[0].value} +
+8 algorithms on the same problem instance
+| Rank | +Algorithm | +Cost | +Nodes | +Runtime | +Memory | +Optimal | +
|---|---|---|---|---|---|---|
| + {getRankIcon(index)} + | ++ {result.name} + ({result.algorithm}) + | ++ {result.cost === Infinity ? 'No path' : result.cost} + | ++ {result.nodesExpanded.toLocaleString()} + | ++ {result.runtimeMs.toFixed(2)}ms + | ++ {result.memoryMb.toFixed(3)}MB + | +
+ {result.isOptimal && (
+ |
+
+ {metric.value} +
+Algorithm: {selectedAlgorithm}
++ {planResult.totalCost} +
++ {planResult.totalNodesExpanded.toLocaleString()} +
++ {planResult.runtimeMs.toFixed(2)}ms +
++ {planResult.memoryMb.toFixed(2)}MB +
+No assignments made
+ ) : ( + planResult.assignments.map((assignment, index) => ( +