https://github.com/crodas/pagerank-rs
Generic PageRank algorithm implementation in Rust with no external dependency
https://github.com/crodas/pagerank-rs
algorithm pagerank ranking rust sorting
Last synced: 4 months ago
JSON representation
Generic PageRank algorithm implementation in Rust with no external dependency
- Host: GitHub
- URL: https://github.com/crodas/pagerank-rs
- Owner: crodas
- License: mit
- Created: 2021-03-21T23:43:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T17:21:08.000Z (almost 4 years ago)
- Last Synced: 2025-06-12T01:06:18.158Z (4 months ago)
- Topics: algorithm, pagerank, ranking, rust, sorting
- Language: Rust
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple page rank
Very simple implementation of the [PageRank](http://ilpubs.stanford.edu:8090/422/1/1999-66.pdf) algorithm.
### Features
- Small footprint
- Zero dependency
- Easy to use API
- Fast
`
### Usage```rust
let mut pr = Pagerank::<&str>::new();
pr.add_edge("source", "target");
pr.add_edge("source", "another target");
pr.calculate();// print result (always sorted)
pr.nodes()
.iter()
.map(|(node, score)| println!("page {} with score {}", node, score))
.for_each(drop);
```### Built-in binary example
The repository has a built-in binary example which works with [WikiLinkGraphs](https://zenodo.org/record/2539424) dataset.
```
gzcat eswiki.wikilink_graph.2018-03-01.csv.gz| cargo run --release wikilink
```