1.0 - 8.00 - Closeness Example 1: Unweighted, Unbounded Graph - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

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