bitwalker / bitwalker/libgraph

get_shortest_path doesn't work correctly on undirected graphs

Open
#37 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
571
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Hi!

I found an example, where `get_shortest_path` didn't works, where it looks like it should:

```elixir
g = Graph.new(type: :undirected) |> Graph.add_vertices([1, 2, 3]) |> Graph.add_edge(1, 3) |> Graph.add_edge(3, 2)
Graph.get_shortest_path(g, 1, 2) # => nil
```

I think, that `get_shortest_path` should raise on undirected graphs or calculate path correctly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.