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') MaxDistance (-1) Accumulate ('callerid', 'callername') ) AS dt ORDER BY callerid;
Output
Because callerid 6 (Diana) has no outbound calls, the k-degree is 0.
callerid | callername | inv_sum_dist | inv_avg_dist | sum_inv_dist | kdegree |
---|---|---|---|---|---|
1 | John | 0.25 | 1 | 4 | 4 |
2 | Carla | 0.5 | 1 | 2 | 2 |
3 | Simon | 1 | 1 | 1 | 1 |
4 | Celine | 1 | 1 | 1 | 1 |
5 | Winston | 1 | 1 | 1 | 1 |
6 | Diana | 0 |