Hello everyone,
i have the following problem. I want to create an algorithm in Javascript that solves the following problem. At the moment I lack the solution.
There are 20 students in a university and there are 20 projects with different topics. Exactly one student can work on exactly one project.
There is an election to distribute the project topics, each student can choose three topics (first choice, second choice, third choice).
The votes have a weight. A student must choose three different projects with his votes.
Inputdata:
const userVoice = [
{id: 'user_one', choices: ['course_one', 'course_two', 'course_three']},
{id: 'user_two', choices: ['course_two', 'course_one', 'course_three']},
{id: 'user_three', choices: ['course_two', 'course_one', 'course_three']}
...]
const courses = [
{id: 'course_one'},
{id: 'course_two'},
{id: 'course_three'}
...]
The algorithm should evaluate the choice of projects and intelligently assign the students to the topics. The algorithm aims to get the best possible distribution (The majority of students get their first or second choice). For example, if student A is assigned to his third choice, 4 other students could get their first choice. Does anyone know how to write such an algorithm or what such an algorithm is called. Does anyone know how to write such an algorithm or what such an algorithm is called?
i have the following problem. I want to create an algorithm in Javascript that solves the following problem. At the moment I lack the solution.
There are 20 students in a university and there are 20 projects with different topics. Exactly one student can work on exactly one project.
There is an election to distribute the project topics, each student can choose three topics (first choice, second choice, third choice).
The votes have a weight. A student must choose three different projects with his votes.
Inputdata:
const userVoice = [
{id: 'user_one', choices: ['course_one', 'course_two', 'course_three']},
{id: 'user_two', choices: ['course_two', 'course_one', 'course_three']},
{id: 'user_three', choices: ['course_two', 'course_one', 'course_three']}
...]
const courses = [
{id: 'course_one'},
{id: 'course_two'},
{id: 'course_three'}
...]
The algorithm should evaluate the choice of projects and intelligently assign the students to the topics. The algorithm aims to get the best possible distribution (The majority of students get their first or second choice). For example, if student A is assigned to his third choice, 4 other students could get their first choice. Does anyone know how to write such an algorithm or what such an algorithm is called. Does anyone know how to write such an algorithm or what such an algorithm is called?