From 6976f713894436b0926eea50b5823c25a7ef65c5 Mon Sep 17 00:00:00 2001 From: katinar Date: Wed, 13 Mar 2024 15:27:22 -0400 Subject: [PATCH] GML-1754 remove duplicate files --- .../topological_link_prediction/adamic_adar | 78 ------------------- .../resource_allocation | 77 ------------------ 2 files changed, 155 deletions(-) delete mode 100644 GDBMS_ALGO/topological_link_prediction/adamic_adar delete mode 100644 GDBMS_ALGO/topological_link_prediction/resource_allocation diff --git a/GDBMS_ALGO/topological_link_prediction/adamic_adar b/GDBMS_ALGO/topological_link_prediction/adamic_adar deleted file mode 100644 index 3008e3d3..00000000 --- a/GDBMS_ALGO/topological_link_prediction/adamic_adar +++ /dev/null @@ -1,78 +0,0 @@ -CREATE TEMPLATE QUERY GDBMS_ALGO.topological_link_prediction.adamic_adar(VERTEX v_source, VERTEX v_target, SET e_type_set, BOOL print_results = TRUE) SYNTAX V1 { - - /* - First Author: - First Commit Date: - - Recent Author: - Recent Commit Date: - - - Repository: - https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Topological%20Link%20Prediction - - Maturity: - production - - Description: - This query calculates the Adamic Adar value between two vertices. - The higher the number, the closer two vertices are. A 0 value indicates two vertices are not close. - - Formula of caluclation is found here: https://en.wikipedia.org/wiki/Adamic/Adar_index - - Publications: - NA - - TigerGraph Documentation: - https://docs.tigergraph.com/graph-ml/current/link-prediction/adamic-adar - - Parameters: - v_source: - Input vertex one - v_target: - Input vertex two - e_type_set: - edge types to traverse. If all edge types are desired, pass in "ALL" to the set. - print_results: - if True, print result (True by default) - */ - - SumAccum @sum_num_neighbors; - SumAccum @@sum_closeness; - avs = {v_source}; - bvs = {v_target}; - - # See if user specified edge types to traverse - IF "ALL" NOT IN e_type_set THEN - na = SELECT n - FROM avs -(e_type_set)- :n; # Get vertex A's neighbors - - nb = SELECT n - FROM bvs -(e_type_set)- :n; # Get vertex B's neighbors - - u = na INTERSECT nb; # Get neighbors in common - tmp = SELECT p - FROM u:p -(e_type_set)- :r - ACCUM p.@sum_num_neighbors += 1; # count number of neighbors of in-common vertices - - ELSE # Traverse all edge types - na = SELECT n - FROM avs -()- :n; # Get vertex A's neighbors - - nb = SELECT n - FROM bvs -()- :n; # Get vertex B's neighbors - - u = na INTERSECT nb; # Get neighbors in common - tmp = SELECT p - FROM u:p -()- :r - ACCUM p.@sum_num_neighbors += 1; # count number of neighbors of in-common vertices - END; - - res = SELECT p - FROM tmp:p - ACCUM @@sum_closeness += 1/log10(p.@sum_num_neighbors); # calculates closeness measure - - IF print_results THEN - PRINT @@sum_closeness; - END; -} diff --git a/GDBMS_ALGO/topological_link_prediction/resource_allocation b/GDBMS_ALGO/topological_link_prediction/resource_allocation deleted file mode 100644 index 668b2b28..00000000 --- a/GDBMS_ALGO/topological_link_prediction/resource_allocation +++ /dev/null @@ -1,77 +0,0 @@ -CREATE TEMPLATE QUERY GDBMS_ALGO.topological_link_prediction.resource_allocation(VERTEX v_source, VERTEX v_target, SET e_type_set, BOOL print_results = TRUE) SYNTAX V1 { - - /* - First Author: - First Commit Date: - - Recent Author: - Recent Commit Date: - - - Repository: - https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Topological%20Link%20Prediction - - Maturity: - production - - Description: - This query calculates the resource allocation value between two vertices. - The higher the number, the closer two vertices are. A 0 value indicates two vertices are not close. - - Publications: - https://arxiv.org/abs/0901.0553 - - TigerGraph Documentation: - https://docs.tigergraph.com/graph-ml/current/link-prediction/resource-allocation - - Parameters: - v_source: - Input vertex one - v_target: - Input vertex two - e_type_set: - edge types to traverse. If all edge types are desired, pass in "ALL" to the set. - print_results: - if True, print result (True by default) - */ - - SumAccum @sum_num_neighbors; - SumAccum @@sum_closeness; - avs = {v_source}; - bvs = {v_target}; - - # See if user specified edge types to traverse - IF "ALL" NOT IN e_type_set THEN - # Get Neighbors in Common - na = SELECT n - FROM avs -(e_type_set)- :n; # Get vertex A's neighbors - - nb = SELECT n - FROM bvs -(e_type_set)- :n; # Get vertex B's neighbors - - u = na INTERSECT nb; # Get neighbors in common - # count number of neighbors of in-common vertices - tmp = SELECT p - FROM u:p -(e_type_set)- :r - ACCUM p.@sum_num_neighbors += 1; - - ELSE # traverse all edge types - na = SELECT n - FROM avs -()- :n; # Get vertex A's neighbors - - nb = SELECT n - FROM bvs -()- :n; # Get vertex B's neighbors - - u = na INTERSECT nb; # Get neighbors in common - tmp = SELECT p - FROM u:p -()- :r - ACCUM p.@sum_num_neighbors += 1; # count number of neighbors of in-common vertices - END; - res = SELECT p - FROM tmp:p - ACCUM @@sum_closeness += 1/p.@sum_num_neighbors; # calculates closeness measure - - IF print_results THEN - PRINT @@sum_closeness; - END; -}