You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow picking the best of several orders for GreedyColoringAlgorithm (#265)
* Allow picking the best of several orders for GreedyColoringAlgorithm
* Fix type params
* Tuple
* Better tests
* Better test
* Fix foc
* Fix type inference inside closure
* Fix seed
* Test on 1.11
* Avoid duplicate remap_colors
Copy file name to clipboardExpand all lines: docs/src/tutorial.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ problem = ColoringProblem()
31
31
32
32
The algorithm defines how you want to solve it. It can be either a [`GreedyColoringAlgorithm`](@ref) or a [`ConstantColoringAlgorithm`](@ref). For `GreedyColoringAlgorithm`, you can select options such as
33
33
34
-
- the order in which vertices are processed (a subtype of [`AbstractOrder`](@ref SparseMatrixColorings.AbstractOrder))
34
+
- the order in which vertices are processed (a subtype of [`AbstractOrder`](@ref SparseMatrixColorings.AbstractOrder) , or a tuple of such objects)
35
35
- the type of decompression you want (`:direct` or `:substitution`)
- `order::AbstractOrder`: the order in which the columns or rows are colored, which can impact the number of colors.
75
+
- `order::Union{AbstractOrder,Tuple}`: the order in which the columns or rows are colored, which can impact the number of colors. Can also be a tuple of different orders to try out, from which the best order (the one with the lowest total number of colors) will be used.
76
76
- `postprocessing::Bool`: whether or not the coloring will be refined by assigning the neutral color `0` to some vertices.
77
77
- `decompression::Symbol`: either `:direct` or `:substitution`. Usually `:substitution` leads to fewer colors, at the cost of a more expensive coloring (and decompression). When `:substitution` is not applicable, it falls back on `:direct` decompression.
78
78
@@ -94,26 +94,31 @@ See their respective docstrings for details.
Copy file name to clipboardExpand all lines: test/order.jl
+96Lines changed: 96 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -146,3 +146,99 @@ end;
146
146
@testisperm(π)
147
147
end
148
148
end
149
+
150
+
@testset"Multiple orders"begin
151
+
# I used brute force to find examples where LargestFirst is *strictly* better than NaturalOrder, just to check that the best order is indeed selected when multiple orders are provided
0 commit comments