How to assign students to the right school based on multiple criteria - algorithm

I need help to find the best algorithm/decision model (sorry I don't know how to call that precisely) to solve the following problem.
I have students living in a town, multiple schools in the town, and I need to assign each student to a school so that we achieve the "best combination of criteria".
The criteria are for example:
a diversity (boys/girls) close to the diversity of the group (i.e. not all the boys together)
distance to the school
age of the student
and there could be more criteria in the future
What I need is not the solution, that's why for example the exact list of criteria does not matter yet.
What I need is more an advice on what are the possible ways to solve this problem.
The "only" way I can think of at the moment is to write an algorithm to try all the possible combinations of students & schools and somehow calculate a score of each combination (each criteria would have a "weight") and then pick the solutions with the best scores. But with this approach, the amount of combination can be quite huge if we take for example 1000 students and 5 schools. So maybe there are other ways to do it.
Programming language is not important at the moment.
Thanks in advance for any help you can provide :)

This is a linear optimization problem, usually solved with the Simplex algorithm: https://en.wikipedia.org/wiki/Simplex_algorithm

Related

Algorithm to match a group's preferences to a single result?

I am trying to build a small app so that my friends and I can more easily make decisions about where we want to eat. The idea is that, given a list of restaurants, each person puts down a score from 0-100 indicating how much they like that restaurant. I want to figure out a good way to combine those scores to output an ordered list of recommendations. For discussion's sake, we can assume that everyone scores restaurants normally across the scale (i.e. let's assume the individual preference scores are valid/normalized/etc.).
As of now, I was thinking of just sorting by the average score of each restaurant while enforcing a minimum score from each person so that no one is very unhappy. In other words, the goal is to maximize happiness with the constraint that no one should be extremely unhappy.
Does anyone have any suggestions on a clever algorithm or better way to achieve this? Is there any research on matching problems that could be relevant to this, or am I just over-thinking it?
Your can first compute for each restaurant:
- the mean value
- the minimum value
Then you can easily sort by mean with any constraint you need.
Other intersting methods exist. You can for instance use minimax. It means you sort by maximum among the restaurant minimums. It guarantees that noone would hate this restaurant.
This looks like the Weighted voting system, check wikipedia or other Internet resources.
Note that this system can easily be manipulated if voters or not honnest, you probably want another system.

What algorithm is the best for connecting users based on a set of criteria?

For a school related assignment I am doing research on finding algorithms who could help connecting users based on a set of criteria.
Imagina we have a big box with thousands of users with criteria like popularity and location.
How will I be able to find a perfect match for a specific user? The goal is to connect people worldwide to unique people.
I am very new into algorithms and data structures. At this moment I think a optimization algorithm could help but I don't see a specific implementation.
I am curious what you think, guys! If you need some more information or do have questions, feel free to ask!
Greetz,
Bobby
Note; For now I labeled this question under 'algorithm', please let me know if I should add other labels for better finding!
You are asking for the best algorithm, but that probably depends on the application. Here is what you could do:
Turn the properties of each user into a normalized array. E.g. if we have three properties: age in years, income in $, smoker (yes/no) then this could be transformed to [age, income / 10000, smoker = no ? -5 : 5]. So if one is a smoker and the other one isn't then it is about as bad as 10 years of age difference.
This gives a data point in a hyperdimensional grid for each user. Now we can just measure the distance (e.g. euclidean distance) between a user and his closest neighbours and then take the shortest one.

Algorithm for assigning people based on multiple criteria

I have a list of users which need to be sorted into committees. The users can rank committees based on their particular preference, but must choose at least one to join. When they have all made their selections, the algorithm should sort them as evenly as possible taking into account their committee preference, gender, age, time zone and country (for now). I have looked at this question and its answer would seem like a good choice, but it is unclear to me how to add the various constraints to the algorithm for it to work.
Would anyone point me in the right direction on how to do this, please?
Looking for "clustering" will get you nowhere, because this is not a clustering type if task.
Instead, this is an assignment problem.
For further informarion, see:
Knapsack Problem
Generalized Assignment Problem
Usually, these are NP-hard to solve. Thus, one will usually choose a greedy optimization heuristic to find a reasonably good solution faster.
Think about how to best assign one person at a time.
Then, process the data as follows:
assign everybody that can only be assigned in a single way
find an unassigned person that is hard to assign, stop if everybody is assigned
assign the best possible way
remove preferences that are no longer admissible, and go to 1 again (there may be new person with only a single choice left)
For bonus points, add a source of randomness, and an overall quality measure. Then run the algorothm 10 times, and keep only the best result.
For further bonus, add an postprocessing optimization: when can you transfer one person to another group or swap to persons to improve the overall quality? Iterate over all persons to find such small improvements until you cannot find any.

How is this comparison/ranking algorithm called?

I've seen some sites where they show two random items from a list, and users pick which one they prefer, and then based on the results of the user preferences, a ranking is generated for the entire data set. Does anyone know what this ranking algorithm is called and how it works?
Thank you.
I believe you're referring to the ELO rating system.
A simple implementation would be to always choose two random items for the comparison and give the preferred item a point. Then rank in order of decreasing points.
The usual method for this is collaborative filtering. For this usually the choices of all persons are compared and a similarity between persons is used to weight their choices, when recommending or rating items. That means, people who have shown similar choices to yours before, are used more to generate recommendations than those who have shown different behavior.
There are several methods for doing this inference, and which one is best or how to optimize the performance is an open research questions. Most often the simplest implementation will achieve sufficent predictions and is easy to implement. It just does a two multiplications of the preference matrix with itself transposed.

Using graph theory to generate an exam schedule

I came across this website while looking for help on the internet regarding adj. matrix / graph theory.
My program layout is as follows:
student name + courses stored in a 2D
array array with all distinct courses
I am trying to achieve the following:
use adjacency matrix to create an
exam schedule where no student needs
to write more than one exam a day
Once the matrix is made, the results on the screen should be displayed as:
output a day by day exam schedule by course
output the exam days of any student inquired
I am not really sure how to work on this. AFAIK, the best approach would be to create an overall exam schedule of all the distinct courses and computing it in such a way that no exams conflict with one another.
Any help/advice/links is greatly appreciated.
Any suggestions on how to program this? I can't seem to find any pseudo code or guidance on programming the graph coloring problem.
You can model your problem as a graph coloring-problem.
Edit:
Another heuristic approach using genetic algorithms.
I would suggest taking the brute-force approach, to start. The number of possible arrangements of exams is likely small enough to exhaustively search them.
To give more detail for a solution, it would help to know more about the problem: How many exams per day? Is it possible for there to be multiple simultaneous exams, or are they all sequential?

Resources