@@ -422,16 +422,26 @@ Encode a set of 2-colored trees resulting from the [`acyclic_coloring`](@ref) al
422422$TYPEDFIELDS
423423"""
424424struct TreeSet{T}
425+ """
426+ contains the reverse breadth first (BFS) traversal order for each tree in the forest.
427+ More precisely, given an edge `(u, v)` of index `i`,
428+ `reverse_bfs_order[i]` is either `(u, v)` or `(v, u)`.
429+ The first node of the tuple is the leaf in the reverse BFS order.
430+ """
425431 reverse_bfs_orders:: Vector{Tuple{T,T}}
432+ " For a tree index `1 <= k <= nt`, `is_star[k]` indicates whether the `k`th three is a star."
426433 is_star:: Vector{Bool}
434+ " `tree_edge_indices[1]` is one and `tree_edge_indices[k+1] - tree_edge_indices[k]` is the number of edges in the `k`th tree"
427435 tree_edge_indices:: Vector{T}
436+ " numbers of 2-colored trees for which trees sharing the same 2 colors have disjoint vertices"
428437 nt:: T
429438end
430439
431440function TreeSet (
432441 g:: AdjacencyGraph{T} ,
433442 forest:: Forest{T} ,
434443 buffer:: AbstractVector{T} ,
444+ # The value of `reverse_bfs_orders` is ignored, we just reuse its memory
435445 reverse_bfs_orders:: Vector{Tuple{T,T}} ,
436446 ne:: Integer ,
437447) where {T}
@@ -566,7 +576,6 @@ function TreeSet(
566576 # Number of edges treated
567577 num_edges_treated = zero (T)
568578
569- # reverse_bfs_orders contains the reverse breadth first (BFS) traversal order for each tree in the forest
570579 for k in 1 : nt
571580 # Initialize the queue to store the leaves
572581 queue_start = 1
0 commit comments