diff --git a/GDBMS_ALGO/centrality/degree_cent.gsql b/GDBMS_ALGO/centrality/degree_cent.gsql index a12b84a3..c048d177 100644 --- a/GDBMS_ALGO/centrality/degree_cent.gsql +++ b/GDBMS_ALGO/centrality/degree_cent.gsql @@ -1,70 +1,72 @@ CREATE TEMPLATE QUERY GDBMS_ALGO.centrality.degree_cent(SET v_type_set, SET e_type_set, SET reverse_e_type_set, BOOL in_degree = TRUE, BOOL out_degree = TRUE, - INT top_k=100, BOOL print_results = TRUE, STRING result_attribute = "",STRING file_path = "") SYNTAX V1 { - + INT top_k=100, BOOL print_results = TRUE, STRING result_attribute = "",STRING file_path = "", BOOL normalize = TRUE) SYNTAX V1 { /* - First Author: - First Commit Date: - - Recent Author: - Recent Commit Date: + First Author: + First Commit Date: + Recent Author: Rob Rossmiller + Recent Commit Date: 05/2024 - Repository: - https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Centrality - Maturity: - Production + Repository: + https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Centrality - Description: - Compute degree Centrality for each VERTEX. - for undirected graph, you only need to set e_type_set and indegree + Maturity: + Production - Publications: - NA + Description: + Compute degree Centrality for each VERTEX. + for undirected graph, you only need to set e_type_set and indegree - TigerGraph Documentation: - https://docs.tigergraph.com/graph-ml/current/centrality-algorithms/degree-centrality + Publications: + NA - Parameters: - v_type_set: - vertex types to traverse - e_type_set: - edge types to traverse - reverse_e_type_set: - for indegree use - in_degree: - If True, count incoming relationships - out_degree: - If True, count outcoming relationships - top_k: - report only this many top scores - print_results: - If True, print the result - result_attribute: - attribute to write result to - file_path: - file to write CSV output to + TigerGraph Documentation: + https://docs.tigergraph.com/graph-ml/current/centrality-algorithms/degree-centrality + Parameters: + v_type_set: + vertex types to traverse + e_type_set: + edge types to traverse + reverse_e_type_set: + for indegree use + in_degree: + If True, count incoming relationships + out_degree: + If True, count outcoming relationships + top_k: + report only this many top scores + print_results: + If True, print the result + result_attribute: + attribute to write result to + file_path: + file to write CSV output to + normailize: + If True, return the normalized centrality. Default: True */ TYPEDEF TUPLE Vertex_Score; HeapAccum(top_k, score DESC) @@top_scores_heap; - SumAccum @sum_degree_score; + SumAccum @sum_degree_score; FILE f (file_path); all = {v_type_set}; sll = SELECT s FROM all:s - ACCUM IF in_degree THEN - FOREACH edge_type in reverse_e_type_set DO - s.@sum_degree_score+=s.outdegree(edge_type) - END - END, - IF out_degree THEN - FOREACH edge_type in e_type_set DO - s.@sum_degree_score+=s.outdegree(edge_type) - END - END; + ACCUM + IF in_degree THEN + s.@sum_degree_score += s.outdegree(reverse_e_type_set) + END, + IF out_degree THEN + s.@sum_degree_score += s.outdegree(e_type_set) + END + POST-ACCUM + IF normalize THEN + s.@sum_degree_score = s.@sum_degree_score / (all.size() - 1) + END; + #Output IF file_path != "" THEN f.println("Vertex_ID", "Degree"); diff --git a/algorithms/Centrality/degree/unweighted/tg_degree_cent.gsql b/algorithms/Centrality/degree/unweighted/tg_degree_cent.gsql index e3efb225..fffd3f06 100644 --- a/algorithms/Centrality/degree/unweighted/tg_degree_cent.gsql +++ b/algorithms/Centrality/degree/unweighted/tg_degree_cent.gsql @@ -1,70 +1,71 @@ -CREATE QUERY tg_degree_cent(SET v_type_set, SET e_type_set, SET reverse_e_type_set, BOOL in_degree = TRUE, BOOL out_degree = TRUE, - INT top_k=100, BOOL print_results = TRUE, STRING result_attribute = "",STRING file_path = "") SYNTAX V1 { - +CREATE QUERY tg_degree_cent(SET v_type_set, SET e_type_set, SET reverse_e_type_set, BOOL in_degree = TRUE, BOOL out_degree = TRUE, INT top_k=100, BOOL print_results = TRUE, STRING result_attribute = "",STRING file_path = "", BOOL normalize = TRUE) SYNTAX V1 { /* - First Author: - First Commit Date: - - Recent Author: - Recent Commit Date: + First Author: + First Commit Date: + Recent Author: Rob Rossmiller + Recent Commit Date: 05/2024 - Repository: - https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Centrality - Maturity: - Production + Repository: + https://github.com/tigergraph/gsql-graph-algorithms/tree/master/algorithms/Centrality - Description: - Compute degree Centrality for each VERTEX. - for undirected graph, you only need to set e_type_set and indegree + Maturity: + Production - Publications: - NA + Description: + Compute degree Centrality for each VERTEX. + for undirected graph, you only need to set e_type_set and indegree - TigerGraph Documentation: - https://docs.tigergraph.com/graph-ml/current/centrality-algorithms/degree-centrality + Publications: + NA - Parameters: - v_type_set: - vertex types to traverse - e_type_set: - edge types to traverse - reverse_e_type_set: - for indegree use - in_degree: - If True, count incoming relationships - out_degree: - If True, count outcoming relationships - top_k: - report only this many top scores - print_results: - If True, print the result - result_attribute: - attribute to write result to - file_path: - file to write CSV output to + TigerGraph Documentation: + https://docs.tigergraph.com/graph-ml/current/centrality-algorithms/degree-centrality + Parameters: + v_type_set: + vertex types to traverse + e_type_set: + edge types to traverse + reverse_e_type_set: + for indegree use + in_degree: + If True, count incoming relationships + out_degree: + If True, count outcoming relationships + top_k: + report only this many top scores + print_results: + If True, print the result + result_attribute: + attribute to write result to + file_path: + file to write CSV output to + normailize: + If True, return the normalized centrality. Default: True */ TYPEDEF TUPLE Vertex_Score; HeapAccum(top_k, score DESC) @@top_scores_heap; - SumAccum @sum_degree_score; + SumAccum @sum_degree_score; FILE f (file_path); all = {v_type_set}; sll = SELECT s FROM all:s - ACCUM IF in_degree THEN - FOREACH edge_type in reverse_e_type_set DO - s.@sum_degree_score+=s.outdegree(edge_type) - END - END, - IF out_degree THEN - FOREACH edge_type in e_type_set DO - s.@sum_degree_score+=s.outdegree(edge_type) - END - END; + ACCUM + IF in_degree THEN + s.@sum_degree_score += s.outdegree(reverse_e_type_set) + END, + IF out_degree THEN + s.@sum_degree_score += s.outdegree(e_type_set) + END + POST-ACCUM + IF normalize THEN + s.@sum_degree_score = s.@sum_degree_score / (all.size() - 1) + END; + #Output IF file_path != "" THEN f.println("Vertex_ID", "Degree"); diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..a1f8abc2 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,6 @@ +# Algorithm Testing + +[networkX](https://networkx.org/documentation/stable/reference/index.html) is used as +the baseline for our tests where we can. + +A peculiarity to note about nx is that it counts self edges in undirected graphs as two separate edges. So, you'll see that some baselines use a modified version of the code that is found within nx. Take `run_degree_baseline_complete`, which generates the baseline for degree centrality on complete graphs. It uses the same code that can be found in `nx.centrality.degree_centrality` with the exception of subtracting a node's degree by one. diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Empty.json b/tests/data/baseline/centrality/article_rank/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Empty.json rename to tests/data/baseline/centrality/article_rank/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Hub_Spoke.json b/tests/data/baseline/centrality/article_rank/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Hub_Spoke.json rename to tests/data/baseline/centrality/article_rank/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/article_rank/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Hub_Spoke_Directed.json rename to tests/data/baseline/centrality/article_rank/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Line.json b/tests/data/baseline/centrality/article_rank/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Line.json rename to tests/data/baseline/centrality/article_rank/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Line_Directed.json b/tests/data/baseline/centrality/article_rank/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Line_Directed.json rename to tests/data/baseline/centrality/article_rank/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Ring.json b/tests/data/baseline/centrality/article_rank/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Ring.json rename to tests/data/baseline/centrality/article_rank/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Ring_Directed.json b/tests/data/baseline/centrality/article_rank/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Ring_Directed.json rename to tests/data/baseline/centrality/article_rank/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Tree.json b/tests/data/baseline/centrality/article_rank/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Tree.json rename to tests/data/baseline/centrality/article_rank/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Tree_Directed.json b/tests/data/baseline/centrality/article_rank/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/article_rank/Tree_Directed.json rename to tests/data/baseline/centrality/article_rank/Tree_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Empty.json b/tests/data/baseline/centrality/closeness_centrality/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Empty.json rename to tests/data/baseline/centrality/closeness_centrality/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Hub_Spoke.json b/tests/data/baseline/centrality/closeness_centrality/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Hub_Spoke.json rename to tests/data/baseline/centrality/closeness_centrality/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/closeness_centrality/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Hub_Spoke_Directed.json rename to tests/data/baseline/centrality/closeness_centrality/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Line.json b/tests/data/baseline/centrality/closeness_centrality/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Line.json rename to tests/data/baseline/centrality/closeness_centrality/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Line_Directed.json b/tests/data/baseline/centrality/closeness_centrality/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Line_Directed.json rename to tests/data/baseline/centrality/closeness_centrality/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Ring.json b/tests/data/baseline/centrality/closeness_centrality/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Ring.json rename to tests/data/baseline/centrality/closeness_centrality/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Ring_Directed.json b/tests/data/baseline/centrality/closeness_centrality/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Ring_Directed.json rename to tests/data/baseline/centrality/closeness_centrality/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Tree.json b/tests/data/baseline/centrality/closeness_centrality/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Tree.json rename to tests/data/baseline/centrality/closeness_centrality/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Tree_Directed.json b/tests/data/baseline/centrality/closeness_centrality/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/Tree_Directed.json rename to tests/data/baseline/centrality/closeness_centrality/Tree_Directed.json diff --git a/tests/data/baseline/centrality/degree_centrality/Complete.json b/tests/data/baseline/centrality/degree_centrality/Complete.json new file mode 100644 index 00000000..98255ee1 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/Complete.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 1.1428571428571428}, {"Vertex_ID": "B", "score": 1.1428571428571428}, {"Vertex_ID": "C", "score": 1.1428571428571428}, {"Vertex_ID": "D", "score": 1.1428571428571428}, {"Vertex_ID": "E", "score": 1.1428571428571428}, {"Vertex_ID": "F", "score": 1.1428571428571428}, {"Vertex_ID": "G", "score": 1.1428571428571428}, {"Vertex_ID": "H", "score": 1.1428571428571428}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Empty.json b/tests/data/baseline/centrality/degree_centrality/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Empty.json rename to tests/data/baseline/centrality/degree_centrality/Empty.json diff --git a/tests/data/baseline/centrality/degree_centrality/Hub_Spoke.json b/tests/data/baseline/centrality/degree_centrality/Hub_Spoke.json new file mode 100644 index 00000000..b97010da --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/Hub_Spoke.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 1.0}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/Line.json b/tests/data/baseline/centrality/degree_centrality/Line.json new file mode 100644 index 00000000..70ee11a4 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/Line.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.05263157894736842}, {"Vertex_ID": "B", "score": 0.10526315789473684}, {"Vertex_ID": "C", "score": 0.10526315789473684}, {"Vertex_ID": "D", "score": 0.10526315789473684}, {"Vertex_ID": "E", "score": 0.10526315789473684}, {"Vertex_ID": "F", "score": 0.10526315789473684}, {"Vertex_ID": "G", "score": 0.10526315789473684}, {"Vertex_ID": "H", "score": 0.10526315789473684}, {"Vertex_ID": "I", "score": 0.10526315789473684}, {"Vertex_ID": "J", "score": 0.10526315789473684}, {"Vertex_ID": "K", "score": 0.10526315789473684}, {"Vertex_ID": "L", "score": 0.10526315789473684}, {"Vertex_ID": "M", "score": 0.10526315789473684}, {"Vertex_ID": "N", "score": 0.10526315789473684}, {"Vertex_ID": "O", "score": 0.10526315789473684}, {"Vertex_ID": "P", "score": 0.10526315789473684}, {"Vertex_ID": "Q", "score": 0.10526315789473684}, {"Vertex_ID": "R", "score": 0.10526315789473684}, {"Vertex_ID": "S", "score": 0.10526315789473684}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/Ring.json b/tests/data/baseline/centrality/degree_centrality/Ring.json new file mode 100644 index 00000000..1f77b5bc --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/Ring.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.10526315789473684}, {"Vertex_ID": "B", "score": 0.10526315789473684}, {"Vertex_ID": "C", "score": 0.10526315789473684}, {"Vertex_ID": "D", "score": 0.10526315789473684}, {"Vertex_ID": "E", "score": 0.10526315789473684}, {"Vertex_ID": "F", "score": 0.10526315789473684}, {"Vertex_ID": "G", "score": 0.10526315789473684}, {"Vertex_ID": "H", "score": 0.10526315789473684}, {"Vertex_ID": "I", "score": 0.10526315789473684}, {"Vertex_ID": "J", "score": 0.10526315789473684}, {"Vertex_ID": "K", "score": 0.10526315789473684}, {"Vertex_ID": "L", "score": 0.10526315789473684}, {"Vertex_ID": "M", "score": 0.10526315789473684}, {"Vertex_ID": "N", "score": 0.10526315789473684}, {"Vertex_ID": "O", "score": 0.10526315789473684}, {"Vertex_ID": "P", "score": 0.10526315789473684}, {"Vertex_ID": "Q", "score": 0.10526315789473684}, {"Vertex_ID": "R", "score": 0.10526315789473684}, {"Vertex_ID": "S", "score": 0.10526315789473684}, {"Vertex_ID": "T", "score": 0.10526315789473684}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/Tree.json b/tests/data/baseline/centrality/degree_centrality/Tree.json new file mode 100644 index 00000000..51cb839d --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/Tree.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.10526315789473684}, {"Vertex_ID": "B", "score": 0.15789473684210525}, {"Vertex_ID": "C", "score": 0.15789473684210525}, {"Vertex_ID": "D", "score": 0.15789473684210525}, {"Vertex_ID": "E", "score": 0.15789473684210525}, {"Vertex_ID": "F", "score": 0.15789473684210525}, {"Vertex_ID": "G", "score": 0.15789473684210525}, {"Vertex_ID": "H", "score": 0.15789473684210525}, {"Vertex_ID": "I", "score": 0.15789473684210525}, {"Vertex_ID": "J", "score": 0.10526315789473684}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json new file mode 100644 index 00000000..365279a3 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.0}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/in_degree/Line_Directed.json b/tests/data/baseline/centrality/degree_centrality/in_degree/Line_Directed.json new file mode 100644 index 00000000..365279a3 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/in_degree/Line_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.0}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/in_degree/Ring_Directed.json b/tests/data/baseline/centrality/degree_centrality/in_degree/Ring_Directed.json new file mode 100644 index 00000000..62ccb50c --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/in_degree/Ring_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.05263157894736842}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/in_degree/Tree_Directed.json b/tests/data/baseline/centrality/degree_centrality/in_degree/Tree_Directed.json new file mode 100644 index 00000000..365279a3 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/in_degree/Tree_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.0}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json new file mode 100644 index 00000000..870b88d1 --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 1.0}, {"Vertex_ID": "B", "score": 0.0}, {"Vertex_ID": "C", "score": 0.0}, {"Vertex_ID": "D", "score": 0.0}, {"Vertex_ID": "E", "score": 0.0}, {"Vertex_ID": "F", "score": 0.0}, {"Vertex_ID": "G", "score": 0.0}, {"Vertex_ID": "H", "score": 0.0}, {"Vertex_ID": "I", "score": 0.0}, {"Vertex_ID": "J", "score": 0.0}, {"Vertex_ID": "K", "score": 0.0}, {"Vertex_ID": "L", "score": 0.0}, {"Vertex_ID": "M", "score": 0.0}, {"Vertex_ID": "N", "score": 0.0}, {"Vertex_ID": "O", "score": 0.0}, {"Vertex_ID": "P", "score": 0.0}, {"Vertex_ID": "Q", "score": 0.0}, {"Vertex_ID": "R", "score": 0.0}, {"Vertex_ID": "S", "score": 0.0}, {"Vertex_ID": "T", "score": 0.0}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/out_degree/Line_Directed.json b/tests/data/baseline/centrality/degree_centrality/out_degree/Line_Directed.json new file mode 100644 index 00000000..d7e6932f --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/out_degree/Line_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.05263157894736842}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.0}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/out_degree/Ring_Directed.json b/tests/data/baseline/centrality/degree_centrality/out_degree/Ring_Directed.json new file mode 100644 index 00000000..62ccb50c --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/out_degree/Ring_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.05263157894736842}, {"Vertex_ID": "B", "score": 0.05263157894736842}, {"Vertex_ID": "C", "score": 0.05263157894736842}, {"Vertex_ID": "D", "score": 0.05263157894736842}, {"Vertex_ID": "E", "score": 0.05263157894736842}, {"Vertex_ID": "F", "score": 0.05263157894736842}, {"Vertex_ID": "G", "score": 0.05263157894736842}, {"Vertex_ID": "H", "score": 0.05263157894736842}, {"Vertex_ID": "I", "score": 0.05263157894736842}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.05263157894736842}, {"Vertex_ID": "L", "score": 0.05263157894736842}, {"Vertex_ID": "M", "score": 0.05263157894736842}, {"Vertex_ID": "N", "score": 0.05263157894736842}, {"Vertex_ID": "O", "score": 0.05263157894736842}, {"Vertex_ID": "P", "score": 0.05263157894736842}, {"Vertex_ID": "Q", "score": 0.05263157894736842}, {"Vertex_ID": "R", "score": 0.05263157894736842}, {"Vertex_ID": "S", "score": 0.05263157894736842}, {"Vertex_ID": "T", "score": 0.05263157894736842}]}] \ No newline at end of file diff --git a/tests/data/baseline/centrality/degree_centrality/out_degree/Tree_Directed.json b/tests/data/baseline/centrality/degree_centrality/out_degree/Tree_Directed.json new file mode 100644 index 00000000..9471b1db --- /dev/null +++ b/tests/data/baseline/centrality/degree_centrality/out_degree/Tree_Directed.json @@ -0,0 +1 @@ +[{"top_scores": [{"Vertex_ID": "A", "score": 0.10526315789473684}, {"Vertex_ID": "B", "score": 0.10526315789473684}, {"Vertex_ID": "C", "score": 0.10526315789473684}, {"Vertex_ID": "D", "score": 0.10526315789473684}, {"Vertex_ID": "E", "score": 0.10526315789473684}, {"Vertex_ID": "F", "score": 0.10526315789473684}, {"Vertex_ID": "G", "score": 0.10526315789473684}, {"Vertex_ID": "H", "score": 0.10526315789473684}, {"Vertex_ID": "I", "score": 0.10526315789473684}, {"Vertex_ID": "J", "score": 0.05263157894736842}, {"Vertex_ID": "K", "score": 0.0}, {"Vertex_ID": "L", "score": 0.0}, {"Vertex_ID": "M", "score": 0.0}, {"Vertex_ID": "N", "score": 0.0}, {"Vertex_ID": "O", "score": 0.0}, {"Vertex_ID": "P", "score": 0.0}, {"Vertex_ID": "Q", "score": 0.0}, {"Vertex_ID": "R", "score": 0.0}, {"Vertex_ID": "S", "score": 0.0}, {"Vertex_ID": "T", "score": 0.0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Empty.json b/tests/data/baseline/centrality/harmonic_centrality/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Empty.json rename to tests/data/baseline/centrality/harmonic_centrality/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Hub_Spoke.json b/tests/data/baseline/centrality/harmonic_centrality/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Hub_Spoke.json rename to tests/data/baseline/centrality/harmonic_centrality/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/harmonic_centrality/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Hub_Spoke_Directed.json rename to tests/data/baseline/centrality/harmonic_centrality/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Line.json b/tests/data/baseline/centrality/harmonic_centrality/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Line.json rename to tests/data/baseline/centrality/harmonic_centrality/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Line_Directed.json b/tests/data/baseline/centrality/harmonic_centrality/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Line_Directed.json rename to tests/data/baseline/centrality/harmonic_centrality/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Ring.json b/tests/data/baseline/centrality/harmonic_centrality/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Ring.json rename to tests/data/baseline/centrality/harmonic_centrality/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Ring_Directed.json b/tests/data/baseline/centrality/harmonic_centrality/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Ring_Directed.json rename to tests/data/baseline/centrality/harmonic_centrality/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Tree.json b/tests/data/baseline/centrality/harmonic_centrality/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Tree.json rename to tests/data/baseline/centrality/harmonic_centrality/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Tree_Directed.json b/tests/data/baseline/centrality/harmonic_centrality/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/Tree_Directed.json rename to tests/data/baseline/centrality/harmonic_centrality/Tree_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Empty.json b/tests/data/baseline/centrality/pagerank/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Empty.json rename to tests/data/baseline/centrality/pagerank/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Hub_Spoke.json b/tests/data/baseline/centrality/pagerank/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Hub_Spoke.json rename to tests/data/baseline/centrality/pagerank/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Hub_Spoke_Directed.json b/tests/data/baseline/centrality/pagerank/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Hub_Spoke_Directed.json rename to tests/data/baseline/centrality/pagerank/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Line.json b/tests/data/baseline/centrality/pagerank/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Line.json rename to tests/data/baseline/centrality/pagerank/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Line_Directed.json b/tests/data/baseline/centrality/pagerank/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Line_Directed.json rename to tests/data/baseline/centrality/pagerank/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Ring.json b/tests/data/baseline/centrality/pagerank/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Ring.json rename to tests/data/baseline/centrality/pagerank/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Ring_Directed.json b/tests/data/baseline/centrality/pagerank/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Ring_Directed.json rename to tests/data/baseline/centrality/pagerank/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Tree.json b/tests/data/baseline/centrality/pagerank/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Tree.json rename to tests/data/baseline/centrality/pagerank/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Tree_Directed.json b/tests/data/baseline/centrality/pagerank/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/pagerank/Tree_Directed.json rename to tests/data/baseline/centrality/pagerank/Tree_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Hub_Spoke_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/Hub_Spoke_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Hub_Spoke_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/Hub_Spoke_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Line_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/Line_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Line_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/Line_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Ring_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/Ring_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Ring_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/Ring_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Tree_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/Tree_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/Tree_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/Tree_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Hub_Spoke_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Hub_Spoke_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Hub_Spoke_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Hub_Spoke_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Line_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Line_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Line_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Line_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Ring_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Ring_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Ring_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Ring_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Tree_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Tree_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/Tree_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/in_degree/Tree_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Hub_Spoke_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Hub_Spoke_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Hub_Spoke_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Hub_Spoke_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Line_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Line_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Line_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Line_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Ring_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Ring_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Ring_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Ring_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Tree_Directed_Weighted.json b/tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Tree_Directed_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/Tree_Directed_Weighted.json rename to tests/data/baseline/centrality/weighted_degree_centrality/out_degree/Tree_Directed_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Complete.json b/tests/data/baseline/community/lcc/Complete.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Complete.json rename to tests/data/baseline/community/lcc/Complete.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Complete_Directed.json b/tests/data/baseline/community/lcc/Complete_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Complete_Directed.json rename to tests/data/baseline/community/lcc/Complete_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/DAG_Directed.json b/tests/data/baseline/community/lcc/DAG_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/DAG_Directed.json rename to tests/data/baseline/community/lcc/DAG_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Empty.json b/tests/data/baseline/community/lcc/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Empty.json rename to tests/data/baseline/community/lcc/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Empty_Directed.json b/tests/data/baseline/community/lcc/Empty_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Empty_Directed.json rename to tests/data/baseline/community/lcc/Empty_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Connected_Hub_Spoke.json b/tests/data/baseline/community/lcc/Hub_Connected_Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Connected_Hub_Spoke.json rename to tests/data/baseline/community/lcc/Hub_Connected_Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Spoke.json b/tests/data/baseline/community/lcc/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Spoke.json rename to tests/data/baseline/community/lcc/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Spoke_Directed.json b/tests/data/baseline/community/lcc/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Hub_Spoke_Directed.json rename to tests/data/baseline/community/lcc/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Line.json b/tests/data/baseline/community/lcc/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Line.json rename to tests/data/baseline/community/lcc/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Line_Directed.json b/tests/data/baseline/community/lcc/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Line_Directed.json rename to tests/data/baseline/community/lcc/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Line_Weighted.json b/tests/data/baseline/community/lcc/Line_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Line_Weighted.json rename to tests/data/baseline/community/lcc/Line_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Ring.json b/tests/data/baseline/community/lcc/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Ring.json rename to tests/data/baseline/community/lcc/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Ring_Directed.json b/tests/data/baseline/community/lcc/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Ring_Directed.json rename to tests/data/baseline/community/lcc/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Tree.json b/tests/data/baseline/community/lcc/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Tree.json rename to tests/data/baseline/community/lcc/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/community/lcc/Tree_Directed.json b/tests/data/baseline/community/lcc/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/community/lcc/Tree_Directed.json rename to tests/data/baseline/community/lcc/Tree_Directed.json diff --git a/tests/data/baseline/get_data.py b/tests/data/baseline/get_data.py index 88e91682..aa0fe666 100644 --- a/tests/data/baseline/get_data.py +++ b/tests/data/baseline/get_data.py @@ -66,3 +66,5 @@ def download_dir(prefix, local, bucket, client=s3_client): local=".", bucket="tigergraph-public-data", ) + + # os.system("mv graph_algorithms_baselines/* .") diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Hub_Spoke.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Hub_Spoke.json deleted file mode 100644 index 6e10710d..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Hub_Spoke.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "A", "score": 19}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "Q", "score": 1}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Line.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Line.json deleted file mode 100644 index f52803e2..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Line.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "P", "score": 2}, {"Vertex_ID": "N", "score": 2}, {"Vertex_ID": "C", "score": 2}, {"Vertex_ID": "H", "score": 2}, {"Vertex_ID": "B", "score": 2}, {"Vertex_ID": "M", "score": 2}, {"Vertex_ID": "O", "score": 2}, {"Vertex_ID": "R", "score": 2}, {"Vertex_ID": "K", "score": 2}, {"Vertex_ID": "L", "score": 2}, {"Vertex_ID": "J", "score": 2}, {"Vertex_ID": "Q", "score": 2}, {"Vertex_ID": "D", "score": 2}, {"Vertex_ID": "E", "score": 2}, {"Vertex_ID": "G", "score": 2}, {"Vertex_ID": "F", "score": 2}, {"Vertex_ID": "I", "score": 2}, {"Vertex_ID": "S", "score": 2}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "T", "score": 1}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Ring.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Ring.json deleted file mode 100644 index 6334382b..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Ring.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "M", "score": 2}, {"Vertex_ID": "Q", "score": 2}, {"Vertex_ID": "N", "score": 2}, {"Vertex_ID": "O", "score": 2}, {"Vertex_ID": "K", "score": 2}, {"Vertex_ID": "C", "score": 2}, {"Vertex_ID": "B", "score": 2}, {"Vertex_ID": "D", "score": 2}, {"Vertex_ID": "E", "score": 2}, {"Vertex_ID": "T", "score": 2}, {"Vertex_ID": "R", "score": 2}, {"Vertex_ID": "F", "score": 2}, {"Vertex_ID": "A", "score": 2}, {"Vertex_ID": "H", "score": 2}, {"Vertex_ID": "G", "score": 2}, {"Vertex_ID": "I", "score": 2}, {"Vertex_ID": "J", "score": 2}, {"Vertex_ID": "S", "score": 2}, {"Vertex_ID": "L", "score": 2}, {"Vertex_ID": "P", "score": 2}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Tree.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Tree.json deleted file mode 100644 index 85d616d3..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/Tree.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "E", "score": 3}, {"Vertex_ID": "H", "score": 3}, {"Vertex_ID": "B", "score": 3}, {"Vertex_ID": "G", "score": 3}, {"Vertex_ID": "D", "score": 3}, {"Vertex_ID": "F", "score": 3}, {"Vertex_ID": "I", "score": 3}, {"Vertex_ID": "C", "score": 3}, {"Vertex_ID": "J", "score": 2}, {"Vertex_ID": "A", "score": 2}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "P", "score": 1}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json deleted file mode 100644 index 0527ce44..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "A", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Line_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Line_Directed.json deleted file mode 100644 index cb2bda6d..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Line_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "A", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Ring_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Ring_Directed.json deleted file mode 100644 index 18f77d14..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Ring_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "F", "score": 1}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Tree_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Tree_Directed.json deleted file mode 100644 index a00f147c..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/Tree_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "A", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json deleted file mode 100644 index 5bb19d3a..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "A", "score": 19}, {"Vertex_ID": "D", "score": 0}, {"Vertex_ID": "K", "score": 0}, {"Vertex_ID": "M", "score": 0}, {"Vertex_ID": "I", "score": 0}, {"Vertex_ID": "F", "score": 0}, {"Vertex_ID": "J", "score": 0}, {"Vertex_ID": "B", "score": 0}, {"Vertex_ID": "R", "score": 0}, {"Vertex_ID": "E", "score": 0}, {"Vertex_ID": "P", "score": 0}, {"Vertex_ID": "Q", "score": 0}, {"Vertex_ID": "H", "score": 0}, {"Vertex_ID": "G", "score": 0}, {"Vertex_ID": "O", "score": 0}, {"Vertex_ID": "C", "score": 0}, {"Vertex_ID": "L", "score": 0}, {"Vertex_ID": "T", "score": 0}, {"Vertex_ID": "N", "score": 0}, {"Vertex_ID": "S", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Line_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Line_Directed.json deleted file mode 100644 index f939bbc8..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Line_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "T", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Ring_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Ring_Directed.json deleted file mode 100644 index b3ae288a..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Ring_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "T", "score": 1}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Tree_Directed.json b/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Tree_Directed.json deleted file mode 100644 index d3515537..00000000 --- a/tests/data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/Tree_Directed.json +++ /dev/null @@ -1 +0,0 @@ -[{"top_scores": [{"Vertex_ID": "I", "score": 2}, {"Vertex_ID": "F", "score": 2}, {"Vertex_ID": "A", "score": 2}, {"Vertex_ID": "D", "score": 2}, {"Vertex_ID": "G", "score": 2}, {"Vertex_ID": "B", "score": 2}, {"Vertex_ID": "C", "score": 2}, {"Vertex_ID": "H", "score": 2}, {"Vertex_ID": "E", "score": 2}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "P", "score": 0}, {"Vertex_ID": "Q", "score": 0}, {"Vertex_ID": "O", "score": 0}, {"Vertex_ID": "S", "score": 0}, {"Vertex_ID": "L", "score": 0}, {"Vertex_ID": "N", "score": 0}, {"Vertex_ID": "T", "score": 0}, {"Vertex_ID": "R", "score": 0}, {"Vertex_ID": "K", "score": 0}, {"Vertex_ID": "M", "score": 0}]}] \ No newline at end of file diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Complete.json b/tests/data/baseline/path_finding/bfs/Complete.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Complete.json rename to tests/data/baseline/path_finding/bfs/Complete.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Complete_Directed.json b/tests/data/baseline/path_finding/bfs/Complete_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Complete_Directed.json rename to tests/data/baseline/path_finding/bfs/Complete_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/DAG_Directed.json b/tests/data/baseline/path_finding/bfs/DAG_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/DAG_Directed.json rename to tests/data/baseline/path_finding/bfs/DAG_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Empty.json b/tests/data/baseline/path_finding/bfs/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Empty.json rename to tests/data/baseline/path_finding/bfs/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Empty_Directed.json b/tests/data/baseline/path_finding/bfs/Empty_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Empty_Directed.json rename to tests/data/baseline/path_finding/bfs/Empty_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Connected_Hub_Spoke.json b/tests/data/baseline/path_finding/bfs/Hub_Connected_Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Connected_Hub_Spoke.json rename to tests/data/baseline/path_finding/bfs/Hub_Connected_Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Spoke.json b/tests/data/baseline/path_finding/bfs/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Spoke.json rename to tests/data/baseline/path_finding/bfs/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Spoke_Directed.json b/tests/data/baseline/path_finding/bfs/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Hub_Spoke_Directed.json rename to tests/data/baseline/path_finding/bfs/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line.json b/tests/data/baseline/path_finding/bfs/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line.json rename to tests/data/baseline/path_finding/bfs/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line_Directed.json b/tests/data/baseline/path_finding/bfs/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line_Directed.json rename to tests/data/baseline/path_finding/bfs/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line_Weighted.json b/tests/data/baseline/path_finding/bfs/Line_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Line_Weighted.json rename to tests/data/baseline/path_finding/bfs/Line_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Ring.json b/tests/data/baseline/path_finding/bfs/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Ring.json rename to tests/data/baseline/path_finding/bfs/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Ring_Directed.json b/tests/data/baseline/path_finding/bfs/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Ring_Directed.json rename to tests/data/baseline/path_finding/bfs/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Tree.json b/tests/data/baseline/path_finding/bfs/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Tree.json rename to tests/data/baseline/path_finding/bfs/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Tree_Directed.json b/tests/data/baseline/path_finding/bfs/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/bfs/Tree_Directed.json rename to tests/data/baseline/path_finding/bfs/Tree_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Complete.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Complete.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Complete.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Complete.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Complete_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Complete_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Complete_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Complete_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/DAG_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/DAG_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/DAG_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/DAG_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Empty.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Empty.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Empty.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Empty.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Empty_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Empty_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Empty_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Empty_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Connected_Hub_Spoke.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Connected_Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Connected_Hub_Spoke.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Connected_Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Spoke.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Spoke.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Spoke.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Spoke.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Spoke_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Spoke_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Hub_Spoke_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Hub_Spoke_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Line.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Line.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Line_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Line_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line_Weighted.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Line_Weighted.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Line_Weighted.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Line_Weighted.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Ring.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Ring.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Ring.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Ring.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Ring_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Ring_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Ring_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Ring_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Tree.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Tree.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Tree.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Tree.json diff --git a/tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Tree_Directed.json b/tests/data/baseline/path_finding/shortest_ss_no_wt/Tree_Directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/path_finding/shortest_ss_no_wt/Tree_Directed.json rename to tests/data/baseline/path_finding/shortest_ss_no_wt/Tree_Directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link1.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link1.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link2.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link2.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link3.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link3.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link4.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link4.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link5.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link5.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link5.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link5.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link6.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link6.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link6.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link6.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link_directed.json b/tests/data/baseline/topological_link_prediction/adamic_adar/topo_link_directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/adamic_adar/topo_link_directed.json rename to tests/data/baseline/topological_link_prediction/adamic_adar/topo_link_directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link1.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link1.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link2.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link2.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link3.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link3.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link4.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link4.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link5.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link5.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link5.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link5.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link6.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link6.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link6.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link6.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link_directed.json b/tests/data/baseline/topological_link_prediction/common_neighbors/topo_link_directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/common_neighbors/topo_link_directed.json rename to tests/data/baseline/topological_link_prediction/common_neighbors/topo_link_directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link1.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link1.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link2.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link2.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link3.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link3.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link4.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link4.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link5.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link5.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link5.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link5.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link6.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link6.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link6.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link6.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link_directed.json b/tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link_directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/preferential_attachment/topo_link_directed.json rename to tests/data/baseline/topological_link_prediction/preferential_attachment/topo_link_directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link1.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link1.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link2.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link2.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link3.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link3.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link4.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link4.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link5.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link5.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link5.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link5.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link6.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link6.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link6.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link6.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link_directed.json b/tests/data/baseline/topological_link_prediction/resource_allocation/topo_link_directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/resource_allocation/topo_link_directed.json rename to tests/data/baseline/topological_link_prediction/resource_allocation/topo_link_directed.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test1.json b/tests/data/baseline/topological_link_prediction/same_community/test1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test1.json rename to tests/data/baseline/topological_link_prediction/same_community/test1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test2.json b/tests/data/baseline/topological_link_prediction/same_community/test2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test2.json rename to tests/data/baseline/topological_link_prediction/same_community/test2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test3.json b/tests/data/baseline/topological_link_prediction/same_community/test3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test3.json rename to tests/data/baseline/topological_link_prediction/same_community/test3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test4.json b/tests/data/baseline/topological_link_prediction/same_community/test4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/same_community/test4.json rename to tests/data/baseline/topological_link_prediction/same_community/test4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link1.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link1.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link1.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link1.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link2.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link2.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link2.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link2.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link3.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link3.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link3.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link3.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link4.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link4.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link4.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link4.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link5.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link5.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link5.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link5.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link6.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link6.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link6.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link6.json diff --git a/tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link_directed.json b/tests/data/baseline/topological_link_prediction/total_neighbors/topo_link_directed.json similarity index 100% rename from tests/data/baseline/graph_algorithms_baselines/topological_link_prediction/total_neighbors/topo_link_directed.json rename to tests/data/baseline/topological_link_prediction/total_neighbors/topo_link_directed.json diff --git a/tests/data/create_baseline.py b/tests/data/create_baseline.py new file mode 100644 index 00000000..53e55b5f --- /dev/null +++ b/tests/data/create_baseline.py @@ -0,0 +1,155 @@ +import csv +import json + +import networkx as nx +import numpy as np +from tqdm import tqdm + +baseline_path_root = "baseline" + + +def run_degree_baseline_complete(g: nx.Graph, _): + s = 1.0 / (len(g) - 1.0) + + # d-1 because nx will double count the self-edge + res = {n: (d - 1) * s for n, d in g.degree()} + + out = [] + for k, v in res.items(): + out.append({"Vertex_ID": k, "score": v}) + + out = [{"top_scores": out}] + return out + + +def run_degree_baseline(g: nx.Graph, metric): + res = metric(g) + + out = [] + for k, v in res.items(): + out.append({"Vertex_ID": k, "score": v}) + + out = [{"top_scores": out}] + return out + + +def create_graph(edges, weights=False, directed=False): + if directed: + g = nx.DiGraph() + else: + g = nx.Graph() + if weights: + g.add_weighted_edges_from(edges) + else: + g.add_edges_from(edges) + return g + + +def create_degree_baseline(): + # input, output, weighed + paths = [ + ( + "unweighted_edges/complete_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/Complete.json", + run_degree_baseline_complete, + None, + ), + # + ( + "unweighted_edges/line_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/Line.json", + run_degree_baseline, + nx.centrality.degree_centrality, + ), + ( + "unweighted_edges/ring_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/Ring.json", + run_degree_baseline, + nx.centrality.degree_centrality, + ), + ( + "unweighted_edges/hubspoke_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/Hub_Spoke.json", + run_degree_baseline, + nx.centrality.degree_centrality, + ), + ( + "unweighted_edges/tree_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/Tree.json", + run_degree_baseline, + nx.centrality.degree_centrality, + ), + # in_degree + ( + "unweighted_edges/line_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/in_degree/Line_Directed.json", + run_degree_baseline, + nx.centrality.in_degree_centrality, + ), + ( + "unweighted_edges/ring_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/in_degree/Ring_Directed.json", + run_degree_baseline, + nx.centrality.in_degree_centrality, + ), + ( + "unweighted_edges/hubspoke_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/in_degree/Hub_Spoke_Directed.json", + run_degree_baseline, + nx.centrality.in_degree_centrality, + ), + ( + "unweighted_edges/tree_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/in_degree/Tree_Directed.json", + run_degree_baseline, + nx.centrality.in_degree_centrality, + ), + # out_degree + ( + "unweighted_edges/line_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/out_degree/Line_Directed.json", + run_degree_baseline, + nx.centrality.out_degree_centrality, + ), + ( + "unweighted_edges/ring_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/out_degree/Ring_Directed.json", + run_degree_baseline, + nx.centrality.out_degree_centrality, + ), + ( + "unweighted_edges/hubspoke_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/out_degree/Hub_Spoke_Directed.json", + run_degree_baseline, + nx.centrality.out_degree_centrality, + ), + ( + "unweighted_edges/tree_edges.csv", + f"{baseline_path_root}/centrality/degree_centrality/out_degree/Tree_Directed.json", + run_degree_baseline, + nx.centrality.out_degree_centrality, + ), + ] + + for p, out_path, fn, m in tqdm(paths, desc="Creating baselines"): + with open(p) as f: + edges = np.array(list(csv.reader(f))) + + if "Directed" in out_path: + g = create_graph(edges, directed=True) + + # from matplotlib import pyplot as plt + # pos = nx.drawing.layout.kamada_kawai_layout(g) + # nx.draw(g, pos) + # nx.draw_networkx_labels(g, pos, {n: n for n in g.nodes}) + # plt.savefig(f"{out_path.split('/')[-1]}.png") + else: + g = create_graph(edges) + + res = fn(g, m) + with open(out_path, "w") as f: + json.dump(res, f) # , indent=2) + + +if __name__ == "__main__": + create_degree_baseline() diff --git a/tests/data/unweighted edges/complete_edges.csv b/tests/data/unweighted_edges/complete_edges.csv similarity index 100% rename from tests/data/unweighted edges/complete_edges.csv rename to tests/data/unweighted_edges/complete_edges.csv diff --git a/tests/data/unweighted edges/complete_edges_directed.csv b/tests/data/unweighted_edges/complete_edges_directed.csv similarity index 100% rename from tests/data/unweighted edges/complete_edges_directed.csv rename to tests/data/unweighted_edges/complete_edges_directed.csv diff --git a/tests/data/unweighted edges/dag_edges.csv b/tests/data/unweighted_edges/dag_edges.csv similarity index 100% rename from tests/data/unweighted edges/dag_edges.csv rename to tests/data/unweighted_edges/dag_edges.csv diff --git a/tests/data/unweighted edges/empty_graph_edges.csv b/tests/data/unweighted_edges/empty_graph_edges.csv similarity index 100% rename from tests/data/unweighted edges/empty_graph_edges.csv rename to tests/data/unweighted_edges/empty_graph_edges.csv diff --git a/tests/data/unweighted edges/hubspoke_connected_spoke_edges.csv b/tests/data/unweighted_edges/hubspoke_connected_spoke_edges.csv similarity index 100% rename from tests/data/unweighted edges/hubspoke_connected_spoke_edges.csv rename to tests/data/unweighted_edges/hubspoke_connected_spoke_edges.csv diff --git a/tests/data/unweighted edges/hubspoke_edges.csv b/tests/data/unweighted_edges/hubspoke_edges.csv similarity index 100% rename from tests/data/unweighted edges/hubspoke_edges.csv rename to tests/data/unweighted_edges/hubspoke_edges.csv diff --git a/tests/data/unweighted edges/line_edges.csv b/tests/data/unweighted_edges/line_edges.csv similarity index 100% rename from tests/data/unweighted edges/line_edges.csv rename to tests/data/unweighted_edges/line_edges.csv diff --git a/tests/data/unweighted edges/mulithub_shared_spoke_edges.csv b/tests/data/unweighted_edges/mulithub_shared_spoke_edges.csv similarity index 100% rename from tests/data/unweighted edges/mulithub_shared_spoke_edges.csv rename to tests/data/unweighted_edges/mulithub_shared_spoke_edges.csv diff --git a/tests/data/unweighted edges/ring_edges.csv b/tests/data/unweighted_edges/ring_edges.csv similarity index 100% rename from tests/data/unweighted edges/ring_edges.csv rename to tests/data/unweighted_edges/ring_edges.csv diff --git a/tests/data/unweighted edges/tree_edges.csv b/tests/data/unweighted_edges/tree_edges.csv similarity index 100% rename from tests/data/unweighted edges/tree_edges.csv rename to tests/data/unweighted_edges/tree_edges.csv diff --git a/tests/data/weighted edges/complete_edges.csv b/tests/data/weighted_edges/complete_edges.csv similarity index 100% rename from tests/data/weighted edges/complete_edges.csv rename to tests/data/weighted_edges/complete_edges.csv diff --git a/tests/data/weighted edges/complete_edges_directed.csv b/tests/data/weighted_edges/complete_edges_directed.csv similarity index 100% rename from tests/data/weighted edges/complete_edges_directed.csv rename to tests/data/weighted_edges/complete_edges_directed.csv diff --git a/tests/data/weighted edges/dag_edges.csv b/tests/data/weighted_edges/dag_edges.csv similarity index 100% rename from tests/data/weighted edges/dag_edges.csv rename to tests/data/weighted_edges/dag_edges.csv diff --git a/tests/data/weighted edges/empty_graph_edges.csv b/tests/data/weighted_edges/empty_graph_edges.csv similarity index 100% rename from tests/data/weighted edges/empty_graph_edges.csv rename to tests/data/weighted_edges/empty_graph_edges.csv diff --git a/tests/data/weighted edges/hubspoke_connected_spoke_edges.csv b/tests/data/weighted_edges/hubspoke_connected_spoke_edges.csv similarity index 100% rename from tests/data/weighted edges/hubspoke_connected_spoke_edges.csv rename to tests/data/weighted_edges/hubspoke_connected_spoke_edges.csv diff --git a/tests/data/weighted edges/hubspoke_edges.csv b/tests/data/weighted_edges/hubspoke_edges.csv similarity index 100% rename from tests/data/weighted edges/hubspoke_edges.csv rename to tests/data/weighted_edges/hubspoke_edges.csv diff --git a/tests/data/weighted edges/line_edges.csv b/tests/data/weighted_edges/line_edges.csv similarity index 100% rename from tests/data/weighted edges/line_edges.csv rename to tests/data/weighted_edges/line_edges.csv diff --git a/tests/data/weighted edges/mulithub_shared_spoke_edges.csv b/tests/data/weighted_edges/mulithub_shared_spoke_edges.csv similarity index 100% rename from tests/data/weighted edges/mulithub_shared_spoke_edges.csv rename to tests/data/weighted_edges/mulithub_shared_spoke_edges.csv diff --git a/tests/data/weighted edges/negative_cycles_edges.csv b/tests/data/weighted_edges/negative_cycles_edges.csv similarity index 100% rename from tests/data/weighted edges/negative_cycles_edges.csv rename to tests/data/weighted_edges/negative_cycles_edges.csv diff --git a/tests/data/weighted edges/ring_edges.csv b/tests/data/weighted_edges/ring_edges.csv similarity index 100% rename from tests/data/weighted edges/ring_edges.csv rename to tests/data/weighted_edges/ring_edges.csv diff --git a/tests/data/weighted edges/tree_edges.csv b/tests/data/weighted_edges/tree_edges.csv similarity index 100% rename from tests/data/weighted edges/tree_edges.csv rename to tests/data/weighted_edges/tree_edges.csv diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 00000000..af43a402 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,53 @@ +aiohttp==3.9.5 +aiosignal==1.3.1 +attrs==23.2.0 +boto3==1.28.83 +botocore==1.31.85 +certifi==2024.2.2 +charset-normalizer==3.3.2 +contourpy==1.2.1 +cycler==0.12.1 +execnet==2.1.1 +filelock==3.13.4 +fonttools==4.51.0 +frozenlist==1.4.1 +fsspec==2024.3.1 +idna==3.7 +iniconfig==2.0.0 +Jinja2==3.1.3 +jmespath==1.0.1 +joblib==1.4.0 +kiwisolver==1.4.5 +MarkupSafe==2.1.5 +matplotlib==3.9.0 +mpmath==1.3.0 +multidict==6.0.5 +networkx==3.3 +numpy==1.26.4 +packaging==24.0 +pandas==2.1.1 +pillow==10.3.0 +pluggy==1.5.0 +psutil==5.9.8 +py==1.11.0 +pyparsing==3.1.2 +pytest==8.2.1 +pytest-xdist==3.5.0 +python-dateutil==2.9.0.post0 +python-dotenv==1.0.1 +pyTigerGraph==1.5.2 +pytz==2024.1 +requests==2.31.0 +s3transfer==0.7.0 +scikit-learn==1.4.2 +scipy==1.13.0 +six==1.16.0 +sympy==1.12 +threadpoolctl==3.4.0 +tomli==2.0.1 +tqdm==4.66.2 +typing_extensions==4.11.0 +tzdata==2024.1 +urllib3==2.0.7 +validators==0.28.1 +yarl==1.9.4 diff --git a/tests/run.sh b/tests/run.sh index df88fcc5..b4f5945e 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,4 +1,7 @@ clear +cd data +python3 create_baseline.py +cd .. python test/setup.py && - pytest -# pytest --junitxml "output.xml" #-n 4 + pytest test/test_centrality.py + # pytest diff --git a/tests/test/test_centrality.py b/tests/test/test_centrality.py index e228f12f..68b1bcbb 100644 --- a/tests/test/test_centrality.py +++ b/tests/test/test_centrality.py @@ -7,7 +7,13 @@ class TestCentrality: feat = util.get_featurizer() # undirected graphs - graph_types1 = ["Empty", "Line", "Ring", "Hub_Spoke", "Tree"] + graph_types1 = [ + "Empty", + "Line", + "Ring", + "Hub_Spoke", + "Tree", + ] # directed graphs graph_types2 = [ "Line_Directed", @@ -29,6 +35,8 @@ class TestCentrality: "Hub_Spoke_Directed_Weighted", "Tree_Directed_Weighted", ] + # Complete Graphs + graph_types5 = ["Complete"] @pytest.mark.parametrize("test_name", graph_types1) def test_degree_centrality1(self, test_name): @@ -43,22 +51,20 @@ def test_degree_centrality1(self, test_name): "result_attribute": "", "file_path": "", } - with open( - f"data/baseline/graph_algorithms_baselines/centrality/degree_centrality/{test_name}.json" - ) as f: + with open(f"data/baseline/centrality/degree_centrality/{test_name}.json") as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_degree_cent", params=params) result = sorted(result[0]["top_scores"], key=lambda x: x["Vertex_ID"]) baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) + # pytest.fail(str(result)) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types2) def test_degree_centrality2(self, test_name): @@ -74,7 +80,7 @@ def test_degree_centrality2(self, test_name): "file_path": "", } with open( - f"data/baseline/graph_algorithms_baselines/centrality/degree_centrality/in_degree/{test_name}.json" + f"data/baseline/centrality/degree_centrality/in_degree/{test_name}.json" ) as f: baseline = json.load(f) @@ -83,12 +89,11 @@ def test_degree_centrality2(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types2) def test_degree_centrality3(self, test_name): @@ -104,7 +109,7 @@ def test_degree_centrality3(self, test_name): "file_path": "", } with open( - f"data/baseline/graph_algorithms_baselines/centrality/degree_centrality/out_degree/{test_name}.json" + f"data/baseline/centrality/degree_centrality/out_degree/{test_name}.json" ) as f: baseline = json.load(f) @@ -113,12 +118,35 @@ def test_degree_centrality3(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') + + @pytest.mark.parametrize("test_name", graph_types5) + def test_degree_centrality4(self, test_name): + params = { + "v_type_set": ["V8"], + "e_type_set": [test_name], + "reverse_e_type_set": ["reverse_" + test_name], + "in_degree": False, + "out_degree": True, + "print_results": True, + } + with open(f"data/baseline/centrality/degree_centrality/{test_name}.json") as f: + baseline = json.load(f) + + result = self.feat.runAlgorithm("tg_degree_cent", params=params) + result = sorted(result[0]["top_scores"], key=lambda x: x["Vertex_ID"]) + baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) + + for b in baseline: + for r in result: + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types3) def test_weighted_degree_centrality1(self, test_name): @@ -135,7 +163,7 @@ def test_weighted_degree_centrality1(self, test_name): "file_path": "", } with open( - f"data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/{test_name}.json" + f"data/baseline/centrality/weighted_degree_centrality/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_weighted_degree_cent", params=params) @@ -143,12 +171,11 @@ def test_weighted_degree_centrality1(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types4) def test_weighted_degree_centrality2(self, test_name): @@ -165,7 +192,7 @@ def test_weighted_degree_centrality2(self, test_name): "file_path": "", } with open( - f"data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/in_degree/{test_name}.json" + f"data/baseline/centrality/weighted_degree_centrality/in_degree/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_weighted_degree_cent", params=params) @@ -173,12 +200,11 @@ def test_weighted_degree_centrality2(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types4) def test_weighted_degree_centrality3(self, test_name): @@ -195,7 +221,7 @@ def test_weighted_degree_centrality3(self, test_name): "file_path": "", } with open( - f"data/baseline/graph_algorithms_baselines/centrality/weighted_degree_centrality/out_degree/{test_name}.json" + f"data/baseline/centrality/weighted_degree_centrality/out_degree/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_weighted_degree_cent", params=params) @@ -203,12 +229,11 @@ def test_weighted_degree_centrality3(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types1) def test_closeness_centrality(self, test_name): @@ -225,7 +250,7 @@ def test_closeness_centrality(self, test_name): "display_edges": False, } with open( - f"data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/{test_name}.json" + f"data/baseline/centrality/closeness_centrality/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_closeness_cent", params=params) @@ -233,12 +258,11 @@ def test_closeness_centrality(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types2) def test_closeness_centrality2(self, test_name): @@ -255,7 +279,7 @@ def test_closeness_centrality2(self, test_name): "display_edges": False, } with open( - f"data/baseline/graph_algorithms_baselines/centrality/closeness_centrality/{test_name}.json" + f"data/baseline/centrality/closeness_centrality/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_closeness_cent", params=params) @@ -263,12 +287,11 @@ def test_closeness_centrality2(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types1) def test_harmonic_centrality(self, test_name): @@ -285,7 +308,7 @@ def test_harmonic_centrality(self, test_name): "display_edges": False, } with open( - f"data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/{test_name}.json" + f"data/baseline/centrality/harmonic_centrality/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_harmonic_cent", params=params) @@ -293,12 +316,11 @@ def test_harmonic_centrality(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types2) def test_harmonic_centrality2(self, test_name): @@ -315,7 +337,7 @@ def test_harmonic_centrality2(self, test_name): "display_edges": False, } with open( - f"data/baseline/graph_algorithms_baselines/centrality/harmonic_centrality/{test_name}.json" + f"data/baseline/centrality/harmonic_centrality/{test_name}.json" ) as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_harmonic_cent", params=params) @@ -323,12 +345,11 @@ def test_harmonic_centrality2(self, test_name): baseline = sorted(baseline[0]["top_scores"], key=lambda x: x["Vertex_ID"]) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types1 + graph_types2) def test_article_rank(self, test_name): @@ -343,9 +364,7 @@ def test_article_rank(self, test_name): "result_attribute": "", "file_path": "", } - with open( - f"data/baseline/graph_algorithms_baselines/centrality/article_rank/{test_name}.json" - ) as f: + with open(f"data/baseline/centrality/article_rank/{test_name}.json") as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_article_rank", params=params) result = sorted(result[0]["@@top_scores_heap"], key=lambda x: x["Vertex_ID"]) @@ -354,12 +373,11 @@ def test_article_rank(self, test_name): ) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}') @pytest.mark.parametrize("test_name", graph_types1 + graph_types2) def test_pagerank(self, test_name): @@ -375,9 +393,7 @@ def test_pagerank(self, test_name): "file_path": "", "display_edges": False, } - with open( - f"data/baseline/graph_algorithms_baselines/centrality/pagerank/{test_name}.json" - ) as f: + with open(f"data/baseline/centrality/pagerank/{test_name}.json") as f: baseline = json.load(f) result = self.feat.runAlgorithm("tg_pagerank", params=params) result = sorted(result[0]["@@top_scores_heap"], key=lambda x: x["Vertex_ID"]) @@ -386,9 +402,8 @@ def test_pagerank(self, test_name): ) for b in baseline: - found = False for r in result: - if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] == r["score"]: - found = True - if not found: - pytest.fail() + if r["Vertex_ID"] == b["Vertex_ID"] and r["score"] != pytest.approx( + b["score"] + ): + pytest.fail(f'{r["score"]} != {b["score"]}')