# Assigning Candidate Tutors to Modules: A Preference Adjustment Matching Algorithm (PAMA)
## 4 The Preference Adjustment Matching Algorithm (PAMA)
### The PAMA Logic
Next, t1 will be examined: t1 does not have mB as his/her highest preference; hence, the second slot of mB will be marked as pending, and the algorithm will proceed to the rest of the tutors. t3 has mB on the top of the preference list and will be bypassed; however, the next and final tutor, t4, will have to remove mB from his/her preferences, as it is sure that t4 cannot be assigned in mB. In the second round, the PAMA will start again with the examination of mA: mA will again pick t3, who is the highest-ranked remaining tutor for the module. mA remains as not the highest preferred module of t3; hence, the slot will be assumed as pending, and the algorithm will continue to the next tutor. According to the mA rankings, t1 will be examined next. Since t1 has mA as his/her 1 st preference, the algorithm will keep t1 in the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{5}{c}{**Initial State**} \\ \hline
**Modules** & & **Tutor Rankings** & & **Max Slots per Module** \\ \hline mA & t3 & t1 & t4 & t2 & 1 \\ mB & t2 & t1 & t3 & t4 & 2 \\ \hline
**Tutors** & & & **Preferences** & & \\ \hline t1 & mA & mB & & & \\ t2 & mA & mB & & & \\ t3 & mB & mA & & & \\ t4 & mB & mA & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Instances of the tutors’ rankings in the modules and the tutors’ preferences at the initial state. \begin{table}
\begin{tabular}{c c c c c c c c c c c c c c c} \hline \hline \multicolumn{1}{c}{**Turn 1 After mA Parsing**} & \multicolumn{5}{c}{**Turn 1 After mB Parsing**} & \multicolumn{5}{c}{**Turn 2 After mA Parsing**} \\ \hline
**Modules** & & \multicolumn{2}{c}{**Tutor Rankings**} & \multicolumn{2}{c}{**Modules**} & \multicolumn{2}{c}{**Tutor Rankings**} & \multicolumn{2}{c}{**Modules**} & \multicolumn{2}{c}{**Tutor Rankings**} \\ \hline mA & t3 & t1 & t4 & t2 & mA & t3 & t1 & t4 & t2 & mA & t3 & t1 & t4 & t2 \\ mB & t2 & t3 & t1 & t4 & mB & **t2** & **t3** & t1 & t4 & mB & **t2** & **t3** & t1 & t4 \\ \hline
**Tutors** & & & **Preferences** & & & & & & & & & & & & & & \\ \hline t1 & mA & mB & & t1 & mA & mB & & & t1 & mA & mB & & & \\ t2 & mA & mB & & t2 & mA & mB & & t2 & mA & mB & & & \\ t3 & mB & mA & & t3 & mB & mA & & t3 & mB & mA & & \\ t4 & mB & mA & & t4 & mB & mA & & t4 & mB & mA & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Instances of the tutors’ rankings in the modules and the tutors’ preferences during the execution of each round. ranking list. Next, the algorithm will examine mB: [PERSON] will first pick t1: t1 does not have mB on top of his/her preferences; hence, the second slot of mB will be marked as pending and the algorithm will proceed to the rest of the tutors. t3 has mB on top of the preference list and will be kept. Obviously, in the second round, after the iteration of all modules, no change in rankings or preferences will occur. At this point, the algorithm will detect a deadlock, since there are modules with free slots and remaining candidates at the same time. Then, a deadlock handler according to the preferable policy will be invoked. If, for example, we decide to give priority to rankings, then the execution of the handler will examine mA and will forcibly assign t3 to mA. Then, the iteration will break, and the algorithm will execute a next round in which mA will be already completed and [PERSON] will choose t1, as t1 will have now mB as his/her first preference. On the other hand, if we decide to give priority to tutors' preferences, then the execution of the handler will pick t3 for examination concerning mA but will not match them. t3 will be assigned to his/her first preference module (mB), and next, the iteration will break. The algorithm will execute the next round, in which mA will finally choose t1. ## 5 PAMA's Real Case Implementation and Evaluation

The implementation and execution of the above algorithm took place in the environment of HOU University, where 3982 candidate tutors competed for 1906 positions across 620 modules.