Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oezeb/csp-scheduling
Constraint Satisfaction Ploblem: Scheduling
https://github.com/oezeb/csp-scheduling
Last synced: 9 days ago
JSON representation
Constraint Satisfaction Ploblem: Scheduling
- Host: GitHub
- URL: https://github.com/oezeb/csp-scheduling
- Owner: oezeb
- Created: 2023-03-07T12:59:37.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T13:22:04.000Z (almost 2 years ago)
- Last Synced: 2024-11-06T12:11:43.227Z (about 2 months ago)
- Language: C++
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Constraint Satisfaction Ploblem: Scheduling
CSP technology can be used to solve scheduling problems in everyday life that need to satisfy various constraints.
Here We present an example of a company `Weekly Staff Scheduling`.## Constraints
- `Minimum Days Off`: Even robots need to recharge their batteries once in a while!
- `Maximum Consecutive Days Off`: Too much of a good thing can be bad, even days off!
- `Minimum Daily Staff`: We don't want our employees to feel lonely at work!
- `Minimum Daily Senior Staff`: Don't leave the newbies hanging, they need someone to hold their hand!
- `Conflit`: Some employees can never get along!## Usage
### Compile && Run
```bash
$ g++ main.cpp scheduler.h scheduler.cpp -o main
$ ./main [-o ]
[-min-days-off ]
[-max-consec-days-off ]
[-min-daily-staff ]
[-min-daily-seniors ]
[-conflict ...]
```- Input file format:
```
worker_id level
worker_id level
...
-constraint-name value1 value2 ...
-constraint-name value1 value2 ...
...
````level` should be senior or junior
- Conflict
Note that the constraints can either be declared in the input file or as argument when running the program.
All the constraints except `-conflict` support only one value.
`-conflict 1 2 3` <==> `-conflict 1 2` and `-conflict 1 3` and `-conflict 2 3`
`-conflict` means two or more people cannot work together the same day.
### Example
- Input file
```
1 senior
2 junior
3 junior
4 senior
5 junior
-conflict 2 4
-min-days-off 2
-max-consec-days-off 3
-min-daily-staff 3
-min-daily-seniors 1
```- Result
```
Min days off: 2
Max consec days off: 3
Min daily staff: 3
Min daily seniors: 1
Conflicts:
4: 2
2: 44 4 x 4 4 x 4
x x 2 x x 2 x
5 5 5 x 5 x 5
3 x x 3 3 3 3
1 1 1 1 x 1 xDuration: 1 ms
```