-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stdlib: Fix preorder and postorder traversals in
digraph_utils
The previous `digraph_utils:preorder/1` and `digraph_utils:postorder/1` did not start the traversal from root nodes. This fix makes both traversals only start or restart from a root node in one of the components, or an arbitrary node if no root node can be visited. Since in the previous version, the search can start and restart from arbitrary nodes, this fix should not break backwards compatibility. It is worth noting that the digraph does not have a notion of a left or right subtree. The result of both traversals may not be the same after relabelling vertices.
- Loading branch information
Showing
2 changed files
with
56 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters