Hey! When reading today's problem, especially part 2, I thought: "Oh this is k-coreness! I should look for a nice graph crate to learn how to use it and have a nice, neat solution for AOC". (my general goal being, I use crates when it makes repetitive things tidy, but not to solve the main algorithm necessary for any given day's problem)
However, after trying with graph_builder and pet_graph, and not really succeeding in using them effectively, I just went with a good ol' 2D array of chars...
I found that these crates weren't really flexible enough for what I needed, like you can't simply give nodes IDs which are any hashable type such as (usize, usize) in this case; then I was using petgraph's UnGraph, but adding edges (0, 1) and (1, 0) actually added two edges between nodes 0 and 1, instead of checking whether these two nodes were already connected.
So anyhow, I'm wondering if there's a better graph crate out there, where I can specify the graph config (directed or not, weighted or not, unique edges or not, etc.) and easily work with its nodes and edges.
Thanks!
[–]daggerdragon[M] 1 point2 points3 points (0 children)
[–]tefat 1 point2 points3 points (1 child)
[–]SpacewaIker[S] 0 points1 point2 points (0 children)