Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize layer assignment problem #16

Merged
merged 19 commits into from
Feb 7, 2022
Merged
Prev Previous commit
Next Next commit
Update layering.jl
Minor changes to avoid unwanted warnings
  • Loading branch information
davide-f authored Apr 21, 2021
commit 9c3075c10ea2c80dfa0c3f653f8820d568c7dd80
4 changes: 2 additions & 2 deletions src/layering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ function agree_with_opt_layer_assign!(layer_groups, graph, opt_layer_assign)
#current layer of node
curr_layer = findfirst(k .∈ layer_groups)
if !isnothing(curr_layer)
if curr_layer >= l
if curr_layer > l
@warn "Ignored opt_layer_assign for node $k; curr layer ($curr_layer) > desired layer ($l)"
elseif any(has_edge(graph, k, v) for v in vcat(layer_groups[curr_layer:l]...))
error("opt_layer_assign node $k incompatible with edge order")
else
elseif curr_layer != l
filter!(x->x != k, layer_groups[curr_layer])
push!(layer_groups[l], k)
end
Expand Down