This example treats the input graph as a weighted, directed network (WDN).
Input
Input tables are from LocalClusteringCoefficient Example 1: WUN:
- edges: trade
- vertices: country
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.40000 | 0.20000 | 0.50000 | 0.33333 | 0.33333 | 0.17901 | 0.07268 | 0.17100 | 0.17967 | 0.14881 |
2 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1.00000 | 1.00000 | 0.00000 | 0.00000 | 1.00000 | 0.43089 | 0.58480 | 0.00000 | 0.00000 | 0.50785 |
3 | 2 | 3 | 1 | 2 | 1 | 1 | 2 | 6 | 0.40000 | 0.20000 | 0.50000 | 0.33333 | 0.33333 | 0.17901 | 0.09865 | 0.29240 | 0.11757 | 0.14881 |
4 | 2 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 0.00000 | 0.00000 | 1.00000 | 0.00000 | 1.00000 | 0.00000 | 0.00000 | 0.42833 | 0.00000 | 0.42833 |
5 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 1.00000 | 1.00000 | 0.00000 | 0.00000 | 1.00000 | 0.46416 | 0.34200 | 0.00000 | 0.00000 | 0.40308 |