File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191 problem = ColoringProblem (; structure= :nonsymmetric , partition= :bidirectional )
9292 order = RandomOrder (StableRNG (0 ), 0 )
9393
94+ @testset " Anti-diagonal" begin
95+ A = sparse ([0 0 0 1 ; 0 0 1 0 ; 0 1 0 0 ; 1 0 0 0 ])
96+
97+ result = coloring (
98+ A, problem, GreedyColoringAlgorithm {:direct} (; postprocessing= false )
99+ )
100+ @test ncolors (result) == 2
101+
102+ result = coloring (
103+ A, problem, GreedyColoringAlgorithm {:direct} (; postprocessing= true )
104+ )
105+ @test ncolors (result) == 1
106+
107+ result = coloring (
108+ A, problem, GreedyColoringAlgorithm {:substitution} (; postprocessing= false )
109+ )
110+ @test ncolors (result) == 2
111+
112+ result = coloring (
113+ A, problem, GreedyColoringAlgorithm {:substitution} (; postprocessing= true )
114+ )
115+ @test ncolors (result) == 1
116+ end
117+
94118 @testset " Triangle" begin
95119 A = sparse ([1 1 0 ; 0 1 1 ; 1 0 1 ])
96120
You can’t perform that action at this time.
0 commit comments