Skip to content

MithunDu404/Optimal_Path_Coverage_System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimal Path Coverage System (Campus Maintenance Scheduler)

A C++ application designed to simulate and optimize daily maintenance and cleaning routes across a campus. Utilizing a graph-based location model and a Modified Dijkstra's Algorithm, this system dynamically calculates building priorities based on real-world metrics like importance, visit frequency, and dropping cleanliness levels to generate the most efficient daily cleaning schedule.

✨ Key Features

  • Dynamic Priority Engine: Calculates robust location priority every day using a normalized mathematical weight of the building's Importance, current Cleanliness, Visit Priority, and elapsed time since it was last cleaned.
  • Modified Dijkstra's Algorithm: Finds the optimal path between locations by considering not just physical distance, but path difficulty and the priority/need of passing through certain locations.
  • Threshold-Based Cleaning: Intelligently skips cleaning locations that are already above a configurable cleanliness threshold limit to save time and cleaning costs.
  • Persistent Data Tracking: Automatically saves the simulation state (cleanliness, visits, elapsed days) to a local backup file after every route generation to prevent data loss.
  • Realistic Campus Model: Each location supports customized cleaningCost (based on building size/complexity) and cleaningFrequency (e.g. daily for science labs, weekly for dorms).

📂 Project Structure

The repository provides two structural versions of the system:

  1. refactored_project/: A highly organized, production-ready version that splits the underlying logic into cleanly decoupled, modular components (src/, include/, algorithms/, models/, utils/, etc.).
  2. Improved.cpp: A raw, monolithic standalone version of the system. Excellent for quick testing and single-file compilation.

🚀 Getting Started

Prerequisites

  • A standard C++17 compiler (e.g., g++, clang++)
  • make or mingw32-make (Optional, for building the refactored project)

Compiling and Running

1. Refactored Project (Recommended) Navigate into the refactored folder and use your system's build tool:

cd refactored_project
mingw32-make
./refactored_app

(Alternatively, compile manually with g++ -std=c++17 -Iinclude src/main.cpp src/algorithms/ModifiedDijkstra.cpp src/core/CampusMap.cpp src/models/Location.cpp src/services/MaintenanceScheduler.cpp src/utils/StorageManager.cpp -o refactored_app.exe)

2. Standalone Version

g++ -std=c++17 Improved.cpp -o ImprovedApp
./ImprovedApp

⚙️ How to Use

Once the application executes, you will be greeted with an interactive console menu:

  1. Find optimal path: Input a start and end location ID to see the best routing path and total pathing cost based on distance and calculated priority.
  2. View campus status: See the real-time layout of the campus, including the strictly % cleanliness of every building, how many days since it was last cleaned, and its current dynamic priority score.
  3. Run simulation: Simulate X amount of days. Over time, the algorithm degrades the cleanliness of unvisited buildings and automatically routes your cleaning staff to the highest priority locations for each simulated day, accumulating a daily cost for the work done.
  4. Reset to default configuration: Resets your simulation's wear-and-tear back to the pristine campus_data.txt baseline.
  5. Exit: Securely exits the program.

📊 Data Configuration (campus_data.txt)

All location parameters are fully dynamic! You can customize the campus logic by editing the CSV lines in data/campus_data.txt.

Format Scheme: ID, Name, Importance(1-10), CleaningFreq(Days), VisitPriority(1-10), CleanlinessStatus(%), LastCleaned(Days), TotalVisits, CleaningCost

Example: 0,Library,9,3,8,100.0,0,0,50.0 (The Library is Highly Important (9), should ideally be cleaned every 3 days, starts at 100% cleanliness, and has a heavy cleaning cost of 50.0 due to its massive size)

Paths (# Paths)

Below the locations, the data file defines the connections (edges) between them.

Format Scheme: From_ID, To_ID, Distance, TravelTime, DifficultyMultiplier

Example: 0,1,3.0,5.0,1.0 (Connecting the Library(0) to Main Building(1), with a short distance of 3.0, a standard travel time of 5.0, and a baseline flat terrain difficulty of 1.0)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages