libgraph icon indicating copy to clipboard operation
libgraph copied to clipboard

Functions delegate to Graph.Directed for undirected graph

Open achan1989 opened this issue 5 years ago • 1 comments

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

achan1989 avatar Jul 06 '20 14:07 achan1989

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]

tcoopman avatar Sep 23 '22 17:09 tcoopman