Skip to content

Functions delegate to Graph.Directed for undirected graph #39

Open

Description

@achan1989

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:

  • is_acyclic?
  • components
  • strong_components
  • reachable
  • reachable_neighbors
  • reaching
  • reaching_neighbors
  • preorder
  • postorder
  • loop_vertices

Activity

  1. tcoopman commented on Sep 23, 2022

    @tcoopman

    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]

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