Skip to content

Commit bbf63a2

Browse files
committed
Add additional comments in TreeSet
1 parent 7cd0dbe commit bbf63a2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/coloring.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ function TreeSet(forest::DisjointSets{Tuple{Int,Int}}, nvertices::Int)
538538
degrees[leaf] = 0
539539

540540
for neighbor in tree[leaf]
541+
# Check if neighbor is the parent of the leaf or if it was a child before the tree was pruned
541542
if degrees[neighbor] != 0
542543
# (leaf, neighbor) represents the next edge to visit during decompression
543544
push!(reverse_bfs_orders[k], (leaf, neighbor))
@@ -548,6 +549,7 @@ function TreeSet(forest::DisjointSets{Tuple{Int,Int}}, nvertices::Int)
548549
virtual_hub = neighbor
549550
else
550551
# Verify if the tree still qualifies as a star
552+
# If we find leaves with different parents, then it can't be a star
551553
if virtual_hub != neighbor
552554
bool_star = false
553555
end

0 commit comments

Comments
 (0)