Input
Input tables are from AllPairsShortestPath Example 1: Unweighted, Unbounded Graph:
- vertices: callers
- edges: calls
SQL Call
SELECT * FROM Closeness ( ON callers AS vertices PARTITION BY callerid ON calls AS edges PARTITION BY callerfrom USING TargetKey ('callerto') EdgeWeight ('calls') MaxDistance (12) Accumulate ('callerid', 'callername') ) AS dt ORDER BY callerid;
Output
callerid | callername | inv_sum_dist | inv_avg_dist | sum_inv_dist | kdegree |
---|---|---|---|---|---|
1 | John | 0.05 | 0.2 | 1.13333333333333 | 4 |
2 | Carla | 0.0555555555555556 | 0.111111111111111 | 0.233766233766234 | 2 |
3 | Simon | 1 | 1 | 1 | 1 |
4 | Celine | 0.25 | 0.25 | 0.25 | 1 |
5 | Winston | 0.1 | 0.1 | 0.1 | 1 |
6 | Diana | 0 |