39 #include "./pgr_dijkstra.hpp"
40 #include "./one_to_many_dijkstra_driver.h"
43 #include "../../common/src/memory_func.hpp"
45 #include "./../../common/src/pgr_types.h"
50 do_pgr_one_to_many_dijkstra(
55 size_t size_end_vidsArr,
61 std::ostringstream log;
63 graphType gType = directed? DIRECTED: UNDIRECTED;
64 const auto initial_size = total_tuples;
66 std::deque< Path >paths;
67 log <<
"Inserting vertices into a c++ vector structure\n";
68 std::set< int64_t > s_end_vertices(end_vidsArr, end_vidsArr + size_end_vidsArr);
69 std::vector< int64_t > end_vertices(s_end_vertices.begin(), s_end_vertices.end());
73 log <<
"Working with directed Graph\n";
75 digraph.graph_insert_data(data_edges, total_tuples);
76 pgr_dijkstra(digraph, paths, start_vid, end_vertices, only_cost);
78 log <<
"Working with Undirected Graph\n";
80 undigraph.graph_insert_data(data_edges, total_tuples);
81 pgr_dijkstra(undigraph, paths, start_vid, end_vertices, only_cost);
85 count = count_tuples(paths);
89 (*return_tuples) = NULL;
92 "No paths found between Starting and any of the Ending vertices\n";
93 *err_msg = strdup(log.str().c_str());
97 (*return_tuples) = get_memory(count, (*return_tuples));
98 log <<
"Converting a set of paths into the tuples\n";
99 (*return_count) = (collapse_paths(return_tuples, paths));
102 *err_msg = strdup(
"OK");
104 *err_msg = strdup(log.str().c_str());
109 log <<
"Caught unknown expection!\n";
110 *err_msg = strdup(
"Caught unknown expection!\n");