Efficient and Effective Pair-Matching Algorithms for Agent-Based Models

Nathan Geffen, Stefan Scholz
2017 Journal of Artificial Societies and Social Simulation  
Microsimulations and agent-based models across various disciplines need to match agents into relationships. Some of these models need to repeatedly match di erent pairs of agents, for example microsimulations of sexually transmitted infection epidemics. We describe the requirements for pair-matching in these types of microsimulations, and present several pair-matching algorithms: Brute force (BFPM), Random (RPM), Random k (RKPM), Weighted shu le (WSPM), Cluster shu le (CSPM), and Distribution
more » ... and Distribution counting (DCPM). Using two microsimulations, we empirically compare the speeds, and pairing quality of these six algorithms. For models which execute pair-matching many thousands or millions of times, BFPM is not usually a practical option because it is slow. On the other hand RPM is fast but chooses poor quality pairs. Nevertheless both algorithms are used, sometimes implicitly, in many models. Here we use them as yardsticks for upper and lower bounds for speed and quality. In these tests CSPM o ers the best trade-o of speed and e ectiveness. In general, CSPM is fast and produces stochastic, high quality pair-matches, which are o en desirable characteristics for pairmatching in discrete time step microsimulations. Moreover it is a simple algorithm that can be easily adapted for the specific needs of a particular domain. However, for some models, RKPM or DCPM would be as fast as CSPM with matches of similar quality. We discuss the circumstances under which this would happen.
doi:10.18564/jasss.3485 fatcat:kypz7pll5nhi5meznlgthjarxe