How kartevsumit/hostel-allocation-optimizer works
This C++ hostel-allocation engine loads student groups, preferences, room inventory and roommate data, preprocesses constraints, then runs greedy placement, simulated annealing and MCMF before saving and reporting an allocation. A separate FCFS executable provides the documented comparison baseline. The graph reflects the explicitly shown orchestration and documented algorithm roles; internal calls in unsampled portions of some optimizer sources are not inferred.
Main entry points: main.cpp Optimizer entry · fcfs.cpp FCFS baseline · db_loader.cpp Database loader · greedy.cpp Greedy placement
Components 16
Run orchestration
- Optimizer entry
src/main.cpp - FCFS baseline
src/fcfs.cpp
Allocation optimization
- Greedy placement
src/optimizer/greedy.cpp - Simulated annealing
src/optimizer/annealer.cpp - MCMF optimizer
src/optimizer/mcmf.cpp
Allocation domain
- Input preprocessing
src/core/preprocessor.cpp - Cost model
src/core/cost.cpp - Allocation state
include/core/state.h - Allocation models
include/core/models.h - Allocation types
include/core/types.h - Logger
include/utils/logger.h
Persistence and output
- Database loader
src/db/db_loader.cpp - Allocation reporter
src/io/reporter.cpp
Other components
- Operator
- PostgreSQL
- Allocation reports
Connections 16
- Operator → Optimizer entry: runs optimizer
src/main.cpp - Optimizer entry → Database loader: loads data
src/main.cpp - Database loader → PostgreSQL: reads and writes
README.md - Optimizer entry → Input preprocessing: resolves constraints
src/main.cpp - Optimizer entry → Greedy placement: starts phase one
src/main.cpp - Optimizer entry → Simulated annealing: starts phase two
src/main.cpp - Optimizer entry → MCMF optimizer: starts phase three
src/main.cpp - Optimizer entry → Database loader: saves allocation
src/main.cpp - Optimizer entry → Allocation reporter: requests reports
src/main.cpp - Allocation reporter → Allocation reports: exports CSV
- FCFS baseline → Database loader: loads data
src/fcfs.cpp - FCFS baseline → Input preprocessing: resolves constraints
src/fcfs.cpp - FCFS baseline → Greedy placement: places groups
src/fcfs.cpp - FCFS baseline → Allocation reporter: requests reports
src/fcfs.cpp - Greedy placement → Simulated annealing: feeds allocation
README.md - Simulated annealing → MCMF optimizer: refines allocation
README.md