- How to deal with the edge with the smallest weight that can be filtered from the accumulator of a storage edge?
- How to call another query repeatedly in one query?
The algorithm of all_pairs shortest path is used, but only one starting node can be input at runtime. How to input multiple starting nodes to reflect its multi-source characteristics?
I don’t quite understand what you are asking.
“deal with”: Do you want to find the edge with lowest weight, from some collection of edges? How is this collection of edges defined?
“accumulator of a storage edge”: I don’t follow.
You can put the call inside a loop (WHILE or FOREACH). I believe you can also have it in the ACCUM clause of SELECT statement.
The k_means algorithm in the Graph Data Science Library has an example with a FOREACH loop:
Note that the All-Pairs Shortest Path GSQL code at All-Pairs Shortest Path :: TigerGraph Graph Data Science Library is an example, rather than an official part of the Graph Data Science Library.
This query’s input parameters do not include any individual vertices, only the vertex types.
CREATE QUERY tg_all_pairs_shortest( SET v_type_set, SET e_type_set,
STRING wt_attr, STRING wt_type, STRING result_attribute = “”, STRING file_path = “”)