Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit b531632

Browse files
authored
fix deprecs, specify version (#14)
1 parent 5755f55 commit b531632

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

REQUIRE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
julia 0.6
2-
LightGraphs
3-
SimpleTraits
4-
MathProgBase
2+
LightGraphs 0.12
3+
SimpleTraits 0.6
4+
MathProgBase 0.7

src/dinic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function blocking_flow! end
5353

5454
while length(Q) > 0 # Construct the Level Graph using BFS
5555
u = pop!(Q)
56-
for v in lg.out_neighbors(residual_graph, u)
56+
for v in lg.outneighbors(residual_graph, u)
5757
if P[v] == -1 && capacity_matrix[u, v] > flow_matrix[u, v]
5858
P[v] = u
5959
unshift!(Q, v)
@@ -65,7 +65,7 @@ function blocking_flow! end
6565

6666
total_flow = 0
6767

68-
for bv in lg.in_neighbors(residual_graph, target) # Trace all possible routes to source
68+
for bv in lg.inneighbors(residual_graph, target) # Trace all possible routes to source
6969
flow = typemax(T)
7070
v = target
7171
u = bv

src/edmonds_karp.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function fetch_path! end
107107
while true
108108
if length(Q_f) <= length(Q_r)
109109
u = pop!(Q_f)
110-
for v in lg.out_neighbors(residual_graph, u)
110+
for v in lg.outneighbors(residual_graph, u)
111111
if capacity_matrix[u, v] - flow_matrix[u, v] > 0 && P[v] == -1
112112
P[v] = u
113113
if S[v] == -1
@@ -121,7 +121,7 @@ function fetch_path! end
121121
length(Q_f) == 0 && return 0, P, S, 1 # No paths to target
122122
else
123123
v = pop!(Q_r)
124-
for u in lg.in_neighbors(residual_graph, v)
124+
for u in lg.inneighbors(residual_graph, v)
125125
if capacity_matrix[u, v] - flow_matrix[u, v] > 0 && S[u] == -1
126126
S[u] = v
127127
P[u] != -1 && return u, P, S, 0 # 0 indicates success

src/mincost.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ julia> capacity = ones(6,6)
3939
julia> flow = mincost_flow(g, capacity, demand, w, ClpSolver(), 5, 6)
4040
```
4141
"""
42-
function mincost_flow(g::lg.DiGraph,
42+
function mincost_flow(g::lg.DiGraph,
4343
capacity::AbstractMatrix,
4444
demand::AbstractMatrix,
4545
cost::AbstractMatrix,
4646
solver::AbstractMathProgSolver,
47-
source::Int = -1, # if source and/or sink omitted or not in nodes, circulation problem
47+
source::Int = -1, # if source and/or sink omitted or not in nodes, circulation problem
4848
sink::Int = -1)
4949
flat_cap = collect(Iterators.flatten(capacity))
5050
flat_dem = collect(Iterators.flatten(demand))

src/push_relabel.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function push_relabel end
3636
sizehint!(Q, n)
3737

3838

39-
for v in lg.out_neighbors(residual_graph, source)
39+
for v in lg.outneighbors(residual_graph, source)
4040
push_flow!(residual_graph, source, v, capacity_matrix, flow_matrix, excess, height, active, Q)
4141
end
4242

@@ -46,7 +46,7 @@ function push_relabel end
4646
discharge!(residual_graph, v, capacity_matrix, flow_matrix, excess, height, active, count, Q)
4747
end
4848

49-
return sum([flow_matrix[v, target] for v in lg.in_neighbors(residual_graph, target)]), flow_matrix
49+
return sum([flow_matrix[v, target] for v in lg.inneighbors(residual_graph, target)]), flow_matrix
5050
end
5151

5252
"""
@@ -160,7 +160,7 @@ function relabel! end
160160
n = lg.nv(residual_graph)
161161
count[height[v] + 1] -= 1
162162
height[v] = 2 * n
163-
for to in lg.out_neighbors(residual_graph, v)
163+
for to in lg.outneighbors(residual_graph, v)
164164
if capacity_matrix[v, to] > flow_matrix[v, to]
165165
height[v] = min(height[v], height[to] + 1)
166166
end
@@ -189,7 +189,7 @@ function discharge! end
189189
count::AbstractVector{Int},
190190
Q::AbstractVector # FIFO queue
191191
)
192-
for to in lg.out_neighbors(residual_graph, v)
192+
for to in lg.outneighbors(residual_graph, v)
193193
excess[v] == 0 && break
194194
push_flow!(residual_graph, v, to, capacity_matrix, flow_matrix, excess, height, active, Q)
195195
end

test/REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Clp
1+
Clp 0.4

test/dinic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#disconnect target and add unreachable vertex
4040
h = copy(residual_graph)
41-
for src in collect(lg.in_neighbors(residual_graph, target))
41+
for src in collect(lg.inneighbors(residual_graph, target))
4242
lg.rem_edge!(h, src, target)
4343
end
4444
@test @inferred(LightGraphsFlows.blocking_flow(h, source, target, capacity_matrix, flow_matrix)) == 0

test/edmonds_karp.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
end
4747
v, P, S, flag = LightGraphsFlows.fetch_path(h, s, t, flow_matrix, capacity_matrix)
4848
@test flag == 0
49-
for i in collect(lg.in_neighbors(h, t))
49+
for i in collect(lg.inneighbors(h, t))
5050
lg.rem_edge!(h, i, t)
5151
end
5252
v, P, S, flag = LightGraphsFlows.fetch_path(h, s, t, flow_matrix, capacity_matrix)

0 commit comments

Comments
 (0)