Ask HN: What algorithms should I research to code a conference scheduling app
* 4 conference rooms across 4 time slots, for a total of 16 talks.
* 30 proposed talks
* 60 total participants
Each user would be given 4(?)votes, un-ranked. (collection of the votes is a separate topic) Voting is not secret, and we don't need mathematically precise results. The goal is just to minimize conflicts.
The algorithm would have the following data to work with:
* List of talks with the following properties:
* presenter participant ID
* the participant ID for each user that voted for the talk
I'd like to come up with an algorithm that does the following:* fills all time slots with the highest voted topics
* attempts to avoid overlapping votes for any particular given user in a given time slot
* attempt to not schedule a presenter's talk during a talk they are interested in.
* Sugar on top: implement ranked preferences
My question: where do I start to research the algorithms that will be helpful? I know this is a huge project, but I have a year to work on it. I'm also not overly concerned with performance, but would like to keep it from being exponential.
Thank you for any references you can provide!
23 comments
[ 4.3 ms ] story [ 106 ms ] threadCSP: https://en.wikipedia.org/wiki/Constraint_satisfaction_proble...
Scheduling (production processes):
https://en.wikipedia.org/wiki/Scheduling_(production_process...
Scheduling (computing):
https://en.wikipedia.org/wiki/Scheduling_(computing)
... To an OS, a process thread has a priority and sometimes a CPU affinity.
Pyschedule:
- Src: https://github.com/timnon/pyschedule
- Docs: https://github.com/timnon/pyschedule/blob/master/docs/pysche...
Basically, you formulate your problem as a integer programming model [3] and use a solver [4] to solve it. You should check PuLP [5].
You can also ask your question at OR Exchange [6].
[1] https://en.wikipedia.org/wiki/Operations_research
[2] https://en.wikipedia.org/wiki/Mathematical_optimization
[3] https://en.wikipedia.org/wiki/Integer_programming
[4] https://en.wikipedia.org/wiki/List_of_optimization_software
[5] https://pythonhosted.org/PuLP/
[6] https://www.or-exchange.org/
http://orion.journals.ac.za/pub/article/view/470
- Start with a couple (say 100) completely random schedules
- Measure how good they are via a fitness function (say, start at 0 and everytime a constraint is violated add 1 point. You can be fancy and add different amounts depending on the type of constraint violated)
- Sort the schedules from lowest to highest
- Pick the top 20 or so
- Generate other 80 schedules by mutating the 20 you selected before, randomly shuffling the talks, and possibly mixing up different schedules together (crossover).
- Repeat for a couple thousands of generations, the population should quickly evolve towards better schedules
- You might get stuck on local minima, but for the most part you can just run it again several times from the start and it eventually won't get stuck
- Not guaranteed to give optimum results but should give decent enough results
You have a graph of 30 nodes. When a user votes for talks A,B,C,D, you add edges for all those 6 pairs with weight 1, or increment the weight if that edge already exists.
Find the longest path. This is your track in Room 1. Remove those nodes from the graph. Find the longest path. This is your track in Room 2. Remove those nodes from the graph.
Repeat two more times.
The problem you want to avoid is: although talks A and B are popular, they don't share the same audience members. You want to identify cohorts, or cliques, or whatever you want to call it, and keep them in the same room. Call it a "Track" and give it a name.
Maybe a little overengineered for your problem though
I cant find a link but such scheduling problems should be converted into color coding problem. Look into google scholar for group scheduling
Since the numbers are not large, I would suggest just brute force every possible combination and give each one a score based on your needs. You can then just select the higher ranked ones.
An example of assigning scores for this problem could be: Select any 16 talks and assign them randomly to the 4x4 time slots, and assign the 60 viewers to these as well. Now calculate the score as: +1 per vote these talks received per viewer that gets to attend them -10 for every overlapping vote -20 for a presenter not being able to attend a talk they are interested in
Sum up these numbers to get a score for this combination.
The actual numbers would depend on how important each criteria is to you. Calculate the scores for all combinations and pick the highest ranked ones. You can then be certain that the solutions you pick are mathematically the best ones. Implementing ranked preferences is also very easy this way.
If the numbers could get large and performance is an issue, then a genetic algorithm would be a good bet. It's like a better/more optimised way of moving through the solution space than plain brute forcing. You essentially select 50 good combinations, calculate scores for each and then eliminate the weakest ones while keeping the best ones and merge their good parts to create a new generation of solutions. And you do this till the solution converges. There are libraries in most programming languages that do much of this work for you.
Unless I am completely misunderstanding the problem statement, this is not a big project - the algorithm itself could be done in less than a weekend - maybe a few hours even. But yes, brute forcing or using genetic algorithms may not be the best way of solving this problem because of performance concerns.
hasgeek.com
https://www.google.com/search?q=conference+scheduling+app