This example treats the input graph as a weighted, directed network (WDN).
SQL Call
SELECT * FROM LocalClusteringCoefficient ( ON trade AS Edges PARTITION BY fromid ON country AS Vertices PARTITION BY countryid USING TargetKey ('toid') EdgeWeight ('tradeweight') Directed ('t') Accumulate ('countryid') ) AS dt ORDER BY countryid;
Output
countryid in_degree out_degree bi_degree cyc_tri_cnt mid_tri_cnt in_tri_cnt out_tri_cnt tri_cnt cyc_cc mid_cc in_cc out_cc avg_cc w_cyc_cc w_mid_cc w_in_cc w_out_cc w_avg_cc --------- --------- ---------- --------- ----------- ----------- ---------- ----------- ------- ------ ------ ----- ------- ------- -------- -------- ------- -------- -------- 1 2 3 1 2 1 1 2 6 0.4 0.2 0.5 0.33333 0.33333 0.17901 0.07268 0.171 0.17967 0.14881 2 1 1 0 1 1 0 0 2 1 1 0 0 1 0.43089 0.5848 0 0 0.50785 3 2 3 1 2 1 1 2 6 0.4 0.2 0.5 0.33333 0.33333 0.17901 0.09865 0.2924 0.11757 0.14881 4 2 0 0 0 0 2 0 2 0 0 1 0 1 0 0 0.42833 0 0.42833 5 1 1 0 1 1 0 0 2 1 1 0 0 1 0.46416 0.342 0 0 0.40308
Download a zip file of all examples and a SQL script file that creates their input tables.