Skip to content

Commit

Permalink
Merge pull request #169 from tigergraph/GML-1869-pagerank
Browse files Browse the repository at this point in the history
Gml 1869 pagerank
  • Loading branch information
RobRossmiller-TG authored Sep 6, 2024
2 parents 80ffe0f + 0c4f35f commit 2070416
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 176 deletions.
56 changes: 34 additions & 22 deletions algorithms/Centrality/pagerank/global/unweighted/tg_pagerank.gsql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CREATE QUERY tg_pagerank (STRING v_type, STRING e_type, FLOAT max_change=0.001, INT maximum_iteration=25, FLOAT damping=0.85, INT top_k = 100, BOOL print_results = TRUE, STRING result_attribute = "", STRING file_path = "", BOOL display_edges = FALSE) SYNTAX V1 {
CREATE QUERY tg_pagerank (STRING v_type, STRING e_type, FLOAT max_change=0.001, INT maximum_iteration=25, FLOAT damping=0.85, INT top_k = 100, BOOL normalize=TRUE, BOOL print_results = TRUE, STRING result_attribute = "", STRING file_path = "", BOOL display_edges = FALSE) SYNTAX V1 {
/*
First Author: unk
First Commit Date: unk
First Author: <unk>
First Commit Date: <unk>

Recent Author: Rob Rossmiller
Recent Commit Date: Rob Rossmiller
Recent Commit Date: Sept 4, 2024


Repository:
Expand Down Expand Up @@ -41,7 +41,7 @@ CREATE QUERY tg_pagerank (STRING v_type, STRING e_type, FLOAT max_change=0.001,
file_path:
file to write CSV output to
top_k:
#top scores to output
//top scores to output
display_edges:
output edges for visualization
max_change:
Expand All @@ -52,54 +52,66 @@ CREATE QUERY tg_pagerank (STRING v_type, STRING e_type, FLOAT max_change=0.001,

TYPEDEF TUPLE<VERTEX Vertex_ID, FLOAT score> Vertex_Score;
HeapAccum<Vertex_Score>(top_k, score DESC) @@top_scores_heap;
SetAccum<VERTEX> @@top_vertices; # vertices with top score
MaxAccum<FLOAT> @@max_diff = 9999; # max score change in an iteration
SumAccum<FLOAT> @sum_recvd_score = 0; # sum of scores each vertex receives FROM neighbors
SumAccum<FLOAT> @sum_score = 1; # initial score for every vertex is 1.
SetAccum<EDGE> @@edge_set; # list of all edges, if display is needed
SetAccum<VERTEX> @@top_vertices; // vertices with top score
MaxAccum<FLOAT> @@max_diff = 9999; // max score change in an iteration
SumAccum<FLOAT> @sum_recvd_score = 0; // sum of scores each vertex receives FROM neighbors
SumAccum<FLOAT> @sum_score = 1; // initial score for every vertex is 1.
SetAccum<EDGE> @@edge_set; // list of all edges, if display is needed
FILE f (file_path);
INT N=1;


// PageRank iterations
Start = {v_type}; // Start with all vertices of specified type(s)
IF normalize THEN
N = Start.size();
tmp = SELECT s FROM Start:s
ACCUM s.@sum_score = 1.0/N;
END;

# PageRank iterations
Start = {v_type}; # Start with all vertices of specified type(s)
WHILE @@max_diff > max_change LIMIT maximum_iteration DO
@@max_diff = 0;

V = SELECT s FROM Start:s -(e_type:e)- v_type:t
ACCUM
t.@sum_recvd_score += s.@sum_score/(s.outdegree(e_type))
ACCUM t.@sum_recvd_score += s.@sum_score/(s.outdegree(e_type))
POST-ACCUM
s.@sum_score = (1.0 - damping) + damping * s.@sum_recvd_score,
s.@sum_score = (1.0-damping)/N + damping * s.@sum_recvd_score,
s.@sum_recvd_score = 0,
@@max_diff += abs(s.@sum_score - s.@sum_score');
END; # END WHILE loop
END;

# Output
// Output
IF file_path != "" THEN
f.println("Vertex_ID", "PageRank");
END;

V = SELECT s FROM Start:s
POST-ACCUM
POST-ACCUM
IF result_attribute != "" THEN
s.setAttr(result_attribute, s.@sum_score)
END,

IF file_path != "" THEN
f.println(s, s.@sum_score)
END,

IF print_results THEN
@@top_scores_heap += Vertex_Score(s, s.@sum_score)
END;

IF print_results THEN
PRINT @@top_scores_heap;
IF display_edges THEN

FOREACH vert IN @@top_scores_heap DO
@@top_vertices += vert.Vertex_ID;
END;

Top = {@@top_vertices};
Top = SELECT s FROM Top:s -(e_type:e)- v_type:t
WHERE @@top_vertices.contains(t)
ACCUM @@edge_set += e;
Top = SELECT s
FROM Top:s -(e_type:e)- v_type:t
WHERE @@top_vertices.contains(t)
ACCUM @@edge_set += e;

PRINT @@edge_set;
PRINT Top;
Expand Down
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Empty.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "P", "score": 0}, {"Vertex_ID": "N", "score": 0}, {"Vertex_ID": "F", "score": 0}, {"Vertex_ID": "C", "score": 0}, {"Vertex_ID": "J", "score": 0}, {"Vertex_ID": "R", "score": 0}, {"Vertex_ID": "A", "score": 0}, {"Vertex_ID": "T", "score": 0}, {"Vertex_ID": "D", "score": 0}, {"Vertex_ID": "E", "score": 0}, {"Vertex_ID": "L", "score": 0}, {"Vertex_ID": "S", "score": 0}, {"Vertex_ID": "I", "score": 0}, {"Vertex_ID": "H", "score": 0}, {"Vertex_ID": "G", "score": 0}, {"Vertex_ID": "B", "score": 0}, {"Vertex_ID": "Q", "score": 0}, {"Vertex_ID": "O", "score": 0}, {"Vertex_ID": "K", "score": 0}, {"Vertex_ID": "M", "score": 0}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "T", "score": 1}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Hub_Spoke.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.463517542849035}, {"Vertex_ID": "B", "score": 0.02823591879741922}, {"Vertex_ID": "C", "score": 0.02823591879741922}, {"Vertex_ID": "D", "score": 0.02823591879741922}, {"Vertex_ID": "E", "score": 0.02823591879741922}, {"Vertex_ID": "F", "score": 0.02823591879741922}, {"Vertex_ID": "G", "score": 0.02823591879741922}, {"Vertex_ID": "H", "score": 0.02823591879741922}, {"Vertex_ID": "I", "score": 0.02823591879741922}, {"Vertex_ID": "J", "score": 0.02823591879741922}, {"Vertex_ID": "K", "score": 0.02823591879741922}, {"Vertex_ID": "L", "score": 0.02823591879741922}, {"Vertex_ID": "M", "score": 0.02823591879741922}, {"Vertex_ID": "N", "score": 0.02823591879741922}, {"Vertex_ID": "O", "score": 0.02823591879741922}, {"Vertex_ID": "P", "score": 0.02823591879741922}, {"Vertex_ID": "Q", "score": 0.02823591879741922}, {"Vertex_ID": "R", "score": 0.02823591879741922}, {"Vertex_ID": "S", "score": 0.02823591879741922}, {"Vertex_ID": "T", "score": 0.02823591879741922}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 7.642066}, {"Vertex_ID": "I", "score": 0.6504175}, {"Vertex_ID": "C", "score": 0.6504175}, {"Vertex_ID": "T", "score": 0.6504175}, {"Vertex_ID": "Q", "score": 0.6504175}, {"Vertex_ID": "L", "score": 0.6504175}, {"Vertex_ID": "B", "score": 0.6504175}, {"Vertex_ID": "M", "score": 0.6504175}, {"Vertex_ID": "K", "score": 0.6504175}, {"Vertex_ID": "N", "score": 0.6504175}, {"Vertex_ID": "F", "score": 0.6504175}, {"Vertex_ID": "R", "score": 0.6504175}, {"Vertex_ID": "H", "score": 0.6504175}, {"Vertex_ID": "S", "score": 0.6504175}, {"Vertex_ID": "D", "score": 0.6504175}, {"Vertex_ID": "E", "score": 0.6504175}, {"Vertex_ID": "G", "score": 0.6504175}, {"Vertex_ID": "J", "score": 0.6504175}, {"Vertex_ID": "O", "score": 0.6504175}, {"Vertex_ID": "P", "score": 0.6504175}]}]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.04796147421875003}, {"Vertex_ID": "B", "score": 0.050107290830592136}, {"Vertex_ID": "C", "score": 0.050107290830592136}, {"Vertex_ID": "D", "score": 0.050107290830592136}, {"Vertex_ID": "E", "score": 0.050107290830592136}, {"Vertex_ID": "F", "score": 0.050107290830592136}, {"Vertex_ID": "G", "score": 0.050107290830592136}, {"Vertex_ID": "H", "score": 0.050107290830592136}, {"Vertex_ID": "I", "score": 0.050107290830592136}, {"Vertex_ID": "J", "score": 0.050107290830592136}, {"Vertex_ID": "K", "score": 0.050107290830592136}, {"Vertex_ID": "L", "score": 0.050107290830592136}, {"Vertex_ID": "M", "score": 0.050107290830592136}, {"Vertex_ID": "N", "score": 0.050107290830592136}, {"Vertex_ID": "O", "score": 0.050107290830592136}, {"Vertex_ID": "P", "score": 0.050107290830592136}, {"Vertex_ID": "Q", "score": 0.050107290830592136}, {"Vertex_ID": "R", "score": 0.050107290830592136}, {"Vertex_ID": "S", "score": 0.050107290830592136}, {"Vertex_ID": "T", "score": 0.050107290830592136}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "A", "score": 0.15}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Line.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.03211926639226151}, {"Vertex_ID": "B", "score": 0.057926119511365004}, {"Vertex_ID": "C", "score": 0.05441422855961764}, {"Vertex_ID": "D", "score": 0.05245734353657548}, {"Vertex_ID": "E", "score": 0.05137048851726371}, {"Vertex_ID": "F", "score": 0.050764880552029296}, {"Vertex_ID": "G", "score": 0.05043133169155993}, {"Vertex_ID": "H", "score": 0.050248328845906194}, {"Vertex_ID": "I", "score": 0.05015421972563542}, {"Vertex_ID": "J", "score": 0.05011379266778576}, {"Vertex_ID": "K", "score": 0.05011379266778576}, {"Vertex_ID": "L", "score": 0.05015421972563542}, {"Vertex_ID": "M", "score": 0.050248328845906194}, {"Vertex_ID": "N", "score": 0.05043133169155993}, {"Vertex_ID": "O", "score": 0.050764880552029296}, {"Vertex_ID": "P", "score": 0.05137048851726371}, {"Vertex_ID": "Q", "score": 0.05245734353657548}, {"Vertex_ID": "R", "score": 0.05441422855961764}, {"Vertex_ID": "S", "score": 0.057926119511365004}, {"Vertex_ID": "T", "score": 0.03211926639226151}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "S", "score": 1.140792}, {"Vertex_ID": "B", "score": 1.140792}, {"Vertex_ID": "C", "score": 1.109244}, {"Vertex_ID": "R", "score": 1.109244}, {"Vertex_ID": "E", "score": 1.037739}, {"Vertex_ID": "P", "score": 1.037739}, {"Vertex_ID": "Q", "score": 1.035503}, {"Vertex_ID": "D", "score": 1.035503}, {"Vertex_ID": "N", "score": 1.010813}, {"Vertex_ID": "G", "score": 1.010813}, {"Vertex_ID": "F", "score": 1.007152}, {"Vertex_ID": "O", "score": 1.007152}, {"Vertex_ID": "I", "score": 1.002082}, {"Vertex_ID": "L", "score": 1.002082}, {"Vertex_ID": "H", "score": 1.000986}, {"Vertex_ID": "M", "score": 1.000986}, {"Vertex_ID": "J", "score": 1.00026}, {"Vertex_ID": "K", "score": 1.00026}, {"Vertex_ID": "T", "score": 0.6554276}, {"Vertex_ID": "A", "score": 0.6554276}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Line_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.010307351836075132}, {"Vertex_ID": "B", "score": 0.019068653273054674}, {"Vertex_ID": "C", "score": 0.026515787505709494}, {"Vertex_ID": "D", "score": 0.03284585745131274}, {"Vertex_ID": "E", "score": 0.03822640263682678}, {"Vertex_ID": "F", "score": 0.0427998335627278}, {"Vertex_ID": "G", "score": 0.046687200921397436}, {"Vertex_ID": "H", "score": 0.049991399441354015}, {"Vertex_ID": "I", "score": 0.05279989116293594}, {"Vertex_ID": "J", "score": 0.055187020230237145}, {"Vertex_ID": "K", "score": 0.05721598047140236}, {"Vertex_ID": "L", "score": 0.05894048784859933}, {"Vertex_ID": "M", "score": 0.0604062020468127}, {"Vertex_ID": "N", "score": 0.0616519348302555}, {"Vertex_ID": "O", "score": 0.06271067715089663}, {"Vertex_ID": "P", "score": 0.06361047219594917}, {"Vertex_ID": "Q", "score": 0.06437515748315642}, {"Vertex_ID": "R", "score": 0.06502499564640625}, {"Vertex_ID": "S", "score": 0.06558121834760403}, {"Vertex_ID": "T", "score": 0.06605347595728643}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "J", "score": 0.8031256}, {"Vertex_ID": "I", "score": 0.768383}, {"Vertex_ID": "H", "score": 0.7275094}, {"Vertex_ID": "G", "score": 0.6794229}, {"Vertex_ID": "F", "score": 0.6228504}, {"Vertex_ID": "E", "score": 0.5562946}, {"Vertex_ID": "D", "score": 0.4779937}, {"Vertex_ID": "C", "score": 0.385875}, {"Vertex_ID": "B", "score": 0.2775}, {"Vertex_ID": "A", "score": 0.15}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Ring.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.05}, {"Vertex_ID": "B", "score": 0.05}, {"Vertex_ID": "C", "score": 0.05}, {"Vertex_ID": "D", "score": 0.05}, {"Vertex_ID": "E", "score": 0.05}, {"Vertex_ID": "F", "score": 0.05}, {"Vertex_ID": "G", "score": 0.05}, {"Vertex_ID": "H", "score": 0.05}, {"Vertex_ID": "I", "score": 0.05}, {"Vertex_ID": "J", "score": 0.05}, {"Vertex_ID": "K", "score": 0.05}, {"Vertex_ID": "L", "score": 0.05}, {"Vertex_ID": "M", "score": 0.05}, {"Vertex_ID": "N", "score": 0.05}, {"Vertex_ID": "O", "score": 0.05}, {"Vertex_ID": "P", "score": 0.05}, {"Vertex_ID": "Q", "score": 0.05}, {"Vertex_ID": "R", "score": 0.05}, {"Vertex_ID": "S", "score": 0.05}, {"Vertex_ID": "T", "score": 0.05}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "Q", "score": 1}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Ring_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.05}, {"Vertex_ID": "B", "score": 0.05}, {"Vertex_ID": "C", "score": 0.05}, {"Vertex_ID": "D", "score": 0.05}, {"Vertex_ID": "E", "score": 0.05}, {"Vertex_ID": "F", "score": 0.05}, {"Vertex_ID": "G", "score": 0.05}, {"Vertex_ID": "H", "score": 0.05}, {"Vertex_ID": "I", "score": 0.05}, {"Vertex_ID": "J", "score": 0.05}, {"Vertex_ID": "K", "score": 0.05}, {"Vertex_ID": "L", "score": 0.05}, {"Vertex_ID": "M", "score": 0.05}, {"Vertex_ID": "N", "score": 0.05}, {"Vertex_ID": "O", "score": 0.05}, {"Vertex_ID": "P", "score": 0.05}, {"Vertex_ID": "Q", "score": 0.05}, {"Vertex_ID": "R", "score": 0.05}, {"Vertex_ID": "S", "score": 0.05}, {"Vertex_ID": "T", "score": 0.05}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "I", "score": 1}, {"Vertex_ID": "F", "score": 1}, {"Vertex_ID": "J", "score": 1}, {"Vertex_ID": "H", "score": 1}, {"Vertex_ID": "A", "score": 1}, {"Vertex_ID": "G", "score": 1}, {"Vertex_ID": "D", "score": 1}, {"Vertex_ID": "E", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "C", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "B", "score": 1}, {"Vertex_ID": "Q", "score": 1}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Tree.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.04753738488500107}, {"Vertex_ID": "B", "score": 0.06909959193353464}, {"Vertex_ID": "C", "score": 0.07220759154455524}, {"Vertex_ID": "D", "score": 0.07130204500748627}, {"Vertex_ID": "E", "score": 0.07480080379154676}, {"Vertex_ID": "F", "score": 0.0785393029006319}, {"Vertex_ID": "G", "score": 0.0785393029006319}, {"Vertex_ID": "H", "score": 0.07804404762676867}, {"Vertex_ID": "I", "score": 0.07804404762676867}, {"Vertex_ID": "J", "score": 0.054902205374844214}, {"Vertex_ID": "K", "score": 0.02869374578323252}, {"Vertex_ID": "L", "score": 0.02975219252757403}, {"Vertex_ID": "M", "score": 0.02975219252757403}, {"Vertex_ID": "N", "score": 0.02975219252757403}, {"Vertex_ID": "O", "score": 0.02975219252757403}, {"Vertex_ID": "P", "score": 0.029611982345715077}, {"Vertex_ID": "Q", "score": 0.029611982345715077}, {"Vertex_ID": "R", "score": 0.029611982345715077}, {"Vertex_ID": "S", "score": 0.029611982345715077}, {"Vertex_ID": "T", "score": 0.030833231131841908}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "C", "score": 1.507026}, {"Vertex_ID": "E", "score": 1.503473}, {"Vertex_ID": "F", "score": 1.49345}, {"Vertex_ID": "G", "score": 1.49345}, {"Vertex_ID": "I", "score": 1.485403}, {"Vertex_ID": "H", "score": 1.485403}, {"Vertex_ID": "D", "score": 1.483297}, {"Vertex_ID": "B", "score": 1.367901}, {"Vertex_ID": "J", "score": 1.09461}, {"Vertex_ID": "A", "score": 0.9330747}, {"Vertex_ID": "O", "score": 0.6221145}, {"Vertex_ID": "L", "score": 0.6221145}, {"Vertex_ID": "N", "score": 0.6221145}, {"Vertex_ID": "M", "score": 0.6221145}, {"Vertex_ID": "R", "score": 0.6187774}, {"Vertex_ID": "P", "score": 0.6187774}, {"Vertex_ID": "Q", "score": 0.6187774}, {"Vertex_ID": "S", "score": 0.6187774}, {"Vertex_ID": "T", "score": 0.6181464}, {"Vertex_ID": "K", "score": 0.5711977}]}]
2 changes: 1 addition & 1 deletion tests/data/baseline/centrality/pagerank/Tree_Directed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"@@top_scores_heap": [{"Vertex_ID": "A", "score": 0.030283038177750167}, {"Vertex_ID": "B", "score": 0.043153655387605856}, {"Vertex_ID": "C", "score": 0.043153655387605856}, {"Vertex_ID": "D", "score": 0.04862366075639622}, {"Vertex_ID": "E", "score": 0.04862366075639622}, {"Vertex_ID": "F", "score": 0.04862366075639622}, {"Vertex_ID": "G", "score": 0.04862366075639622}, {"Vertex_ID": "H", "score": 0.05094809395836327}, {"Vertex_ID": "I", "score": 0.05094809395836327}, {"Vertex_ID": "J", "score": 0.05094809395836327}, {"Vertex_ID": "K", "score": 0.05094809395836327}, {"Vertex_ID": "L", "score": 0.05094809395836327}, {"Vertex_ID": "M", "score": 0.05094809395836327}, {"Vertex_ID": "N", "score": 0.05094809395836327}, {"Vertex_ID": "O", "score": 0.05094809395836327}, {"Vertex_ID": "P", "score": 0.051935549088716185}, {"Vertex_ID": "Q", "score": 0.051935549088716185}, {"Vertex_ID": "R", "score": 0.051935549088716185}, {"Vertex_ID": "S", "score": 0.051935549088716185}, {"Vertex_ID": "T", "score": 0.07358805999968221}]}]
[{"@@top_scores_heap": [{"Vertex_ID": "T", "score": 1}, {"Vertex_ID": "S", "score": 1}, {"Vertex_ID": "K", "score": 1}, {"Vertex_ID": "L", "score": 1}, {"Vertex_ID": "O", "score": 1}, {"Vertex_ID": "R", "score": 1}, {"Vertex_ID": "N", "score": 1}, {"Vertex_ID": "M", "score": 1}, {"Vertex_ID": "P", "score": 1}, {"Vertex_ID": "Q", "score": 1}, {"Vertex_ID": "I", "score": 0.2523586}, {"Vertex_ID": "H", "score": 0.2523586}, {"Vertex_ID": "J", "score": 0.2523586}, {"Vertex_ID": "E", "score": 0.2408437}, {"Vertex_ID": "D", "score": 0.2408437}, {"Vertex_ID": "G", "score": 0.2408437}, {"Vertex_ID": "F", "score": 0.2408437}, {"Vertex_ID": "C", "score": 0.21375}, {"Vertex_ID": "B", "score": 0.21375}, {"Vertex_ID": "A", "score": 0.15}]}]
4 changes: 2 additions & 2 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
clear
python3 test/setup.py &&
# python3 test/baseline/create_baselines.py &&
# pytest test/test_centrality.py::TestCentrality::test_degree_centrality1 #test/test_ml.py
pytest test/test_centrality.py::TestCentrality::test_pagerank
# pytest test/test_centrality.py::TestCentrality::test_pagerank
# pytest test/test_ml.py
pytest test/test_centrality.py::TestCentrality
echo 'done'
Loading

0 comments on commit 2070416

Please sign in to comment.