Skip to content

Commit c1ee0d4

Browse files
committed
Fix the code coverage
1 parent 8e6b9df commit c1ee0d4

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/coloring.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ If `postprocessing=true`, some colors might be replaced with `0` (the "neutral"
7878
"""
7979
function star_coloring(g::AdjacencyGraph, order::AbstractOrder, postprocessing::Bool)
8080
# Initialize data structures
81-
S = pattern(g)
8281
nv = nb_vertices(g)
8382
ne = nb_edges(g)
8483
color = zeros(Int, nv)
@@ -158,7 +157,6 @@ function _update_stars!(
158157
color::AbstractVector{<:Integer},
159158
first_neighbor::AbstractVector{<:Tuple},
160159
)
161-
S = pattern(g)
162160
for (w, index_vw) in neighbors_with_edge_indices(g, v)
163161
!has_diagonal(g) || (v == w && continue)
164162
iszero(color[w]) && continue
@@ -229,7 +227,6 @@ If `postprocessing=true`, some colors might be replaced with `0` (the "neutral"
229227
"""
230228
function acyclic_coloring(g::AdjacencyGraph, order::AbstractOrder, postprocessing::Bool)
231229
# Initialize data structures
232-
S = pattern(g)
233230
nv = nb_vertices(g)
234231
ne = nb_edges(g)
235232
color = zeros(Int, nv)

test/order.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ end;
6161
end;
6262

6363
@testset "LargestFirst" begin
64-
A = sparse([
65-
0 1 0
66-
1 0 1
67-
0 1 0
68-
])
69-
ag = AdjacencyGraph(A)
70-
71-
@test vertices(ag, LargestFirst()) == [2, 1, 3]
64+
for has_diagonal in (false, true)
65+
A = sparse([
66+
0 1 0
67+
1 0 1
68+
0 1 0
69+
])
70+
ag = AdjacencyGraph(A; has_diagonal)
71+
@test vertices(ag, LargestFirst()) == [2, 1, 3]
72+
end
7273

7374
A = sparse([
7475
1 1 0 0

0 commit comments

Comments
 (0)