-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 258-upgrade-to-next-1425
- Loading branch information
Showing
59 changed files
with
1,887 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
# Algoritme | ||
|
||
Algoritmen baserer seg på MIP-programmering (Mixed Integer Linear Programming). | ||
**mip_matching** er en pakke for å tildele intervjutider til søkere basert på ledige tider for søkere og komitéer. | ||
|
||
Algoritmen baserer seg på MIP-programmering (Mixed Integer Linear Programming). Se [Modellering.md](./src/Modellering.md) for detaljer. | ||
|
||
## Setup Python Venv | ||
|
||
```bash | ||
cd algorithm | ||
python -m venv ".venv" | ||
``` | ||
|
||
``` | ||
.\.venv\Scripts\activate | ||
pip install -e . | ||
pip install -r requirements.txt | ||
pip install pymongo[srv] | ||
``` | ||
|
||
## TODOs | ||
|
||
- [x] Lage funksjon som deler opp fra en komités slot | ||
- [x] Sette opp begrensningene fra modelleringen | ||
- [ ] Flikke litt på modelleringen. | ||
- [ ] Finn ut hvordan man kan preprosessere dataen for å få ned kjøretiden (f. eks ved å lage lister av personer for hver komité.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,62 @@ | ||
# Modellering av problem gjennom Mixed Integer Linear Programming | ||
|
||
## Nyttige ressurser | ||
|
||
- https://python-mip.readthedocs.io/en/latest/quickstart.html | ||
- https://towardsdatascience.com/mixed-integer-linear-programming-1-bc0ef201ee87 | ||
- https://towardsdatascience.com/mixed-integer-linear-programming-formal-definition-and-solution-space-6b3286d54892 | ||
- https://www.gurobi.com/resources/mixed-integer-programming-mip-a-primer-on-the-basics/ | ||
# Modellering av møtetildelingsproblem gjennom Mixed Integer Linear Programming | ||
|
||
## Variabler | ||
|
||
`p` | ||
|
||
- Person | ||
|
||
`k` | ||
|
||
- Komité | ||
|
||
`t` | ||
- Timeslot (Må gjøres til intervaller etter hvert) | ||
|
||
- Timeslot | ||
|
||
`m(p, k, t)` | ||
|
||
- Binær variabel | ||
- Person `p` har møte med komité `k` i timeslot `t` | ||
|
||
## Hjelpevariabler | ||
|
||
`c(p, t)` | ||
|
||
- Binære variabler | ||
- Tidspunkt `t` passer for person `p` | ||
|
||
`c(k, t)` | ||
|
||
- Heltallsvariabel | ||
- Kapasitet for komité `k` på tidspunkt `t` (hvor mange intervju de kan ha på det gitte tidspunktet) | ||
|
||
## Begrensninger | ||
|
||
For alle `p`: | ||
<!-- `m(p, k_1, t_1) + m(p, k_2, t_2) < 2` for alle par `k`, hvor t_1 og t_2 overlapper - Dette blir først aktuelt etter at timeslots har ulike tidsintervaller --> | ||
- `m(p, k, t) <= 1` dersom | ||
- `p` har søkt på komité `k` | ||
- `c(p, t) => 1` | ||
- `c(k, t) => 1` | ||
|
||
- `m(p, k, t_1) + m(p, k, t_2) < 2` for alle gyldige `k, t_1` og `k, t_2`, hvor t_1 og t_2 overlapper eller er innenfor et gitt buffer-intervall. | ||
- `m(p, k, t) <= 1` dersom | ||
- `p` har søkt på komité `k` | ||
- `c(p, t) => 1` | ||
- `c(k, t) => 1` | ||
- `m(p, k, t) <= 0` ellers | ||
|
||
For alle `k`: | ||
|
||
- `sum(m(p, k, t)) <= c(k, t)` for alle personer `p` og tidspunkt `t` | ||
|
||
## Mål | ||
|
||
Maksimere `sum(m(p, k, t))` for alle `p`, `k` og `t`. Altså: Maksimere antall intervjuer som tildeles. | ||
|
||
## Mål | ||
### Sekundærmål | ||
|
||
- La intervjuene klumpe seg rundt klokken 12 og dermed også minske hvor mange hull komitéene får i sin intervjuplan. | ||
|
||
Maksimere `sum(m(p, k, t))` for alle `p`, `k` og `t` | ||
## Nyttige ressurser | ||
|
||
- https://python-mip.readthedocs.io/en/latest/quickstart.html | ||
- https://towardsdatascience.com/mixed-integer-linear-programming-1-bc0ef201ee87 | ||
- https://towardsdatascience.com/mixed-integer-linear-programming-formal-definition-and-solution-space-6b3286d54892 | ||
- https://www.gurobi.com/resources/mixed-integer-programming-mip-a-primer-on-the-basics/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,4 @@ def __str__(self) -> str: | |
return self.name | ||
|
||
def __repr__(self) -> str: | ||
return str(self) | ||
return str(self) |
Oops, something went wrong.