For each person, it is required to keep the number of unique interactions. For that, we can use a two dimensional matrix or standard libraries to keep track of the unique interactions for each of the users. Some extra care needs to be taken if same pairs are given more than once.