Open ctbucha opened 5 years ago
There are more places that do not support bidirectional graphs. Here is example:
g = (
Graph.new(type: :undirected)
|> Graph.add_edge(1, 2, weight: 1)
|> Graph.add_edge(2, 3, weight: 2)
|> Graph.add_edge(1, 3, weight: 3)
)
Then when we trying to find path in this graph it works like it’s not undirected:
iex(52)> Graph.a_star(g, 1, 2, fn _v -> 0 end)
[1, 2]
iex(53)> Graph.a_star(g, 2, 1, fn _v -> 0 end)
nil
I think the issue @ctbucha describes is about multi graphs, which are not supported. See the feature request #18
@AndrewDryga is describing a bug this lib haves with undirected graphs. I will look at it and submit a pr.
any news about this? i have the same problem @AndrewDryga described
Graph.edges/2 only returns a single direction of edges from one vertex
:a
to another vertex:b
instead of both directions from the vertex:a
to the other vertex:b
.Expected: