“…An unhappy agent located at a cell A moves to a new cell B based on a probability function, p ( B ), which depends on two factors: the distance d ( A , B ) between A and B , and the relevance r ( B ) of destination B . This probability captures the gravity law of human mobility 43 , 47 , 48 , 52 , 55 , 60 – 64 , positing that people tend to travel to nearby and relevant locations, a concept that has been supported by extensive research in fields ranging from transport planning 65 and spatial economics 62 , 66 , 67 to epidemic spreading 57 , 68 – 71 . The distance between points A and B , represented by coordinates and , is computed as their Euclidean distance on the grid, .…”