I'm attempting to implement an optimization algorithm similarly to Jannik where individuals are sorted into projects they can participate in based on their preferences for each project. I figure my solution will probably look similar to Peter's response to Jannik. Individuals submit a list ranking their most preferred, second most preferred, and third most preferred project. In my case I am sorting a group of kids at a summer camp into some activities (things like Canoeing, Kayaking, Arts and Crafts etc).
My project differs from Jannik's in that:
- There are two time slots when the activities occur: Time 1, and Time 2.
- Every camper is assigned exactly two activities. One occurs at Time 1 and the other at Time 2.
- Every activity occurs twice. Once at Time 1 and once at Time 2.
- No camper can do the same activity twice (i.e. for Time 1 and Time 2)
In this case I'm wondering a few things about modelling this as a directed graph. Is there any way to account for the above requirements in a minimum cost flow formulation? Or would it be easier to simply set the activity capacities to twice what they are for one Time slot in real life (e.g if Canoeing can take 10 people in Time 1 and 10 people in Time 2, then Canoeing has a network capacity of 20) and then sort it out after the fact as maksay suggests?
Any suggestions or ideas? I'm pretty new to programming so I'll appreciate every comment or tip! Does my question make sense? Is it well formulated?
Bonus (not important right now):
I'm also trying to import spread sheet data with openpyxl so someone who is unfamiliar with python can sort the choices. I was thinking something simple where someone could have column A containing all the names of kids and the next three cells in rows B,C,and D correspond to their choices. If this is the case then adding node for each kid would consist of adding the value for each Cell object in column A? Any suggestions on using cell data in conjunction with networkx would be an awesome bonus!!
Thanks so much!
Aucun commentaire:
Enregistrer un commentaire