Skip to content

get_shortest_path doesn't work correctly on undirected graphs #37

Closed

Description

@liveforeverx

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.

Activity

  1. slemonide commented on May 6, 2020

    @slemonide

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

  2. bitwalker commented on May 18, 2020

    @bitwalker
    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.

  3. Minh-Khang commented on Oct 11, 2020

    @Minh-Khang
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions