Assigns students to internship companies based on preferences using Answer Set Programming (ASP) with Clingo.
Input:
- Students
- Student preferences (optional)
- Companies with capacities
Goal: Assign every student while maximizing preference satisfaction and respecting constraints.
project/
βββ main.py
βββ rules.json
βββ utils/
βββ data/
βββ model.lp
βββ README.md
- Load data from
/data - Clean & normalize names, generate IDs (
vorname_nachname) - Merge students with preferences
- Generate ASP files (
data.lp,config.lp) - Run Clingo to compute optimal assignment
- Parse results and map back to names
- Export
assignments.csv
Configure assignment behavior without changing code:
{
"min_per_company": 7,
"max_prio": { "Caritas": 2 },
"fill_first": { "Gesobau": 20, "ABB": 10 }
}pip install pandas
Install Clingo: https://potassco.org/clingo/
python main.py
python main.py --timeout 120 --debug
--timeoutβ solver time limit (seconds)--debugβ verbose logging
assignments.csv
Vorname,Nachname,company
Florian,Abraham,ABB
...
- All students are assigned (even without preferences)
- Missing preferences =
0 - Rules use fuzzy company name matching
- Python + Pandas
- Clingo (ASP solver)
β Modular structure
β Configurable rules
β Logging & CLI support
β Optimal assignment generation