-
Notifications
You must be signed in to change notification settings - Fork 8
Document fields of TreeSet #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -422,16 +422,26 @@ Encode a set of 2-colored trees resulting from the [`acyclic_coloring`](@ref) al | |
| $TYPEDFIELDS | ||
| """ | ||
| struct TreeSet{T} | ||
| """ | ||
| contains the reverse breadth first (BFS) traversal order for each tree in the forest. | ||
| More precisely, given an edge `(u, v)` of index `i`, | ||
| `reverse_bfs_order[i]` is either `(u, v)` or `(v, u)`. | ||
| The first node of the tuple is the leaf in the reverse BFS order. | ||
| """ | ||
| reverse_bfs_orders::Vector{Tuple{T,T}} | ||
| "For a tree index `1 <= k <= nt`, `is_star[k]` indicates whether the `k`th three is a star." | ||
| is_star::Vector{Bool} | ||
| "`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" | ||
|
blegat marked this conversation as resolved.
Outdated
blegat marked this conversation as resolved.
Outdated
|
||
| tree_edge_indices::Vector{T} | ||
| "numbers of 2-colored trees for which trees sharing the same 2 colors have disjoint vertices" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think they have disjoint vertices. When the matrix is dense, we have
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a red vertex
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahah, I contradicted myself in my reply. I meant disjoint edges indeed
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed it in the last commit |
||
| nt::T | ||
| end | ||
|
|
||
| function TreeSet( | ||
| g::AdjacencyGraph{T}, | ||
| forest::Forest{T}, | ||
| buffer::AbstractVector{T}, | ||
| # The value of `reverse_bfs_orders` is ignored, we just provide the storage for it (or reuse memory allocated during acyclic coloring) | ||
| reverse_bfs_orders::Vector{Tuple{T,T}}, | ||
| ne::Integer, | ||
| ) where {T} | ||
|
|
@@ -566,7 +576,6 @@ function TreeSet( | |
| # Number of edges treated | ||
| num_edges_treated = zero(T) | ||
|
|
||
| # reverse_bfs_orders contains the reverse breadth first (BFS) traversal order for each tree in the forest | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep this comment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I simply moved it into the comment of the field of the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a new comment clarifying the confusion with the root of the |
||
| for k in 1:nt | ||
| # Initialize the queue to store the leaves | ||
| queue_start = 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not right,
iis not an edge index.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now