1 def pairwiseDistance(_n1
,_n2
):
2 _p1
= _n1
.dijkstraShortestPath(org
)
3 _p2
= _n2
.dijkstraShortestPath(org
)
6 while (_p1
[0] == _p2
[0]):
9 if ((len(_p1
) == 0) or (len(_p2
) == 0)):
11 return len(_p1
) + len(_p2
)
13 def findAverage(_grp
):
16 for i
in range(0,len(_grp
)):
17 for j
in range(i
+1,len(_grp
)):
18 sum = sum + pairwiseDistance(_grp
[i
],_grp
[j
])
22 gps
= (version
!= '0').groupAndSortBy(gp
)
25 print str(z
[0].gp
) + " " + str(avg
)