3 ms·
> Why don't we have graphs ... in Rust? You might have missed this from the article but: https://docs.rs/petgraph/latest/petgraph/index.html https://docs.rs/pe
by bigbillheck 3y ago
> Why don't we have graphs ... in Rust?
You might have missed this from the article but: https://docs.rs/petgraph/latest/petgraph/index.html https://docs.rs/petgraph/latest/petgraph/index.html
> Because graphs require mutation (respectively break linearity).
I don't think this is actually the case. Graph nodes go in one container (`Vec` or `HashMap` or `BTreeMap`), and the edges go in another container (`HashMap` or `BTreeMap`). The object in which you store the node only needs to know what its name is, you can let something else know what its neighbors are.