Skip to content

Commit

Permalink
Fix dfs_tree doc. (#367)
Browse files Browse the repository at this point in the history
(mostly copied from current `bfs_tree` doc)
  • Loading branch information
iago-lito authored Apr 25, 2024
1 parent ab8e72b commit afb8245
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/traversals/dfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ function topological_sort_by_dfs end
end

"""
dfs_tree(g, s)
dfs_tree(g, s[;dir=:out])
Return an ordered vector of vertices representing a directed acyclic graph based on
depth-first traversal of the graph `g` starting with source vertex `s`.
Provide a depth-first traversal of the graph `g` starting with source vertex `s`,
and return a directed acyclic graph of vertices in the order they were discovered.
If `dir` is specified, use the corresponding edge direction (`:in` and `:out` are
acceptable values).
"""
dfs_tree(g::AbstractGraph, s::Integer; dir=:out) = tree(dfs_parents(g, s; dir=dir))

Expand Down

0 comments on commit afb8245

Please sign in to comment.