Skip to content

Commit 10ecb09

Browse files
juliohmKrastanov
authored andcommitted
Fix warning from DataStructures.jl, bump compat for it
1 parent 24f1e73 commit 10ecb09

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GraphsSharedArraysExt = "SharedArrays"
2121

2222
[compat]
2323
ArnoldiMethod = "0.4"
24-
DataStructures = "0.18, 0.19"
24+
DataStructures = "0.19"
2525
Distributed = "1"
2626
Inflate = "0.1.3"
2727
LinearAlgebra = "1"

src/Graphs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using Statistics: mean
88

99
using Inflate: InflateGzipStream
1010
using DataStructures:
11-
IntDisjointSets,
11+
IntDisjointSet,
1212
PriorityQueue,
1313
dequeue!,
1414
dequeue_pair!,

src/editdist.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ function _edit_distance(
149149
# initialize open set
150150
OPEN = PriorityQueue{Vector{Tuple},Float64}()
151151
for v in vertices(G₂)
152-
enqueue!(OPEN, [(T(1), v)], vertex_subst_cost(1, v) + h([(T(1), v)]))
152+
push!(OPEN, [(T(1), v)] => vertex_subst_cost(1, v) + h([(T(1), v)]))
153153
end
154-
enqueue!(OPEN, [(T(1), U(0))], vertex_delete_cost(1) + h([(T(1), U(0))]))
154+
push!(OPEN, [(T(1), U(0))] => vertex_delete_cost(1) + h([(T(1), U(0))]))
155155

156156
c = 0
157157
while true
158158
# minimum (partial) edit path
159-
λ, cost = peek(OPEN)
159+
λ, cost = first(OPEN)
160160
c += 1
161-
dequeue!(OPEN)
161+
popfirst!(OPEN)
162162

163163
if is_complete_path(λ, G₁, G₂)
164164
return cost, λ
@@ -177,7 +177,7 @@ function _edit_distance(
177177
end
178178
new_cost += association_cost(u1, u1, v1, v1) # handle self-loops
179179

180-
enqueue!(OPEN, λ⁺, new_cost)
180+
push!(OPEN, λ⁺ => new_cost)
181181
end
182182
# we try deleting v1
183183
λ⁺ = [λ; (u1, U(0))]
@@ -194,7 +194,7 @@ function _edit_distance(
194194
new_cost += edge_delete_cost(Edge(u2, u1))
195195
end
196196
end
197-
enqueue!(OPEN, λ⁺, new_cost)
197+
push!(OPEN, λ⁺ => new_cost)
198198
else
199199
# add remaining vertices of G₂ to the path by deleting them
200200
λ⁺ = [λ; [(T(0), v) for v in vs]]

src/graphcut/karger_min_cut.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function karger_min_cut(g::AbstractGraph{T}) where {T<:Integer}
2323
nvg < 2 && return zeros(Int, nvg)
2424
nvg == 2 && return [1, 2]
2525

26-
connected_vs = IntDisjointSets(nvg)
26+
connected_vs = IntDisjointSet(nvg)
2727
num_components = nvg
2828

2929
for e in shuffle(collect(edges(g)))

src/shortestpaths/dijkstra.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function dijkstra_shortest_paths(
9595
sizehint!(closest_vertices, nvg)
9696

9797
while !isempty(H)
98-
u = dequeue!(H)
98+
u = popfirst!(H).first
9999

100100
if trackvertices
101101
push!(closest_vertices, u)

src/spanningtrees/boruvka.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function boruvka_mst end
1515
@traitfn function boruvka_mst(
1616
g::AG::(!IsDirected), distmx::AbstractMatrix{T}=weights(g); minimize=true
1717
) where {T<:Number,U,AG<:AbstractGraph{U}}
18-
djset = IntDisjointSets(nv(g))
18+
djset = IntDisjointSet(nv(g))
1919
# maximizing Z is the same as minimizing -Z
2020
# mode will indicate the need for the -1 multiplication
2121
mode = minimize ? 1 : -1

src/spanningtrees/kruskal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function kruskal_mst end
1212
@traitfn function kruskal_mst(
1313
g::AG::(!IsDirected), distmx::AbstractMatrix{T}=weights(g); minimize=true
1414
) where {T<:Number,U,AG<:AbstractGraph{U}}
15-
connected_vs = IntDisjointSets(nv(g))
15+
connected_vs = IntDisjointSet(nv(g))
1616

1717
mst = Vector{edgetype(g)}()
1818
nv(g) <= 1 && return mst

src/traversals/maxadjvisit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ assumed to be 1.
3030
# still appearing in fadjlist. When iterating neighbors, is_merged makes sure we
3131
# don't consider them
3232
is_merged = falses(nvg)
33-
merged_vertices = IntDisjointSets(U(nvg))
33+
merged_vertices = IntDisjointSet(U(nvg))
3434
graph_size = nvg
3535
# We need to mutate the weight matrix,
3636
# and we need it clean (0 for non edges)

src/vertexcover/degree_vertex_cover.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ function vertex_cover(g::AbstractGraph{T}, alg::DegreeVertexCover) where {T<:Int
3636
length_cover = 0
3737
degree_queue = PriorityQueue(Base.Order.Reverse, enumerate(degree(g)))
3838

39-
while !isempty(degree_queue) && peek(degree_queue)[2] > 0
40-
v = dequeue!(degree_queue)
39+
while !isempty(degree_queue) && first(degree_queue)[2] > 0
40+
v = popfirst!(degree_queue).first
4141
in_cover[v] = true
4242
length_cover += 1
4343

0 commit comments

Comments
 (0)