key: cord-0603001-cgg67oba authors: Bir'o, P'eter; Gyetvai, M'arton title: Online voluntary mentoring: Optimising the assignment of students and mentors date: 2021-02-12 journal: nan DOI: nan sha: 4dd1d14d3d2543db3455933eb652d5fb88142847 doc_id: 603001 cord_uid: cgg67oba After the closure of the schools in Hungary from March 2020 due to the pandemic, many students were left at home with no or not enough parental help for studying, and in the meantime some people had more free time and willingness to help others in need during the lockdown. In this paper we describe the optimisation aspects of a joint NGO project for allocating voluntary mentors to students using a web-based coordination mechanism. The goal of the project has been to form optimal pairs and study groups by taking into the preferences and the constraints of the participants. In this paper we present the optimisation concept, and the integer programming techniques used for solving the allocation problems. Furthermore, we conducted computation simulations on real and generated data for evaluate the performance of this dynamic matching scheme under different parameter settings. In Hungary, after the escalation of the COVID-19 virus, the government announced the closure of all schools on 13 March 2020 (Friday evening) with effect from 16 March, and they requested all the schools (both primary and secondary schools for students at ages between 6 and 18) to start online/distance education immediately. There was no central recommendation about the technology and methodology used, so this was decided mainly by the board of each school using a wide range of online platforms (e.g. Google Classroom, MS Teams, etc) or just sending the weekly assignments by post. A large number of students had difficulties to follow the distance education, partly because of the lack of equipment or internet connection, but also because the parents were not be able to help them at home, due to their lack of knowledge in special subjects or just because of being at work (e.g., including those parents working intensively in health care). At the same time, many people, especially the elderly ones had to stay at home with spare time. Furthermore, in Hungary there is also a scheme for secondary school students for voluntary work, which they can get credit for (that counts extra points at the centralised university admission), and very few possibilities remained for such services under the strict social distancing rules imposed. Therefore, there was both a large need for mentoring, and also a significant amount of potential mentors, both elderly and young. A project was proposed in early April and then officially started with the opening of a web-application (onkentesmentoralas.hu) in early May in a cooperation of three parties. On behalf of the Institute of Economics of CERS, the Mechanism Design and the Education Economics research groups offered their help in designing a mechanism for allocating students to mentors. The Hungarian Reformat Church Aid is a humanitarian organisation, which had a link to a governmental action group devoted to coordinate the voluntary help in Hungary. The third party in the project was #school, a private company providing an online teaching platform, that became used by 100k registered users soon after the online education started. The latter two parties have had a related collaboration in the past, where they organised the mentoring of highly disadvantaged children. The design approach was rather complex, taking into account the preferences of both sides, and also allowing the formation of study groups, besides the mentor-student pairs. The basic requirement of creating a pair is to have a subject (e.g. Math at year 7) that is both requested by a student and offered by a mentor. However, the students can request several subjects listing them according to their preferences and whether they are willing to study in groups or only in pairs. The mentors can specify their preferences over the subjects they offer to teach, whether they are willing to supervise groups (or only individuals), and they can also set preferences over some characteristics of the students, such as their age, their performance level in that subject measured by their grades, and their social status (i.e. whether the mentor prefer to teach highly disadvantaged students). In the optimisation we carefully considered several potential goals and we implemented a combination of them, such as maximising the number of students matched, the overall volume of the teaching hours, the preferences of both the students and mentors, and the coherence of the study groups. After implementing our approach we conducted matching runs on a week from early May until the end of the academic year, that is mid-June in Hungary. The first period of this application was very short, and we had an unexpectedly high number of mentors volunteered, but also an unexpectedly low number of students registered. Therefore the allocation problem was rather straightforward. Nevertheless, we used the data from this early period to generate instances that are realistic, and we present the simulations conducted on that data in this paper. The pandemic situation has became critical again in Hungary by October due to the second wave of infections, so on 6 November 2020 all the secondary schools and universities have been closed again, and thus we open again our allocation service to link volunteering mentors with students in need. The pandemic situation has been similar around the world, and especially critical since April in the USA, an early report on the American schools' responses to COVID-19 can be found in [21] . In this paper we describe the optimisation aspects of our aforementioned joint NGO project of allocating voluntary mentors to students with presenting also computational simulations on realistic instances. We believe that this paper provides an interesting case study with an advanced OR solution that could be used everywhere in the world to help allocating the volunteers to people in need in an efficient and fair way. Matching problems under preferences in two-sided matching markets have been widely studied both in mathematics, computer science and economics, see e.g. a recent book on the algorithmic aspects of this topic by Manlove [24] . Beside the theoretical studies, practical applications have been designed and implemented in many areas, see a recent survey on this [9] . When both sides of the application have preferences, then the concept of stable matchings was proposed in the seminal paper of Gale and Shapley [18] and has been used since in many applications, such as resident allocation, college admission and school choice. However, there can be some special features that can make the stable matching problem computationally hard to solve. In this case one robust approach to tackle these problems is (mixed) integer linear programming, that has been used recently for the hospital-resident problem with couples [11] , ties [22, 17] , college admissions with lower and common quotas [4] , and stable project allocation under distributional constraints [5] . In this paper we also use MILP technique for solving the underlying optimisation problem. There are also many application, where preference of one or both sides do matter, but the solution is not necessarily stable or fair in some sense, but rather optimal. Examples are the allocation of papers to reviewers [19] , course allocation [15] , or arranged marriages [16] . Scheduling problems are also closely related, see a paper linking the two lines of researches [12] . In our application of allocating mentors to students we can observe a dynamic nature, so the literature on online matching is also related. Natural applications for online matching with preferences are deceased organ allocation [25] , [3] , allocation in social housing [23] , [14] , electric vehicle charging [20] , or lending decisions [28] . There are also applications, which are dynamic in nature, but instead of online matching protocols, batch allocations are also used. An important example is refugee allocation, where preferences of one or both sides may be taken into account, together with some objective goals of maximising the likelihood of successful settlement of the refugee families, see [29] , [6] , [8] . Similar approaches are used in the allocation of foodbanks [26] . Finally, an important example for an application where optimisation is used for the allocation are the kidney exchange programmes (KEPs), where kidney patients with incompatible donors may exchange their willing donor among themselves. Seminal work on IP models for KEP's is presented in [1] and [27] , a recent survey is [7] , and the European optimisation practices are summarised in [13] . It is interesting to note that online matching is used in the US, partly because of the competition in between multiple national programmes [2] . However, in Europe the national programmes use batch allocations, by conducting the matching runs in 3-4 months regular intervals [10] . We describe the allocation mechanism that we designed with our partners and implemented in the applications. The design is complex, it takes into account the preferences of both sides, and also some objective factors. The main novelty and challenge in our solution concept is that besides mentor-student pairs we also seek to form study groups, that makes the underlying optimisation problem more elaborate. Our main theoretical contribution is an IP formulation that accommodates all the complex constraints and objectives of our model. These results are complemented by computational experiments, where the generation of the instances is based on the real data that we collected in the first period of the application. In our simulation we analyse the effect of some optimisation policy decisions with regard to various performance measures. We also test the effects of having shorter or longer matching periods, and the possibility of giving priority based on the waiting time. The results of the simulation have been used to refine the design and optimisation policy of the application. When describing the formal model, first we give a general description, then we specify the variables for the solution, and finally we describe the input data for the preferences, priorities and further objective factors. We have a set of students A = {a 1 , a 2 , . . . , a k }, mentors B = {b 1 , b 2 , . . . , b l }, and subjects S = {s 1 , s 2 , . . . , s m }, the latter being specified with the year as well (e.g., year 10 -Chemistry). We would like to form pairs (each consisting of one student and one mentor) and groups (each consisting of a set of students and one mentor) so that the online mentoring is conducted in these pairs and groups in weekly periods. For every pair and group formed we also specify the subjects that they are going to study and the amount of time that they are supposed to spend with each subject during a week. As the input of the problem the students give the list of subjects that they need mentoring in a preference order, specifying also the amount of time they wish to spend with a mentor per week (integer number between 1 and 3) for each subject. So a student may ask 2 hours of mentoring in Maths and 1 hour in Physics with higher preference for the former. The students can give information on why they need mentoring (e.g., being a child of a single mother who works in a hospital as a nurse), and about their objective circumstances with regard to their social background, such as the number of children/parent at home, etc, that can result in additional priority for them. Furthermore, they also provide information on the class they attend and whether they have ongoing online education from that subject, if they are weak, medium or good students (by giving their final grade in the last semester), and whether they are willing to accept mentoring in groups or only in pairs. Finally, we ask what equipment they have at home (PC, tablet, smartphone). Regarding the mentors, we ask in which subjects they are willing to mentor students (including the years), and whether they have preference over the subjects, and some characteristic of the students, such as their age, how strong the students are in the subject, and their social status (some mentors can be especially keen to teach socially disadvantaged or weak-performing students, some might not). We ask the total number of hours that they wish to spend with mentoring per week and whether they are willing to do mentoring in groups. The organisers of this project decided that some of the above mentioned priorities will only apply for such mentors that express their agreement. For instance, every mentor can tell whether she wishes to teach highly disadvantaged students, and if they say no then no priority is given for those students when considering to allocate them to this mentor. However, if the mentor states that she would be happy to teach highly disadvantaged students then a high weight is added. If the mentor is ignorant about this aspect, then a small weight is added for this priority factor. The same applies for the criterion whether the student is a weak student with low grades from the last semester. If a mentor expresses that she does not want to teach weak students then no priority is given for these pairs, but if she wishes to teach weak students then extra weight is given. Thus we take the preferences of the mentors into accounts for some of these controversial priorities, but for some others, e.g., number of children/parents in the family, we always give an extra priority. In this way the pairs and group resulted are more likely to be mutually satisfying. As the basic building block of the optimisation model we have the set of possible paired mentoring activities E, where each activity e consists of a triple e = (a i , b j , s k ). Activity e is possible if student a i requested subject s k and mentor b j also offered s k . Let S(a i ) and S(b j ) denote the set of requested subjects by student a i and offered subjects by mentor b j , respectively. Furthermore, student a i requested q(a i , s k ) hours per week in subject s k and mentor b j offered Q(b j ) hours per week in total. We write that (a i , s k ) ∈ e if there is b j ∈ B such that e = (a i , b j , s k ), and similarly, we write that (b j , s k ) ∈ e if there is a i ∈ A such that e = (a i , b j , s k ). In the description of a solution, let x e denote the amount of hours scheduled for activity e in a pair, and let y e be a binary variable denoting whether activity e is performed in a pair, i.e. y e = 1 ⇐⇒ x e > 0. In our practical application we restrict x e ∈ {0, 1, 2, 3}. 1 Let P denote the set of pairs formed, i.e., P = {e ∈ E : y e = 1}. Besides pairs, we also allow the formation of groups, whose final set in the solution will be denoted by G. Each group g ∈ G consists of a triple g = (A g , b j , s k ), where A g ⊂ A is the subset of students involved in group g with mentor b j and subject s k . Here x g denotes the amount of time scheduled for group g, x g ∈ {2, 3}, if g is formed. (Note that x g is not a variable in our MILP model, we use that only to describe our solution.) In our model and application, for simplicity, we assume that every mentor can have at most five groups to supervise in a subject. Thus, for every mentor b j who is willing to teach groups in subject s k , we create five potential groups g k,1 j , g k,2 j , . . ., g k,5 j with capacity c k j each. We introduce a binary variable y k,t j to denote whether the potential group g k,t j is realised, in which case there are at least two and at most c k j students involved. Let x k,t j denote the number of hours allocated for its weekly operation, where x k,t j ∈ {0, 2, 3}. Note that y k,t j and x k,t j are the variables of our mixed integer programming formulation. For every activity e = (a i , b j , s k ), we create a binary indicator variable y t e denoting whether this mentoring activity is performed in potential group q k,t j . Therefore the set of students involved in this group will be A g = {a i ∈ A : e = (a i , b j , s k ), y t e = 1}. The following formula summarises the feasibility condition for realising potential group q k,t j . For example, a potential group g k,1 j for mentor b j can be on 7-year Maths (s k ) for at most 5 students (c k j = 5). If this group is realised (y k,1 Regarding the personal mentoring hours in a group, as students in a group may have different requests, we estimate the actual mentoring hours by variable Here we describe the input more formally listing the information provided by the users with regard to their attributes and preferences. For every student a i , we collect the following attributes and preferences: • year i ∈ {1, 2, . . . 12}: which year of study she attends. • class i : exact class she attends in the school (text). • P A i : preference list consisting of the subjects she requested mentoring (e.g., Math, Physics, History). Let rank i (s k ) denote the rank of s k in P A i for s k ∈ S(a i ). • RA i : number of requested hours for each requested subjects in the order of preferences. Note that in our LP model q(a i , s k ) denotes this constant for each subject s k ∈ S(a i ). • grades i : her grades from the last semester in the subjects requested, let gr(a i , s k ) denote the grade of a i in subject s k , that is a value in between 1 and 5 in Hungary (5 being the best, and 1 meaning Failed). • group i ∈ {0, 1}: the value is 1 if a i is willing to accept mentoring in groups. • equipment i ∈ {0, 1}: the value is 0 if she has a smartphone or tablet and the value is 1 is she (also) has a laptop. • help i ∈ {0, 1, 2}: self-reported neediness, whether a i has help at home (0= yes, 1= limited, 2= no) When forming the groups, the similarities between the students can be important, therefore for those students willing to get mentoring in groups we define the following values for each pair of students a i and a i . • sc i,i : the value is 1 if they attend the very same class and 0 otherwise. : the difference between their last year's grades in subject s k . • de i,i = |equipment i − equipment i |: this value is 0 if they have the same equipment and 1 if they have different ones. Furthermore, for those students wishing to get priority, we also ask question about her social background and circumstances, based on which we award the following scores for student a i . • SD i ∈ {0, 1, 2, 3}: a measure showing how socially disadvantaged is the student (3 being the maximum value). • N H i : an index for not enough help at home with a value between 0.5 and 2.5 showing how many children are for one parent at home. Thus its value is a half-integer between 0.5 and 2.5. • W S i ∈ {0, 1, 2, 3}: showing how weak is the student based on her grades and repeated years. • CY i ∈ {0, 1, 2}: how critical the year is for the student, i.e, for last year of studies = 2, and for one before the last year = 1. Here we describe what preferences the mentors provide on the subjects and students. • P M j : preference list of b j on the subjects she offers for mentoring (e.g., Math, Physics, History). Let rank j (s k ) denote the rank of s k in P M j for s k ∈ S(b j ). Note that this may be set differently for the three different age-categories, years 1-4, 5-8, 9-12. • Y M j ∈ {0, 1, 2}: most preferred age of the student for b j (0= Year 1-4, 1= Year 5-8, 2= Year 9-12). • DM j ∈ {0, 1, 3}: whether b j is willing to mentor socially disadvantaged students (0= rather not, 1= does not matter, 3= would be very keen). • GP M j : grade-preference, = N if no preference is given, = W for weak, = M for medium, and = S for strong students. From this information, we create the following constants: Here, P M j is an indicator whether b j has grade-preferences; SM j show how willing b j is to mentor a weak student; finally, W M j is the best average grade of the student according to b j 's preference. In this section we show how we can formulate our problem as a mixed integer linear program. First we describe the basic constraints for the feasibility of a solution. We summarise the feasibility requirements as follows. Feasibility constraints: 1. Only use mutually acceptable paired mentoring activities in the solution (i.e., the subject should be requested by the student and offered by the mentor linked). 2. Only those mentors can have groups and only those students can be assigned to groups who expressed their willingness to teach or study in groups, respectively. 3. Have at least two and at most a limited number (c k j ) of students in each group. 4. We obey the weekly capacities of the mentors. 5. The mentoring hours of a pair in a subject should not exceed the requested amount by the student, and never be more than 3. The mentoring hours per week for an active group is either 2 or 3. 6. Every student can be mentored by at most one mentor in each subject that she requested. The first two conditions are automatically satisfied, since we only work with mentoring activities, where the subjects are mutually acceptable by both parties (i.e., requested by students and offered by mentors). Similarly, we only create potential groups for those mentors who are willing to teach in groups and we only have variables y t e and x t e for those students who are willing to study in group. Regarding the pairs, the connection between x e and y e can be established with the following formula. A similar formula is added for each potential group, but with the minimum number of hours being 2. For the realisation of potential groups, we set the following conditions. Every activity can be used either in a pair or in a group: The above constraint is also enforced by the more general requirement that every student can have at most one mentor in each subject: For later usage in the objective function, we introduce some new variables β k i indicating whether student a i is involved in mentoring activity in subject s k and γ i indicating whether student a i is involved in any mentoring activity. We link these variables with the basic variables as follows: where M is a large enough number, e.g., the number of subjects any student can possibly request mentoring (5 in our case). The weekly capacity of the mentors should not be exceeded: The mentoring hours of a pair in a subject should not exceed the requested amount by the student: When computing the volume of a solution, for groups we assume that the actual mentoring hours for a student (x t e ) is upper bounded by her original request in this subject, and by the number of mentoring hours of the group. This can be formalised with the following constraints Now, we turn our attention to the objectives. 1. Maximising the number of students getting a mentor. 2. Maximising the number of pairs and groups realised with different weights for pairs and groups. 3. Maximising the number of mentoring hours realised with different weights for pairs and groups. 4. Satisfying the preferences of the students and mentors as well with regard to the subjects. 5. When forming groups, we improve cohesion if we have students a) from the same class, b) with the same type of equipment, c) their former grades being as close as possible, and d) the number of scheduled hours for the group to be close to what the assigned students requested in that subject. 6. Giving priority to certain students in needs (depending on the preferences of the mentors for some criteria, such as social status and student past performance). 7. When the same mentor-student pair can be involved in paired mentoring activities in multiple subjects then this is preferable. We note that additionally one might wish to consider the genders of the mentor-student pairs, or whether they live in the same city, geographic area, or maybe if they attend the same school in the case of student mentors. Let w g denote the discount for a mentoring activity being realised in a group, as opposed to a pair. In our default setting, we use w g = 0.7, which means that each mentoring hour in a group counts 0.7 hour in a pair. This is a crucial parameter, since it highly affects the share of groups in the final solution. Now we explain the rational behind each of the above listed objectives and we formulate the corresponding linear terms for the objective function of the linear program. The relative weights of these terms in the objective function were up to the expert choices by the organisers of this application. Note that the relative weights sum up to 100, so they can be interpreted as percentages showing the importance of the objective criteria. 1. Number of students allocated. Allocating mentors to as many students as possible. Rational pros: We would like to involve as many students as possible in the mentoring, even if for one subject requested. Rational cons: If this objective is dominating then we would have many mentoring activities with 1 hour only that can be inefficient for both students and mentors. Relative importance in the application: 0 (i.e., this criterion was decided not to be considered as objective, only monitored) Linear term: With the usage of variables γ i , we can simply express this objective as follows. Rational pros: We would like to create as many pairs and groups as possible, to create the links between the parties. Rational cons: If this objective is dominating then we would have many mentoring activities with 1 hour only for pairs and 2 hours for groups that can be inefficient for both students and mentors. Relative importance in the application: 0 (i.e., this criterion was decided not to be considered as objective, only monitored) Linear term: Similar to the formula for β i , we express this objective as follows. As the volume will be the main objective in our optimisation, we will set the relative weights for each mentoring activity accordingly. Let w e denote the final weight of activity e in a pair and let denote w g e is the final weight of an activity in a group. We suppose that w g e = w e · w g = w e · 0.7 in our case. The final weight w e will be a sum of weights with respect to different objectives. The first objective is the volume, that we weighted 50 for all activities, so let w w e = 50 for every activity e. 4. Preferences. Satisfying the preferences of the students with regard to the subjects, and the preferences of the mentors on the subjects and on the ages of students. Rational: The higher the need of the student for a subject the more important for her to get help, and the preference of the mentor should also be taken into account for the subject and the age of the student supervised. Relative importance in the application: 10 Linear term: Each activity e = (a i , b j , s k ) will get an additional weight according to the preferences of the students and mentors as follows, that we denote by w p e . Let w p e = (6−rank i (s k ))+(6−rank j (s k ))+3 * agepref j i , where each of the first two terms gives a value between 1 to 5, depending on how preferable this subject is for the student/mentor, and the last term gives 3 if the age of the student is preferred by the mentor (among years 1-4, 5-8, or 9-13). 5. When forming groups, we shall preferably have students from the same class, with the same type of equipment, have their former grades as close as possible, and have the number of scheduled hours to be close to what the assigned students requested in that subject. Rational: Two students from the very same class are favorable to be put into the same mentoring group, as they receive the same distance education from their home school. Forming groups for students with similar strength can improve the efficiency of mentoring. Finally, the requested hours by the students in a group should be close to the scheduled hours. Regarding the equipment, if one student in a group has a laptop and another only a tablet or smartphone then the possible interactions can be limited between them and the mentor (we consider tablets and smartphones to be equally useful). Relative importance in the application: 15 Linear term: For any two students a i and a i who are both willing to accept mentoring let us introduce a binary variable z p i,i for every potential group p = (b j , s k , t), where both a i and a i could belong to, i.e., if there exist e = (a i , b j , s k ) and e = (a i , b j , s k ) The indicator variable z p i,i = 1 if both a i and a i are assigned to p in the solution. This can be achieved with the following new constraints. z p i,i ≤ y t e for every p = (b j , s k , t), e = (a i , b j , s k ) z p i,i ≤ y t e for every p = (b j , s k , t), e = (a i , b j , s k ) Furthermore let z k i,i = p:s k ∈p z p i,i , where z k i,i is the indicator variable showing whether a i and a i are in the same group for subject s k . The accumulated weight of group coherence criteria is Giving priority to certain students in needs (depending on the preferences of the mentors for some criteria, such as social status and student past performance). Rational: Social welfare can improve if the students in need receive the mentors. However, the criteria of being socially disadvantaged or being a weak student can be controversial for some mentors, so we allow them to express their willingness to get paired with such students. Relative importance in the application: 20 Implementation with weights: The combined social priority weight of e = (a i , b j , s k ), denoted by w s e , is as follows: When the same mentor-student pair can be involved in paired mentoring activities in multiple subjects then this is preferable. Rational: It can be useful if not too many different mentors supervise the same student. Relative importance in the application: 5 Linear term: We introduce a new binary variable m j i to denote whether a i is mentored by b j in any subject in a pair with the following constraints. For w e = w w e + w p e + w s e (and w g e = w e · w g ), the final objective function is: To summarise, the main objective is to maximise the volume of the mentoring activities with considering the preferences and the social priorities of the students, improving the group cohesion, and decreasing the number of mentors per students. During the first operating time of the allocation scheme (1 May to 15 June 2020), the number of students who registered at the webpage was 14, while the number of mentors was 56. Because of the low number of student's registration, we could not observe the true potential of the model and application. Therefore we decided to conduct computational experiments on partly generated data. Because of the low amount of observations, the main goal of our simulation was to test our MILP model, rather than to give accurate prediction on the performance of the scheme. However, we still tried to use the data available to get as realistic generated data as possible. We computed the correlations amongst the mentor variables, but, we only found weak correlations. Hence we generated the variables independently, by rolling a biased dice independently for each variable and observation (student and mentor). We used the available data to estimate these biases. In this section, we describe the way we generated each variable. • School-ratio: There were 14 students registered, out from 9 different schools. Therefore in the simulator, we considered the student-school ratio to at most 67%. So when we considered 100 students, we generated 67 schools, and for each student, we selected a school with replacement. • Number of subjects: The average number of subjects requested per student was 2, with four as maximum. We used the following distribution for the amount of subjects: (1: 50 %; 2: 30 %; 3: 10%; 4: 10%). • Time (q(a i ; s k )): The average time required by the students for mentoring per week in a subject was around 2 hours with a minimum of 1 and maximum of 4. We used the distribution of (1: 33%; 2: 33%; 3: 25%; 4: 9%). • Grades: For the distribution of grades, we got almost every possibility from the data, except grade 1, which means Failed in Hungary. In the simulation, we generated all types of grades uniformly with the addition of 0, where 0 means the student left the bracket blank (which was 25% of the real cases). • Group: 9 out of 14 students selected the possibility of getting mentoring in groups. Hence we set 2 3 for the probability of a student accepting group-mentoring. • Help: For the three possible values we received 5-5-4 responses, respectively. Therefore, we decided to generate these values randomly with equal probability. • Equipment: All of the participants chose 0. We left this parameter out in the simulation because it is not crucial for the optimisation model. • Year: Most of the registered students were from years 4-8 (92%), only one student was in year 11. Since the programme started at the end of the spring semester and after the matriculation exam, we assume that the secondary school students were underrepresented in the application. Therefore we generated the students' years uniformly from year 4 to 12. • Prior1 (SD i ): 13 students out of 14 chose option 0, and the last remaining student chose option 1. Therefore we generated higher ration of underprivileged students by using the (0: 65%; 1: 20%; 2: 10%; 3: 5%) distribution for this variable. Therefore, for each student, we generated the number of parents and the number of siblings independently, according to the above described statistics. • Prior3 (W S i ): In the real data, 64% of the students had 0 points, 28% had two and only one student had 3 points (no student got 1 point for this variable). We approximated the values of this variable with the Poisson distribution, where we set the expected value equal to the mean of the real data (0.786). • Prior4 (CY i ): This point depends directly on the year of the student, so it is computed accordingly. • Matriculation: This depends on the year of the student. Therefore we only considered this variable when the student was from year 11 or 12. Most students officially take the matriculation exam in year 12 in Hungary, however, there is an option to advance some exams to previous years. Hence we randomised this value for the students from year 11, by assuming that 40% of them do not want to practice for the matriculation exams (so they got the "N"-letter, meaning no matriculation), 40% going for the base exam and 20% of them selecting advanced exam. When we generated the characteristics of the mentors, we used the distributions taken from the real data. Since 56 mentors registered into the program, we have not made as many assumptions as in the case of the students. • Group: 54% of the mentors agreed to the possibility of mentoring in groups. • Time (Q(b j )): For the time capacity of the mentors, first we generated ranges with a distribution, and then we choose uniformly the exact value from the range selected. The time-range of a mentor was 1-3 hours with 40% probability, 4-6 hours with 40% probability, and 7-10 hours with 20% probability. • Social (DM j ): We used the (0: 50%; 1: 40%; 3: 10%) distribution, reflecting the real data. • Weak (GP M j ): Here 85% of the mentors chose option N, therefore we also used 85% for generating option N and 5% for each the other three options. • Student-Age (Y M j ): We used the (0: 5%; 1: 20%; 2: 15%; N: 60% (no preference given)) distribution, reflecting the real data. Overall, there were 15 different subjects offered for selection. We generated the distribution of the requested subjects according to the distribution of the subjects offered by the mentors. The assumption behind this is that the demands and the supply of the subjects shall be balanced in the long run. However, we also added a random noise to modify the distribution for every instance. Not all of the subjects are for each year. Therefore the distributions are normalised for each year with regard to the subjects available. A student can request mentoring in multiple subjects. According to the data, the maximum number of subjects requested was 4 with an average of two. As we already described, we used the (1= 50%, 2 = 30%, 3= 10%, 4 = 10%) distribution to generate the number of subjects requested by each student, and then with the consideration of the student's year, we picked the subjects randomly with a distribution that is close to distribution of the subjects offered by the mentors. The mentors can also have multiple classes. In the data, the average number of subjects per mentor was 2.9. However, the maximum number of the subjects was 9 for some mentors. Therefore some extreme values have increased the average a lot. We generated the number of subjects of each mentor with respect to their total time offered. If the mentor's total time was less than 4 hours then we generated 1-3 subjects uniformly. If the total time was less than or equal to 6, then we generated 1-4 subjects uniformly. Finally, in the case of time at least 7, we generated 1-5 subjects. Whenever we allocated a subject to a mentor, we assumed that the mentor is willing to teach students of all age in this subject. To compare the simulated data to the real data, we generated 1000 instances with the same amount of mentors (56) and students (14) as in the real data. Then we checked whether the values of the real data are within the interquartile range of the values of the generated data. Regarding the evaluation measures, only the Social -points were not inside this range with any type of objective value. This is reasonable since in the real data, we have not received enough values (see, for example, Prior 1 and 2). Therefore we adjusted the distributions. Hence the generated data got in average higher results than in reality. Also, when we considered the group-weight of 1 in the objective function, several other measures were also outside the interquartile range. The reason behind this instability is the few numbers of students in the real data. In this section first we describe how we simplified the evaluation measures by clustering them based on one-shot simulations, and then we also present the performance analyses with regard to some basic parameters. For the basic setting we generated 100 large instances with 80 students and 40 mentors in each, and we conducted a single match run for each of them. This setup differs from the real data, since the student/mentor ratio is much higher in the generated data. Our aim was to analyse the effect of using different objective functions when the programme has an ideal student/mentor ratio. Then we adjusted the main parameters to create alternative solutions, as follows. • we modify w g from 0.7 to 0.5, 0.6, 0.8, 0.9, 1 • for w g = 0.7 we modified the preference based weights from the default setting of a) w p e = (6 − rank i (s k )) + (6 − rank j (s k )) + 3 * agepref j i to b) w p e = (6 − rank i (s k )) 2 + (6 − rank j (s k )) + 3 * agepref j i , and to c) w p e = (6 − rank i (s k )) 2 + (6 − rank j (s k )) 2 + 3 * agepref j i Thus we generated five times 100 instances by varying w g and another two times 100 instances by changing the preference based weights. So altogether we considered 800 instances. The run time for solving the MILP model for these instances was relatively short, the average run time was 167 seconds with a maximum of 3 hours and 12 minutes. Besides the seven objectives given in Section 3, we considered the following five performance measures in the evaluation of solutions. 1. Number of paired mentoring hours and group mentoring hours separately. 3. Total capacity of the mentors used. We analysed how the above described five evaluation measures behave together with the seven different objective functions, that we presented earlier. However, for the evaluation of the different objective functions, we decided to reduce the dimension of the twelve measures. So, we calculated the similarities between the various measures with hierarchical clustering. All of the results were considered in the estimation. Figure 1 presents the dendrogram of the measures. We decided to reduce the dimension of the 12 measures to 6 (as the red rectangles show in Figure 1 ). We chose the six dimensions, because according to Principal component analysis, with 6 component 96% of the total information can be saved. Additional component only increased the saved information with less than 2%. According to the hierarchical clustering, we evaluated the Number students, Preference and Social measures independently from the other measures. From the Mentor capacity, Solo time, Mentor pairs and Solo number measures with using Factor analysis method, we created a factor variable. We covered 84% of the total information in this factor. We named this factor as solofactor because it is related to the measures of the non-group classes. For every measure a higher value increase the accumulated factor score. Interestingly the number of Mentor-student pairs (Objective 7) has a behavior very similar to the solo-class time and number. We created another factor for the measures of Group connection, Group time, and the Group number. We named this factor as Group-factor. We could cover 73% of the total information inside one factor. Higher Group connection value decreases the Group-factor's score, while for the other two measures higher value will increase it. Finally, from the Number Pairs Groups and Volume we created the so-called Quantity-factor. For all of these measures higher values increase the factor's score. We could cover 81% information within this factor. On the graphs of the Solo-factor and Group-factor, the influence of groupweight (w g = W G) is clearly visible. As the group-weight increases, the Soloscore decreases and the Group-score increases. The two quadratic-preference models had very similar results in these cases compared to the original WG 0.7 model, although there was a small decrease in the group-score. The Quantity factor's score increases with the group-weight. Therefore if the number of pairs and groups, or the volume is more important in the optimisation, then the usage of higher group-weights seems to be more appropriate. Group-weight also increases a bit the number of matched students. However, the best solution for this measure is when the preference of the students was considered quadratically. Naturally the Preference measure is very high for the two quadratic preference cases. However, it seems that the group-weight parameter did not have any effect on this measure. Social points appear to be very stable, the group-weight does not have much effect on the social aspect of the programme. However, the quadratic preference cases have a slightly worse result for this measure. We investigated also how the frequency of the matching runs affects the results in a dynamic setting. We considered the first 300 days of the programme, by generating a registration date for each student and mentor. We assumed that both the students and mentors joined the application uniformly random in the period considered. We also generated a leaving day for each applicant as follows. Presumably, if a student does not get any mentor within a reasonable time in this programme, then he or she may well seek mentors using other channels. We assumed that the students stay in this programme for an average of two weeks, with two days of standard deviation with the assumption of the normal distribution (but they remain at least seven days). The mentors may also leave a programme if they do not get any student soon enough after registration, however, we assumed that they are be more patient than the students. Hence they leave the programme 3 weeks after registration in average (with a minimum of two weeks). Again we used normal distribution with setting two days for the standard deviation. We also extended the stay of those students and mentors, who got matched. For any student, who was in a solution of a matching run, we added seven more days to their leaving time. We extended the staying time of the matched mentors with 14 days. Figure 3 presents the flow of a matching run. Then we calculate the optimal matching according to the policy setting and we remove the satisfied subject from the list of the demanded subjects of each selected student. For the allocated mentors, we decrease their total time offered for teaching with the allocated time. Then we increase the remaining time of stay of the allocated students and mentors, with 7 and 14 days, respectively. We considered four different frequencies for the matching-runs: 1, 2, 7 and 14 days. We evaluated 100 generated instances according to these four frequencies. In the optimisation model, we considered the Final objective function (14) with the default group-weight w g = 0.7. Since we had no access to the registration dates and duration of stays of the students and mentors, we generated two different set of instances with regard to the frequency of the arrivals. We considered instances where 1 and 4 were the average number of students joining the programme per day. Therefore, for an instance of type 1, we generated 300 students, and for an instance of type 4, we generated 1200 students for the period of 300 days. The students register into the programme uniformly at random, hence 1 and 4 students register daily on average, respectively. In each case, we assumed that the mentors arrive half as frequently as the students. Hence in instances of type 1, one mentor arrives in every two days, in instance of type 4, two mentors are expected to join the programme every day in average. Figure 4 presents the solo-groups formed in different examples. In both cases, more frequent runs resulted in more solo classes. Between the 1 and 2 daily runs, the difference is not large, however as the matching runs became less frequent, the difference is visible. Figure 5 presents the results of the number of groups formed. In both cases, less frequent runs resulted in more groups. Therefore independently from the sizes of the matching problems, more frequent runs were better with respect to paired-mentoring, and less frequent runs were better for forming more groups. How about the qualities of the solutions of each frequency? In the previous figures, we focused on the number of pairs and groups. For the quality of matchings, first we considered the Social aspect of the programme. Figure 6 presents the sum of the Social points in each type of matching runs. The Social score did not depend on the frequency of the matching runs that much when in average one student registers per day. A small decrease is noticeable as runs become less frequent in this case. However, when the average number of daily student registration is four, then the trend changes. The reason behind the change of trend is the higher number of groups. presents the volumes of optimal solutions. With fewer students, forming a group is more complicated. Hence more frequent runs have better social points, because of the solo-groups. With a larger pool, more groups can be formed, therefore we see an increase in the Volume, as well as in the Social score. As in other dynamic allocation systems with bounded length duration of stays (e.g., organ allocation) one may try to improve the solutions with a prioritisation based of waiting times. In the following part we investigate how the results change if we prioritise those students and mentors, who registered earlier to the programme. It may decrease the social-scores and the preference-scores of the matchings, but there may be less early quits from the programme and also less unmatched participants. Therefore we modified the weight of the activities, to w e = w w e +w p e +w s e +w t e , where Here t r denotes the day of the matching run, t 0 i is the registration date of the student a i and t 0 j is the registration date of the mentor b j . We also use a weight for the days passed, that we denote by W T . To test how the prioritisation by waiting time changes the solutions, we considered a 300 days period again with an average of three students registering into the programme in every day. We set 0,1,2 and 10 for the weight of the waiting time priority regarding all the match-frequencies that we investigated earlier. Figure 8 presents the Solo-groups' and groups' distributions of the results. With the increase in the weight of the waiting time priority, the number of pairs increased, but the number of groups decreased. We can observe a similar trend for each match-frequency, hence giving priority for the waiting time is good for forming more pairs. However, overall, we can notice a small decrease in the Volume, as Figure 9 presents. For WT=1 and 2 this reduction is negligible, but for WT=10 it is significant. Thus giving priority by the waiting time, we loose more mentoring time with the decreased number of groups than what we gain with more pairs. The same figure presents the change in the number of students as well. In every run-frequency, a higher WT resulted in a decrease in the number of students allocated. Figure 10 presents the Preference and Social scores. In both cases, higher WT resulted in a relapse. It is connected to the decrease in Volume since fewer mentoring hours in general means worse Preference and Social scores. Hence the prioritisation by the waiting time increase only the number of pairs and decrease many other aspects of the programme. The setback in these values is caused by the multiple demands and offers. For example, a student may have two different subjects requested. If there is a match for her first subject then she remains in the programme with her second remaining subject with an extended duration of stay, and so in a later run she may well receive a mentor for her second subject as well due to her increased priority instead of allocating a freshly registered student for her first subject. In fact, the freshly registered student can even have higher Social score, or other scores can also be better for her, but the high waiting time priority for the aforementioned student Social Figure 10 : The Preference and Social results with 0,1,2,10 weight on the waiting time overrules these scores. Thus the freshly registered student may not even get a mentor, whilst the earlier matched student will get multiple mentors. Therefore there is a setback in both match quality and somewhat also in quantity. To reduce the setback, caused by the multiple demands and offers by the members, we also investigated how the solution would change, if we only consider the extra priority on the waiting time for the first preferred subjects of the students. Figure 11 presents the results of these models, with the same setups as earlier. In the pairs and groups, the effect was similar to the earlier investigated case. The weight on the waiting time of the first subject also increased the number of pairs and decreased the number of groups. However, the change is noticeably smaller. Therefore the Volume appears to be more stable, but still has a slight reduction as the WT increases. However, the trend in the number of students changed. In this case, a higher weight on the waiting time of the first subject increased the number of students matched. Because each student has one subject with this weight, those students who have not been selected yet has a higher chance to get matched than before. Regarding the preferences, we can notice a small increase when the runs occur in every day or in every two days. However, the score decreases when the Social Figure 11 : The results with weights 0,1,2,10 for the waiting time regarding the first preferred subjects only runs happen less frequently. The reason behind the change in the trend is maybe because of the reduction in the number of groups. In general, more frequent runs resulted in more pairs and fewer number of groups. The weights for the waiting time also increased the number of pairs and reduced the possibility to form a group. More pairs with higher preferences increased the preference score, but having fewer groups decreased it. The Social score decreased for every run frequency as we increased the WT. However, the effect is much smaller compared to the case when every subject was weighted. In this paper we have described the optimisation aspect of a joint NGO project for allocating voluntary mentors to students. By taking the participants' preferences into account we aimed to create desirable pairs and study groups by using integer programming techniques for solving the dynamic allocation problem in the real application and also for generated data. We believe that the lessons learned can be useful for other countries and for similar applications. As a future work we are going to conduct a follow-up analyses on the data that we are now gathering in the Hungarian application since the latest lockdown for secondary schools in the 2020/2021 winter and spring period. Clearing algorithms for barter exchange markets: Enabling nationwide kidney exchanges Market failure in kidney exchange Equilibrium allocations under alternative waitlist designs: Evidence from deceased donor kidneys. Econometrica, forthcoming Integer programming methods for special college admissions problems Stable project allocation under distributional constraints Dynamic refugee matching Kidney exchange: an operations perspective. Working paper Improving refugee integration through data-driven algorithmic assignment Applications of matching models under preferences Building kidney exchange programmes in Europe -an overview of exchange practice and activities The hospitals/residents problem with couples: Complexity and integer programming models Matching with sizes (or scheduling with processing set restrictions) Frits Spieksma, María O. Valentín, and Ana Viana. Modelling and optimisation in european kidney exchange programmes Matching through institutions Course match: A large-scale implementation of approximate competitive equilibrium from equal incomes for combinatorial allocation Optimizing the marriage market: An application of the linear assignment model Mathematical models for stable matching problems with ties and incomplete lists College admissions and the stability of marriage Assigning papers to referees Fair online allocation of perishable goods and its application to electric vehicle charging How america's schools responded to the covid crisis An integer programming approach to the hospitals/residents problem with ties Dynamic matching in overloaded waiting lists. Available at SSRN 2967011 Algorithmics of matching under preferences Fairness in deceased organ matching The allocation of food to food banks Efficient kidney exchange: Coincidence of wants in markets with compatibility-based preferences Lending decisions with limits on capital available: The polygamous marriage problem Placement optimization in refugee resettlement We thank our colleagues, Dániel Horn and Zoltán Hermann for helping designing the application on behalf of our Institute, Dávid Burka and his company for developing the website of the application (onkentesmentoralas.hu), and our collaborators in the two partner organisations, the Hungarian Reformat Church Aid and #school. Biró and Gyetvai are supported by the Hungarian Scientific Research Fund -OTKA (no. K129086).