Student-group allocation algorithm - algorithm

I have 150 students, and have to assign them to specific groups (with different topics). They can rank their preferences for the topics and will each have different groups. My main issue (more than being optimal with respect to a certain metric) is that the outcome has to be doable in the timetable.
More precisely, here are some data:
150 students
10 topics that each student will rank
each student will be assigned to 5 topics
the groups for each topic have to be between 10 and 15 (there may be various groups for the same topic or no group for some topics)
the final assignment has to fit into a timetable: there will be only 5 time slots (different groups can be on the same slots, but students cannot duplicate themselves to follow various groups at the same time)
What kind of algorithms could provide possibilities for such a situation?

Related

Creating a matchmaking algorithm with two different groups

Lets say that there is a queue where users await matchmaking. The algorithm needs to select a number of hosts from two different groups (group A and group B). The players of each match will be part of the opposite group from the host (match hosted by a member of group A will be filled with players from group B). However, the queue will most likely have a disproportionate ratio of these groups. For example, group A could have 100 people in queue and group B could have 300. Games will be generated with between 5-10 players for each host.
What is a good way to go about this that minimizes the amount of people not in a match and evenly disperses hosting roles between the two groups?

How do you group data objects subject to several constraints?

I'm writing an application for a society in my campus and the main job of this application is to put members into groups subject to several
I need to determine the number of groups which depends on the number of members.
Then I need to arbitrarily/randomly select leaders for each group.
Then I need to add members to each group ensuring that each group satisfies the following constraints:
The number of members(including the leader) should be less than or equal to 7 and greater than or equal to 4 .
No more than 2/3 of the group should be the same gender.
No more than 2/3 of the group should be the same year of study.
Each member is classified as coming from a certain region depending on their place of residency. All members of the group should come from the same region.
Now I'd like to know how to go about this in terms of what known data structures and abstract data types can I use? What known algorithms can come in handy? Is there already a known computer science problem similar to mine that I can read up on?... etc... I think you get the question. I've done some googling around the web but nothing really helpful so far.

random group generator in R

I have a data set consisting of 250 students from different schools and classrooms. For the experimental design, I would like to generate in a random manner 35 groups consisting of approx. 7 students in each group, and then after the first activity, break up the students as randomly as possible in to 25 groups of 10 students each. Is there a package and example of how I can perform this in R?
If there's no relation between which groups students are in during the first and second activities, then it's the same problem twice over.
Assuming a student can only belong to one group at a time, just shuffle the array and pull out elements per your group size until there are no more left.
students=1:250;
rand_students=sample(students,length(students));

How to calculate correlation amongst preferences?

I have to split a group of x people into 3 or 4 groups, most likely 3.
I want people to be happy, so I'm having each person rate the other members of the big group from 1 to (x-1).
How do I optimize preferences to create 3 groups?
Here is a method that is likely to get a good arrangement, even if it is not an optimal arrangement:
First create a ranking function that can take any pair of groupings and determine whether one is better than the other. Then apply the following algorithm:
Randomly assign people into groups.
Randomly pick one person from each group.
Create new groupings in which each combination of reassignments is performed on the people chosen in step 2. (For 3 groups there will be 6 such reassignments. For 4, 24.)
Of all possible reasignments, pick the best one.
Repeat steps 2–4 one million times.
UPDATE
If there are only 18 people that need to be assigned, then that's just (18 choose 6) * (12 choose 6) / 6 = 2,858,856 possible groupings. (Or, in the case of four groups it's (18 choose 4) * (14 choose 4) * (10 choose 5) / 4 = 192,972,780 groupings.)
You can just try each one and pick the best.
I guess the ranking algorithm itself is really the hard part of this assignment.
You could just give each person a score based on summing the scores of the people selected to be in their group, then sum the scores of each person together.
The problem is that you're going to end up with all the popular people in one group, and all the unpopular people in another group, and all the telephone handset cleaners in another group.
You should just assign people randomly, and then tell them that you used some really scientific system. That way everybody gets a good mix.
Measure the total satisfaction of a given configuration by calculating the distance between the actual positions and the stated preferences. Start with a randomized set of groups. Then use something like hill climbing or simulated annealing to optimise.
http://en.wikipedia.org/wiki/Hill_climbing
http://en.wikipedia.org/wiki/Simulated_annealing
Simulated annealing sounds complicated, but it's really just a cleverer version of hill-climbing.

Appointments scheduling algorithm [duplicate]

This question already has answers here:
Best Fit Scheduling Algorithm
(4 answers)
Closed 9 years ago.
I have the following problem to solve, perhaps you could give me some ideas regarding the problem - solving approach:
There are:
8 classrooms
16 teachers
201 students
149 parents
241 appointments (most of the parents need to see multiple teachers, either because the have more than one child or because one child is being taught by two or more teachers)
2 days.
For each day:
7 classrooms are available for 20 hours per day.
1 classroom is available for 10 hours per day.
Each teacher occupies one classroom
Each appointment lasts for one hour
Further constrains:
- For each parent, all appointments must be sequential (having at maximum 1 hour pause)
- Each parent should have to visit the school one day only.
- For each teacher, all appointments within the day must be sequential (having at maximum 2 hours pause)
- Out of the 16 teachers, 3 can only be present one of the two days.
I'm trying to find an approach to produce the appointments schedule, obviously without having to calculate all possible variations until all the requirements are met. Any ideas?
You need to define your constraints a bit more; i.e., what is the relationship between students and teachers? What is the relationship between students and parents? Do parents have to have individual appointments, or are the parents of a single student allowed to meet with a single teacher together?
I'd approach this with an initial (in testing) naive approach; just pick your highest constrained resource (looks like the teachers that can only be present for one of the two days), schedule those using the first available resources, and then continue through the set of resources, scheduling them using the first available resources that match their constraints and see if you can schedule the entire set. If not, you need to find your limiting resource(s), and apply some heuristics to your matching to find the best way to optimize those limited resources.
It's a bit of a tricky problem; have fun!
Take a look at the curriculum course track of ITC2007 and it's implementation in Drools Planner or unitime. Both of them use meta-heuristics such as tabu search and simulated annealing.

Resources