#safe #graph #petgraph #graph-map


Graph implementation (refactored version of GraphMap from popular crate petgraph)

6 releases

0.1.6 Feb 9, 2019
0.1.5 Feb 4, 2019

#968 in Data structures

Download history 10/week @ 2022-04-22 44/week @ 2022-04-29 43/week @ 2022-05-06 106/week @ 2022-05-13 24/week @ 2022-05-20 44/week @ 2022-05-27 47/week @ 2022-06-03 4/week @ 2022-06-10 8/week @ 2022-06-17 6/week @ 2022-06-24 10/week @ 2022-07-01 10/week @ 2022-07-08 16/week @ 2022-07-15 19/week @ 2022-07-22 6/week @ 2022-07-29 16/week @ 2022-08-05

57 downloads per month
Used in 2 crates

GPL-3.0 license


Safe Graph

Rust implementation of Graph, being refactored version of GraphMap from popular petgraph crate.

Crate Documentation Travis CI CodeCov
Crate Documentation Build Status codecov

Refactoring Reasons

  • I don't like to use a big library with a large codebase when I need just a piece of it (in my case GraphMap). It is a high risk of introducing way in for mailicious attackers.
  • Petgraph has almost no tests and I wanted to have a high/full test coverage, so I’ve added tests in.
  • Petgraph has ordermap crate as a dependency, but it is outdated and not stable. Its current stable version was renamed to indexmap, so I've updated to it.
  • I’ve done a few other modifications according to best practice.
  • Petgraph crate doesn't have a stable release version yet and I didn't want to depend on it.


  • I'm going to contact autors of Petgraph to offer them integrate my improvements.
  • I'm thinking about refactoring of Petgraph into more modular collection of smaller Graph libraries with better Test Coverage and more structured separation of functionality.


Licensed under the General Public License (GPL), version 3 (LICENSE http://www.gnu.org/licenses/gpl-3.0.en.html).


~10K SLoC