Skip to content

FAST-Dev-Team-Semester-Projects/ai-firefighter-rescue-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Firefighter Rescue System

License: MIT Python FastAPI React TypeScript Status

A visual comparison of A*, BFS, and DFS pathfinding algorithms on a dynamic rescue grid. Developed as academic coursework for Artificial Intelligence - Lab (AL2002) at FAST NUCES Karachi.

Demo

Animated comparison of A* (red), BFS (blue), and DFS (green) pathfinding algorithms on a grid with obstacles and hazards

Editor — grid painting

Editor view with a painted grid and A* trace

Comparison — A* vs BFS vs DFS

Three side-by-side algorithm traces on the same grid

Timeline — trace inspector

Timeline scrubber with the per-step exploration log

Grid Cell Types

Cell Value Cost Passable?
Open 0 1 Yes
Smoke 1 5 Yes (costly)
Fire 2 No
Wall 3 No
Start 4 1 Yes
Goal 5 1 Yes

Algorithms

  • A*: Informed search with Manhattan heuristic. Finds optimal cost-weighted paths.
  • BFS: Uninformed search. Guarantees optimal hop-count paths (not cost-weighted).
  • DFS: Uninformed search. Explores one branch fully before backtracking.

Tech Stack

  • Backend: FastAPI on Python 3.10+
  • Frontend: React + TypeScript + HTML5 Canvas
  • Package managers: uv (backend), Bun (frontend)

Prerequisites

  • Python 3.10+
  • uv
  • Bun

Run The App

Open two terminals from the repository root.

Backend

uv --project backend sync
uv --project backend run uvicorn backend.main:app --reload --port 8000

Backend URL: http://127.0.0.1:8000

Frontend

cd frontend
bun install
bun run start

Frontend URL: http://localhost:3000

Build And Verify

Frontend checks

cd frontend
bun run build
bun x tsc --noEmit

Backend checks

uv --project backend run python -m compileall backend

Quick backend smoke test

uv --project backend run uvicorn backend.main:app --port 8000

API

  • POST /api/search
  • Request body: grid, start, goal, algorithm
  • Response body: algorithm, path, explored, path_cost, cells_explored, execution_time_ms

Contributors

License

This project is licensed under the MIT License — see the LICENSE file for details.

About

Interactive visualizer comparing A*, BFS, and DFS pathfinding algorithms on weighted hazard grids. Built with FastAPI, React, TypeScript, and HTML5 Canvas.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors