Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_shortest_path doesn't work correctly on undirected graphs #37

Open
liveforeverx opened this issue Jan 29, 2020 · 3 comments
Open

get_shortest_path doesn't work correctly on undirected graphs #37

liveforeverx opened this issue Jan 29, 2020 · 3 comments

Comments

@liveforeverx
Copy link

Hi!

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

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.

@slemonide
Copy link

This seems to be a general problem, see issue #11 .

@bitwalker
Copy link
Owner

The pathfinding has not been implemented for undirected graphs yet, but if anyone is interested in lending a hand there, I'd love to get support fleshed out so that we can get it addressed. I'm happy to lend a hand in review or with suggestions on how to approach it for anyone not sure where to start.

@Minh-Khang
Copy link
Contributor

The pathfinding has not been implemented for undirected graphs yet, but if anyone is interested in lending a hand there, I'd love to get support fleshed out so that we can get it addressed. I'm happy to lend a hand in review or with suggestions on how to approach it for anyone not sure where to start.

Hello, I made a implementation for finding shortest path on undirected graphs. Could you review it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants