File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,10 +65,14 @@ function partial_distance2_coloring!(
6565 end
6666 end
6767 else
68- if forbidden_colors[forced_colors[v]] == v
68+ f = forced_colors[v]
69+ if (
70+ (f == 0 && length (neighbors (bg, Val (side), v)) > 0 ) ||
71+ (f > 0 && forbidden_colors[f] == v)
72+ )
6973 throw (InvalidColoringError ())
7074 else
71- color[v] = forced_colors[v]
75+ color[v] = f
7276 end
7377 end
7478 end
@@ -152,7 +156,7 @@ function star_coloring(
152156 end
153157 end
154158 else
155- if forbidden_colors[forced_colors[v]] == v
159+ if forbidden_colors[forced_colors[v]] == v # TODO : handle forced_colors[v] == 0
156160 throw (InvalidColoringError ())
157161 else
158162 color[v] = forced_colors[v]
@@ -324,7 +328,7 @@ function acyclic_coloring(
324328 end
325329 end
326330 else
327- if forbidden_colors[forced_colors[v]] == v
331+ if forbidden_colors[forced_colors[v]] == v # TODO : handle forced_colors[v] == 0
328332 throw (InvalidColoringError ())
329333 else
330334 color[v] = forced_colors[v]
Original file line number Diff line number Diff line change 1+ using SparseMatrixColor
12using SparseMatrixColorings: group_by_color, UnsupportedDecompressionError
23using Test
34
@@ -20,7 +21,7 @@ using Test
2021end
2122
2223@testset " Empty compression" begin
23- A = rand ( 10 , 10 )
24+ A = zeros (Bool, 10 , 10 )
2425 color = zeros (Int, 10 )
2526 problem = ColoringProblem {:nonsymmetric,:column} ()
2627 algo = ConstantColoringAlgorithm (A, color; partition= :column )
You can’t perform that action at this time.
0 commit comments