Skip to content

Commit d58ce0e

Browse files
committed
.
1 parent ff547ad commit d58ce0e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
11
# fast-graph
22

33
Graph algorithms implemented in Rust, available as a Python package.
4+
5+
So far, there is only one function implemented: `all_pairs_dijkstra_path_length`.
6+
7+
## Installation
8+
9+
```bash
10+
pip install fast-graph
11+
```
12+
13+
## Usage
14+
15+
```python
16+
from fast_graph import all_pairs_dijkstra_path_length
17+
18+
weighted_edges = [
19+
(0, 1, 1.0),
20+
(1, 2, 2.0),
21+
(2, 3, 3.0),
22+
(3, 0, 4.0),
23+
(0, 3, 5.0),
24+
]
25+
26+
shortest_paths = all_pairs_dijkstra_path_length(weighted_edges, cutoff=3.0)
27+
```
28+
29+
```python
30+
>>> shortest_paths
31+
{3: {3: 0.0, 2: 3.0}, 2: {2: 0.0, 1: 2.0, 0: 3.0, 3: 3.0}, 1: {0: 1.0, 2: 2.0, 1: 0.0}, 0: {1: 1.0, 0: 0.0, 2: 3.0}}
32+
```
33+
34+
## Benchmark
35+

0 commit comments

Comments
 (0)