CEP Statement
Title:
Smart Hospital Resource Management System Using Advanced Data Structures
Problem Context (Complex Engineering Problem):
Modern hospitals face continuous pressure to efficiently manage limited critical
resources such as beds, ventilators, and medical staff while handling
unpredictable patient arrivals. Emergency cases require immediate attention
and higher priority, whereas routine patients must still be scheduled fairly and
efficiently. Manual or static allocation methods often lead to resource
underutilization, delays, and compromised patient care. Therefore, a dynamic,
real-time, and optimized resource management system is required.
Problem Description:
The proposed system dynamically allocates hospital resources by prioritizing
emergency and critical patients over routine cases. Patients arrive randomly,
creating uncertainty and conflicting demands. The system must ensure optimal
utilization of resources, minimize patient waiting time, and provide accurate
reporting for hospital management decisions.
CEP Characteristics Mapping WP1 – Depth of Knowledge Required The
problem requires in-depth knowledge of:
Healthcare workflow and hospital resource management
Advanced data structures and algorithms
Real-time scheduling and priority-based decision making
This aligns with complex system implementation in a healthcare environment.
WP2 – Range of Conflicting Requirements
The system must professionally resolve conflicts such as:
Emergency vs. routine patient prioritization
Limited resources vs. increasing patient inflow
Fast response time vs. optimal resource utilization
Priority Queues and scheduling algorithms are used to balance these conflicting
requirements efficiently.
WP3 – Depth of Analysis Required
The solution requires analytical decision-making by:
Using Heaps (Priority Queues) for emergency handling
Queues for patient flow management
Graphs to model hospital workflows and dependencies
Hash Tables for fast patient and resource lookup
Performance, time complexity, and memory usage are evaluated to ensure
scalability and efficiency.
Data Structures & Algorithms Used
Heaps / Priority Queues: Emergency and critical patient handling
Queues: Patient arrival and processing
Graphs: Hospital workflow modeling
Hash Tables: Resource and patient data storage
Scheduling Algorithms: Optimal allocation and task handling
Expected Outcomes
Real-time dynamic resource allocation
Reduced patient waiting time
Improved utilization of hospital resources
Automated reporting for hospital management
Requirement Data Structure
Patient Priority priority_queue (Heap)
Waiting Patients queue
Patient Records unordered_map (Hash Table)
Workflow Logical flow (Graph concept)
🔹 C++ Program
#include <iostream>
#include <queue>
#include <string>
using namespace std;
// Patient
structure struct
Patient { int id;
string name;
int priority; // 1 = Emergency, 2 = Normal
};
// Comparator for priority queue (Emergency first) struct
ComparePriority {
bool operator()(Patient const& p1, Patient const& p2) {
return [Link] > [Link];
}
};
priority_queue<Patient, vector<Patient>, ComparePriority> emergencyQueue;
queue<Patient> normalQueue;
int totalBeds = 5; int
usedBeds = 0;
// Add patient void
addPatient() {
Patient p;
cout << "\nEnter Patient ID: ";
cin >> [Link];
cout << "Enter Patient Name: ";
cin >> [Link];
cout << "Enter Priority (1 = Emergency, 2 = Normal): ";
cin >> [Link];
if ([Link] == 1)
[Link](p);
else
[Link](p);
cout << "Patient added successfully!\n";
}
// Allocate bed void allocateBed() {
if (usedBeds >= totalBeds) { cout
<< "\nNo beds available!\n";
return;
}
if (![Link]()) {
Patient p = [Link]();
[Link]();
usedBeds++;
cout << "\nEmergency Patient Allocated Bed: " << [Link] << endl;
}
else if (![Link]()) {
Patient p = [Link]();
[Link](); usedBeds++;
cout << "\nNormal Patient Allocated Bed: " << [Link] << endl;
}
else {
cout << "\nNo patients waiting.\n";
}
}
// Report void
showReport() {
cout << "\n------ Hospital Report ------\n";
cout << "Total Beds: " << totalBeds << endl;
cout << "Used Beds: " << usedBeds << endl;
cout << "Available Beds: " << totalBeds - usedBeds << endl;
cout << "Emergency Patients Waiting: " << [Link]() << endl;
cout << "Normal Patients Waiting: " << [Link]() << endl;
}
int main() {
int choice; do
{
cout << "\n===== Smart Hospital Resource Management =====\n";
cout << "1. Add Patient\n"; cout << "2. Allocate Bed\n"; cout
<< "3. Show Report\n"; cout << "4. Exit\n"; cout << "Enter
choice: "; cin >> choice;
switch (choice) { case 1:
addPatient(); break; case 2:
allocateBed(); break; case 3:
showReport(); break;
case 4: cout << "\nExiting program...\n"; break;
default: cout << "\nInvalid choice!\n";
}
} while (choice != 4);
return 0;
}
Output :
Program Start
===== Smart Hospital Resource Management =====
1. Add Patient
2. Allocate Bed
3. Show Report
4. Exit
Enter choice: 1
Add Emergency Patient
Enter Patient ID: 101
Enter Patient Name: Ali
Enter Priority (1 = Emergency, 2 = Normal): 1 Patient
added successfully!
Add Normal Patient
Enter choice: 1
Enter Patient ID: 102
Enter Patient Name: Ahmed
Enter Priority (1 = Emergency, 2 = Normal): 2 Patient
added successfully!
Allocate Bed
Enter choice: 2
Emergency Patient Allocated Bed: Ali
Show Report
Enter choice: 3
------ Hospital Report ------
Total Beds: 5 Used
Beds: 1
Available Beds: 4
Emergency Patients Waiting: 0
Normal Patients Waiting: 1
Exit
Enter choice: 4
Exiting program...