Skip to content

Commit 0ce6e42

Browse files
committed
Document fields of TreeSet
1 parent 31999f1 commit 0ce6e42

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/coloring.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,26 @@ Encode a set of 2-colored trees resulting from the [`acyclic_coloring`](@ref) al
422422
$TYPEDFIELDS
423423
"""
424424
struct 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
429438
end
430439

431440
function 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

Comments
 (0)