Skip to content

About

Real-time emergency blood matching system using Graph Theory and Greedy Allocation to prioritize critical patients and ensure zero-error medical compatibility.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blood Type Compatibility Matching System

Netlify Live App - Click here to view!

An intelligent medical triage system that replaces slow manual matching with an automated graph-based engine. Features real-time urgency-based prioritization and strict algorithmic enforcement of ABO/Rh compatibility rules to eliminate human error and optimize scarce blood inventory.

Core Algorithm

The project utilizes a Priority-Based Greedy Allocation strategy rooted in graph theory:

  • Priority Queue O(N log N): Patients are sorted in descending order based on medical urgency (1-10) to ensure critical cases receive immediate allocation.
  • Adjacency Matrix O(1): An 8x8 boolean matrix represents the directed edges of safe blood transfusions (e.g., O- is a universal donor). This allows for constant-time O(1) compatibility lookups.
  • Greedy Selection O(N * M): The algorithm iterates through the sorted patient queue and greedily assigns the highest-priority compatible blood bag from the available donor inventory.

System Architecture

  • Core Logic Verification: C++ (blood-match.cpp)
  • Frontend Dashboard: React, Vite, Tailwind CSS v4, Framer Motion
  • Backend API: Python, FastAPI, Uvicorn

Running the Application Locally

1. Start the Frontend UI:

cd frontend
npm install
npm run dev

2. Start the Backend API (Optional):

cd backend
pip install -r requirements.txt
uvicorn main:app --reload

(Note: The frontend contains a highly resilient JavaScript fallback engine. If the Python backend is offline or skipped during deployment, the React UI will natively execute the O(N log N) greedy graph logic directly in the browser without failure.)

About

Real-time emergency blood matching system using Graph Theory and Greedy Allocation to prioritize critical patients and ensure zero-error medical compatibility.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages