bitwalker / libgraph

A graph data structure library for Elixir projects
MIT License
524 stars 75 forks source link

Incorrect Return Value of Preorder/Postorder #67

Open georgevanderson opened 1 year ago

georgevanderson commented 1 year ago

How to reproduce:

These return the same ordering. This seems to be because the traversals are relying on Key ordering of the map

Graph.new() |> Graph.add_edges([{"123456", "b"}]) |> Graph.preorder
Graph.new() |> Graph.add_edges([{"123456", "b"}]) |> Graph.postorder

These do not return same ordering

Graph.new() |> Graph.add_edges([{"12345", "b"}]) |> Graph.preorder
Graph.new() |> Graph.add_edges([{"12345", "b"}]) |> Graph.postorder