Calculating Distance between 2 User's address and . If distance between them is less than 20 by foot . Assign X .If distance is greater than 20 assign Y. Note: If user 4 comes we need to compare user 4 address to user 1 ,2,3 . like
4 -1 | 4 - 2 | 4 - 3
among these comparisons,(4-1) if distance is less than 20 then assign same person assigned to 1. among these comparisons,(4-2) if distance is greater than 20 then assign New person