Skip to content

Commit 28a2970

Browse files
authored
Merge pull request #112 from stdgraph/comparison
update comparison shortest distance fix
2 parents 976fcfb + ca424d9 commit 28a2970

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

D3337_Comparison.pdf

1.72 KB
Binary file not shown.

D3337_Comparison/src/bgl_bfs.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ vector<VId> parents(num_vertices(g));
1212
auto vis = make_bfs_visitor(
1313
make_pair(record_predecessors(parents.begin(), on_tree_edge())));
1414

15+
1516
breadth_first_search(g, vertex(0, g), visitor(vis));

D3337_Comparison/src/bgl_sssp.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using namespacee std;
1+
using namespace std;
22
using namespace boost;
33

44
using G =

D3337_Comparison/src/stdgraph_bfs.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ using namespace graph;
44
using G = container::compressed_graph<void, void, void, uint32_t, uint32_t>;
55
using VId = vertex_id_t<G>;
66

7-
87
G g;
98
// populate g
109

1110
vector<VId> parents(size(vertices(g));
1211

1312
auto bfs = edges_breadth_first_search_view<G,void,true>(g, 0);
1413

14+
1515
for (auto&& [uid, vid, uv] : bfs) {
1616
parents[vid] = uid;
1717
}

D3337_Comparison/src/stdgraph_sssp.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ auto weight_fn = [&g](graph::edge_reference_t<graph_type> uv) -> int {
1717

1818

1919

20-
dijkstra_shortest_distances(g, 0, d, p, weight_fn);
20+
21+
dijkstra_shortest_paths(g, 0, d, p, weight_fn);

D3337_Comparison/tex/comparison.tex

+9-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ \subsection{Experimental Setup}
144144
To evaluate the performance of this proposed library, we compare its reference implementation
145145
(\textbf{std::graph}) against \textbf{boost::graph} and NWGraph on a subset of the GAP Benchmark Suite\cite{gapbs_2023}.
146146
This comparison includes four of the five GAP algorithms that are in the tier 1 algorithm list of this proposal:
147-
triangle counting (TC), weak connected components (CC), breadth-first search (BFS),
147+
triangle counting (TC), connected components (CC), breadth-first search (BFS),
148148
and single-source shortest paths (SSSP).
149149
Table~\ref{tab:gap_graphs} summarizes the graphs specified by the GAP benchmark.
150150
These graphs were chosen to be large but still fit on shared memory machines and have edge counts in the billions.
@@ -175,7 +175,14 @@ \subsection{Experimental Setup}
175175
NWGraph and \textbf{std::graph} were compiled with gcc 13.2 using -Ofast -march=native compilation flags.
176176

177177
Even though NWGraph contains an implementation of Dijkstra, the SSSP results in \cite{REF_nwgraph_library}
178-
were based on delta-stepping. For this comparison, \textbf{std::graph} and NWgraph both use Dijkstra.
178+
were based on delta-stepping. For this comparison, \textbf{std::graph} and NWGraph both use Dijkstra.
179+
The NWGraph implementations also used a version of SSSP which did not compute
180+
a predecessor map, only providing the final distances.
181+
\textbf{std::graph} provides SSSP without predecessors called $dijkstra\_shortest\_distances$ which is similar to the Dijkstra in
182+
Figure~\ref{fig:ssspsyntax} with the predecessor argument omitted.
183+
\textbf{boost::graph} can also compute shortest distances only by omitting the predecessor map.
184+
We use the shortest distance version for these experiments.
185+
179186
The NWGraph and \textbf{std::graph} implementation of CC is based on the Afforest \cite{sutton2018optimizing} algorithm.
180187
While BFS and SSSP implementations are very similar for NWGraph and \textbf{std::graph}, the latter contains
181188
support for event-based visitors.

0 commit comments

Comments
 (0)