@@ -21,7 +21,7 @@ applied to each node.
2121This traveral happens in the order in which the nodes are stored in the graph.
2222This order is arbitrary and may vary across executions of the code (it does not
2323correspond to the order in which nodes are created). For algorithms that require
24- a particular traveral order of the graph, see `traversedfs ` and `traversebfs `.
24+ a particular traveral order of the graph, see `traverse_dfs ` and `traverse_bfs `.
2525
2626This function does not store any results generated by `fun`. Hence, if the user
2727wants to keep track of such results, they should be stored indirectly (e.g., via
@@ -71,15 +71,15 @@ function traverse(g::StaticGraph; fun = () -> nothing, order = "any", ID = root_
7171 fun (data (val))
7272 end
7373 elseif order == " dfs"
74- traversedfs (g:: Graph ; fun = fun, ID = ID)
74+ traverse_dfs (g:: Graph ; fun = fun, ID = ID)
7575 elseif order == " bfs"
76- traversebfs (g:: Graph ; fun = fun, ID = ID)
76+ traverse_bfs (g:: Graph ; fun = fun, ID = ID)
7777 end
7878 return nothing
7979end
8080
8181"""
82- traversedfs (g::Graph; fun = () -> nothing, ID = root_id(g))
82+ traverse_dfs (g::Graph; fun = () -> nothing, ID = root_id(g))
8383
8484Iterates over all the nodes in the graph (depth-first order, starting at a any
8585node) and execute for the function `fun` on each node
@@ -98,7 +98,7 @@ This traveral happens in a depth-first order. That is, all nodes in a branch of
9898the graph are visited until reach a leaf node, then moving to the next branch.
9999Hence, this algorithm should always generate the same result when applied to the
100100same graph (assuming the user-defined function is not stochastic). For a version
101- of this function that us breadth-first order see `traversebfs `.
101+ of this function that us breadth-first order see `traverse_bfs `.
102102
103103This function does not store any results generated by `fun`. Hence, if the user
104104wants to keep track of such results, they should be stored indirectly (e.g., via
@@ -129,7 +129,7 @@ julia> let
129129 f = Foo(Int[])
130130 axiom = A1(2) + (B1(1) + A1(3), B1(4))
131131 g = Graph(axiom = axiom)
132- traversedfs (g, fun = f)
132+ traverse_dfs (g, fun = f)
133133 f.vals
134134 end
1351354-element Vector{Int64}:
@@ -139,11 +139,11 @@ julia> let
139139 3
140140```
141141"""
142- function traversedfs (g:: Graph ; fun = () -> nothing , ID = root_id (g))
143- traversedfs (static_graph (g), fun, ID)
142+ function traverse_dfs (g:: Graph ; fun = () -> nothing , ID = root_id (g))
143+ traverse_dfs (static_graph (g), fun, ID)
144144end
145145
146- function traversedfs (g:: StaticGraph , fun, ID)
146+ function traverse_dfs (g:: StaticGraph , fun, ID)
147147 # Use LIFO stack to keep track of nodes in traversal
148148 node_stack = Int[]
149149 push! (node_stack, ID)
@@ -161,7 +161,7 @@ function traversedfs(g::StaticGraph, fun, ID)
161161end
162162
163163"""
164- traversebfs (g::Graph; fun = () -> nothing, ID = root_id(g))
164+ traverse_bfs (g::Graph; fun = () -> nothing, ID = root_id(g))
165165
166166Iterates over all the nodes in the graph (breadth-first order, starting at a any
167167node) and execute for the function `fun` on each node
@@ -180,7 +180,7 @@ This traveral happens in a breadth-first order. That is, all nodes at a given
180180depth of the the graph are visited first, then moving on to the next level.
181181Hence, this algorithm should always generate the same result when applied to the
182182same graph (assuming the user-defined function is not stochastic). For a version
183- of this function that us depth-first order see `traversedfs `.
183+ of this function that us depth-first order see `traverse_dfs `.
184184
185185This function does not store any results generated by `fun`. Hence, if the user
186186wants to keep track of such results, they should be stored indirectly (e.g., via
@@ -211,7 +211,7 @@ julia> let
211211 f = Foo(Int[])
212212 axiom = A1(2) + (B1(1) + A1(3), B1(4))
213213 g = Graph(axiom = axiom)
214- traversebfs (g, fun = f)
214+ traverse_bfs (g, fun = f)
215215 f.vals
216216 end
2172174-element Vector{Int64}:
@@ -221,11 +221,11 @@ julia> let
221221 3
222222```
223223"""
224- function traversebfs (g:: Graph ; fun = () -> nothing , ID = root_id (g))
225- traversebfs (static_graph (g), fun, ID)
224+ function traverse_bfs (g:: Graph ; fun = () -> nothing , ID = root_id (g))
225+ traverse_bfs (static_graph (g), fun, ID)
226226end
227227
228- function traversebfs (g:: StaticGraph , fun, ID)
228+ function traverse_bfs (g:: StaticGraph , fun, ID)
229229 # Use LIFO stack to keep track of nodes in traversal
230230 node_stack = Int[]
231231 prepend! (node_stack, ID)
0 commit comments