edgewise

Crates.ioedgewise
lib.rsedgewise
version0.1.0
created_at2025-11-30 18:26:32.025793+00
updated_at2025-11-30 18:26:32.025793+00
descriptionA simple graph library with BFS, DFS, Dijkstra, and random graph generation.
homepagehttps://github.com/alexfedotov/edgewise
repositoryhttps://github.com/alexfedotov/edgewise
max_upload_size
id1958589
size34,448
Alex Fedotov (alexfedotov)

documentation

https://docs.rs/edgewise

README

edgewise

edgewise is a lightweight and ergonomic Rust 🦀 library for working with graphs.

It provides:

  • A simple adjacency-list graph structure
  • Random graph generation ((un)weighted, (un)directed)
  • Breadth-First Search (BFS)
  • Depth-First Search (DFS)
  • Dijkstra’s shortest-path algorithm

Example

use edgewise::{Graph, Weighted};

let g = Graph::new(vec![
    vec![(1, Weighted(4)), (2, Weighted(1))],
    vec![(3, Weighted(1))],
    vec![(1, Weighted(2))],
    vec![],
]);

let distances = g.dijkstra(0)?;
println!("{:?}", distances);

Installation

[dependencies]
edgewise = "0.1"

License

MIT or Apache-2.0

Commit count: 0

cargo fmt