libgraph
libgraph copied to clipboard
Functions delegate to Graph.Directed for undirected graph
Aside from pathfinding issues #37 and #11, several of the Graph functions delegate to Graph.Directed in a way that is inapproriate for undirected graphs:
- is_acyclic?
- components
- strong_components
- reachable
- reachable_neighbors
- reaching
- reaching_neighbors
- preorder
- postorder
- loop_vertices
I just ran into this. A basic exampe of what's not working:
> g = Graph.new(type: :undirected) |> Graph.add_edges([{:a, :b}, {:b, :c}])
> Graph.reachable(g, [:c])
[]
But it should return [:a, :b, :c]