Skip to content

Commit 096589d

Browse files
committed
Preparing for a release.
1 parent e67a3d7 commit 096589d

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,46 @@ Single-Source Shortest Path (SSSP) implementation in modern C++ for 2022 IPDPS w
66
| Ubuntu | [Ubuntu 20.04](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) | [![Ubuntu](https://github.com/neoblizz/sssp/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/neoblizz/sssp/actions/workflows/ubuntu.yml) |
77
| Windows | [Windows Server 2019](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) | [![Windows](https://github.com/neoblizz/sssp/actions/workflows/windows.yml/badge.svg)](https://github.com/neoblizz/sssp/actions/workflows/windows.yml) |
88

9-
## Requirements
10-
- `C++20` for linux, `C++23` for windows.
11-
- `cmake` version 3.22.2.
12-
- `tbb` library for execution policies (automatically fetched using cmake).
9+
## Dependencies
10+
- `C++20` for linux (requires `gcc/g++-10.1` or higher), `C++23` for windows.
11+
- `cmake` version `3.22.2`.
12+
- `tbb` library for execution policies (automatically fetched using `cmake`).
13+
14+
## Implementation Detail
15+
This code base makes use of modern C++ features such as `ranges`, `execution_policy`, and lambda expressions to implement the essential components for parallel graph analytics. We focus on a simple implementation of Single-Source Shortest Path (SSSP), but the concepts can easily be extended to support other graph algorithms such as Breadth-First Search with minor changes to the lambda expression during traversal.
16+
17+
### SSSP Traversal Condition
18+
```cpp
19+
[&](vertex_t const& src, // source
20+
vertex_t const& dst, // destination
21+
edge_t const& edge, // edge
22+
weight_t const& weight // weight
23+
) {
24+
weight_t new_d = distances[src] + weight;
25+
weight_t curr_d = atomic::min(&distances[dst], new_d, m_locks[dst]);
26+
return new_d < curr_d;
27+
};
28+
```
29+
30+
### BFS Traversal Condition
31+
```cpp
32+
[&](vertex_t const& src, // source
33+
vertex_t const& dst, // destination
34+
edge_t const& edge, // edge
35+
weight_t const& weight // weight
36+
) {
37+
// If the neighbor is not visited, update the distance. Returning false
38+
// here means that the neighbor is not added to the output frontier, and
39+
// instead an invalid vertex is added in its place. These invalides (-1 in
40+
// most cases) can be removed using a filter operator or uniquify.
41+
if (distances[dst] != std::numeric_limits<vertex_t>::max())
42+
return false;
43+
else
44+
return (atomic::cas(
45+
&distances[dst], std::numeric_limits<vertex_t>::max(),
46+
iteration + 1) == std::numeric_limits<vertex_t>::max(), m_locks[dst]);
47+
};
48+
```
1349

1450
## Quick Start Guide
1551
Before building this project, make sure your system/compiler supports **C++20** and **cmake**.

0 commit comments

Comments
 (0)