5.4 An IP model for strong stability in SPA ST
5.5.2 Correctness Testing
To test the correctness of our algorithm’s implementation, we implemented (i) a brute-force algorithm that finds all the strongly stable matchings (if any) in a givenSPA-STinstance, and
(ii) our IP model for SPA-STunder strong stability using the Gurobi optimisation solver in Python. We then proceeded as follows.
(i) We randomly generated 100, 000SPA-STinstances, each consisting of 15 students, 10 projects, 5 lecturers, and total project capacity of 18. The capacity for each project and lecturer was obtained as explained above. Also, the length of each student’s preference list was fixed at 3, with tie density of 0.1 in the students’ and lecturers’ preference lists. For each instance, we verified consistency between the outcomes of our implementa- tion of Algorithm SPA-ST-strong and our brute-force implementation in terms of the existence or otherwise of a strongly stable matching. The outcomes of the two imple- mentations were consistent in 100% of the randomly-generated instances. Further, we observed that 45% of the instances admitted a strongly stable matching.
(ii) We randomly generated 10, 000SPA-STinstances, each consisting of 100 students, 50
projects, 20 lecturers, and total project capacity of 120. Again, the capacity of each project and lecturer was as described above. Also, the length of each student’s pref- erence list was fixed at 10, with tie density td ∈ {0.05, 0.1} in both the students’ and lecturers’ preference lists. Similar to above, we verified consistency between the out- comes of our implementation of Algorithm SPA-ST-strong and our implementation of the IP-based algorithm in terms of the existence or otherwise of a strongly stable matching. Again, the outcomes of the two implementations were consistent in 100% of the randomly-generated instances. Moreover, with td= 0.1, we observed that 4% of the instances admitted a strongly stable matching, and with td = 0.05, approximately 20% of the instances admitted a strongly stable matching.
5.5.3
Experimental results
We note that the setup for the next two experiments is similar to that of Experiments 1 and 2 in the super-stability setting. For completeness, we recall them in what follows.
Experiment 1
We examined the existence of strongly stable matchings as we varied the length of the stu- dents’ preference lists for various values of x (5 ≤ x ≤ 50) in increments of 5. For each x, we increased the number of students n1 (100 ≤ n1 ≤ 1000) in increments of 100 while maintaining a constant ratio of projects, lecturers, project capacities and lecturer capacities as described above. Also, we set tds = tdl = 0.005, and with each of these parameters,
we randomly generated 1000 instances. With this setup, we observed that the proportion of instances that admitted a strongly stable matching is exactly the same as the proportion of instances that admitted a super-stable matching (see Figure 4.6). We give a potential justification for why we observed this consistency in what follows. As highlighted in the super-stability case, for a given dataset, 1 out of 5 students has a single tie of length 2 in her preference list, and this holds similarly for the lecturers. Thus, the ties in the preference lists are so sparse that any blocking pair for the super-stability type is bound to be a blocking pair for the strong stability type as well.
We also recorded the time taken for our algorithm’s implementation to terminate (see Table 5.1). For an instance size of 1000 and preference list length 50, the implementation termi- nates in less than 1.5 seconds, which is three times slower than what we recorded in the super-stability case. This is not surprising since the complexity of the super-stability algo- rithm is O(L) time, while that of the strong stability algorithm is O(m2) time, where L is
5.5. Empirical evaluation 131
the total length of all the preference lists and m is the total length of the students’ preference lists.
Table 5.1: Time (in seconds) for our algorithm’s implementation to terminate averaged over 1000 for each instance size, with the length of the students’ preference lists fixed at 50.
n1 100 200 300 400 500 600 700 800 900 1000 Time 0.042 0.106 0.187 0.286 0.402 0.543 0.703 0.890 1.094 1.330
Experiment 2
Here, we investigated the existence of strongly stable matchings as we varied the tie density in the students’ preference lists tds (0 ≤ tds ≤ 0.05) and the tie density in the lecturers’ pref-
erence lists tdl (0 ≤ tdl ≤ 0.05), both in increments of 0.005. For each pair of tie densities
in tds × tdl, we increased the number of students n1 (100 ≤ n1 ≤ 1000) in increments of
100, and we maintained the same ratio of projects, lecturers, project capacities and lecturer capacities as in Experiment 1. Also, we fixed the length of each student’s preference list at 50. With each of these parameters, we randomly-generated 1000SPA-STinstances.
Again, the results we observed with this setup is exactly the same as those observed in the super-stability setting (see Figure 4.7): i.e., with n1 = 1000, tds = 0 and tdl = 0.05,
74% of the randomly-generated instances admitted a strongly stable matching; however, with n1 = 1000, tds = 0.005 and tdl = 0, only about 5% of the 1000 randomly-generated
instances admitted a strongly stable matching. Considering that when ties are on one side of the preference lists only, the definition of super-stability and strong stability coincides, it is not surprising that the experimental results also agree with this. On the other hand, when we varied the tie density on both sides, there was little (0.1% increase) to no difference between the proportion of instances that admitted strongly stable matchings and those that admitted super-stable matchings. Perhaps, a small instance size, a small preference list length, and an increase in tie density in both the students’ and lecturers’ preference lists will lead to an increase in the proportion of instances that admit a strongly stable matching but no super- stable matching? We explore this further in the next experiment.
Experiment 3
Considering the consistency of the results obtained in Experiments 1 and 2 with those ob- served in the super-stability experiments, we decided to compare the proportion of instances that admit super-stable and/or strongly stable matchings for various values of n1 (10 ≤ n1 ≤ 50) in increments of 10, with the length of each student’s preference list fixed at 5. The
ratio of projects, lecturers, project capacities and lecturer capacities was obtained as in the previous experiments. We varied the tie density in the students’ preference lists tds (0.025 ≤
tds ≤ 0.15) and the tie density in the lecturers’ preference lists tdl (0.025 ≤ tdl ≤ 0.25), both
in increments of 0.025. With each of these parameters, we randomly-generated 1000SPA-ST
instances. The result displayed in Figure 5.13 shows some slight increase in the proportion of instances that admit a strongly stable matching but no super-stable matching.