bitwalker / libgraph

A graph data structure library for Elixir projects
MIT License
524 stars 75 forks source link

Functions delegate to Graph.Directed for undirected graph #39

Open achan1989 opened 4 years ago

achan1989 commented 4 years ago

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:

tcoopman commented 1 year ago

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]