Skip to content

Commit ba7da77

Browse files
authored
Remove warnings on ColPack orders (#231)
* Remove warnings on ColPack orders * Rephrase
1 parent 35d3e89 commit ba7da77

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

src/order.jl

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,41 @@ function vertices(bg::BipartiteGraph{T}, ::Val{side}, ::LargestFirst) where {T,s
104104
return sort(vertices(bg, Val(side)); by=criterion, rev=true)
105105
end
106106

107+
const COLPACK_WARNING = """
108+
!!! danger
109+
The option `reproduce_colpack=true` induces a large slowdown to mirror the original implementation details of ColPack, it should not be used in performance-sensitive applications.
110+
This setting is mostly for the purpose of reproducing past research results which rely on implementation details.
111+
"""
112+
107113
"""
108114
DynamicDegreeBasedOrder{degtype,direction}(; reproduce_colpack=false)
109115
110116
Instance of [`AbstractOrder`](@ref) which sorts vertices using a dynamically computed degree.
111117
112-
!!! danger
113-
This order is still experimental and needs more tests, correctness is not yet guaranteed.
118+
This order works by assigning vertices to buckets based on their dynamic degree, and then updating buckets iteratively by transfering vertices between them.
114119
115120
# Type parameters
116121
117122
- `degtype::Symbol`: can be `:forward` (for the forward degree) or `:back` (for the back degree)
118123
- `direction::Symbol`: can be `:low2high` (if the order is defined from lowest to highest, i.e. `1` to `n`) or `:high2low` (if the order is defined from highest to lowest, i.e. `n` to `1`)
119124
120-
# Settings
121-
122-
- `reproduce_colpack::Bool`: whether to manage the buckets in the same way as the original ColPack implementation. When `reproduce_colpack=true`, we always append and remove vertices from the end of a bucket, which incurs a large performance penalty because every modification requires a circular permutation of the corresponding bucket. This setting is mostly for the purpose of reproducing past research results which rely on implementation details.
123-
124125
# Concrete variants
125126
126127
- [`IncidenceDegree`](@ref)
127128
- [`SmallestLast`](@ref)
128129
- [`DynamicLargestFirst`](@ref)
129130
131+
# Settings
132+
133+
- `reproduce_colpack::Bool`: whether to manage the buckets in the exact same way as the original ColPack implementation.
134+
- When `reproduce_colpack=true`, we always append and remove vertices at the end of a bucket (unilateral).
135+
- When `reproduce_colpack=false` (the default), we can append and remove vertices either at the start or at the end of a bucket (bilateral).
136+
137+
Allowing modifications on both sides of a bucket enables storage optimization, with a single fixed-size vector for all buckets instead of one dynamically-sized vector per bucket.
138+
Our implementation is optimized for this bilateral setting, which means we pay a large performance penalty to artificially imitate the unilateral setting.
139+
140+
$COLPACK_WARNING
141+
130142
# References
131143
132144
- [_ColPack: Software for graph coloring and related problems in scientific computing_](https://dl.acm.org/doi/10.1145/2513109.2513110), Gebremedhin et al. (2013), Section 5
@@ -391,8 +403,7 @@ end
391403
392404
Instance of [`AbstractOrder`](@ref) which sorts vertices from lowest to highest using the dynamic back degree.
393405
394-
!!! danger
395-
This order is still experimental and needs more tests, correctness is not yet guaranteed.
406+
$COLPACK_WARNING
396407
397408
# See also
398409
@@ -405,8 +416,7 @@ const IncidenceDegree = DynamicDegreeBasedOrder{:back,:low2high}
405416
406417
Instance of [`AbstractOrder`](@ref) which sorts vertices from highest to lowest using the dynamic back degree.
407418
408-
!!! danger
409-
This order is still experimental and needs more tests, correctness is not yet guaranteed.
419+
$COLPACK_WARNING
410420
411421
# See also
412422
@@ -419,8 +429,7 @@ const SmallestLast = DynamicDegreeBasedOrder{:back,:high2low}
419429
420430
Instance of [`AbstractOrder`](@ref) which sorts vertices from lowest to highest using the dynamic forward degree.
421431
422-
!!! danger
423-
This order is still experimental and needs more tests, correctness is not yet guaranteed.
432+
$COLPACK_WARNING
424433
425434
# See also
426435

0 commit comments

Comments
 (0)