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

[WIP] new shrinking #23

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/UnitDiskMapping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export unapply_gadgets!, unmatch
export Pattern, Corner, Turn, Cross, source_graph, mapped_graph, TruncatedTurn, EndTurn
export mapped_entry_to_compact, source_entry_to_configs, map_config_back, mis_overhead
export UNode, contract_graph, compress_graph
export unitdisk_graph

include("utils.jl")
include("gadgets.jl")
Expand All @@ -18,5 +19,6 @@ include("simplifiers.jl")
include("extracting_results.jl")
include("pathdecomposition/pathdecomposition.jl")
include("tikz/tikz.jl")
include("shrinking/shrinking.jl")

end
56 changes: 50 additions & 6 deletions src/extracting_results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function mapped_entry_to_compact(::Cross{false})
end

function source_entry_to_configs(::Cross{false})
return Dict(Pair{Int64, Vector{BitVector}}[5 => [[1, 0, 1, 0, 0, 0, 1, 0, 1], [1, 0, 0, 1, 0, 0, 1, 0, 1]], 12 => [[0, 0, 1, 0, 1, 0, 1, 0, 1], [0, 1, 0, 0, 1, 0, 1, 0, 1]], 8 => [[0, 0, 1, 0, 1, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0, 0, 1, 0], [0, 0, 1, 0, 1, 0, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1, 0, 0]], 1 => [[1, 0, 1, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 0, 1, 0], [1, 0, 1, 0, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0]], 0 => [[0, 1, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0]], 6 => [[0, 1, 0, 1, 0, 1, 0, 0, 1]], 11 => [[1, 0, 1, 0, 1, 1, 0, 1, 0]], 9 => [[1, 0, 1, 0, 1, 0, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 0]], 14 => [[0, 0, 1, 0, 1, 1, 0, 0, 1], [0, 1, 0, 0, 1, 1, 0, 0, 1]], 3 => [[1, 0, 1, 0, 0, 1, 0, 1, 0], [1, 0, 0, 1, 0, 1, 0, 1, 0]], 7 => [[1, 0, 1, 0, 0, 1, 0, 0, 1], [1, 0, 0, 1, 0, 1, 0, 0, 1]], 4 => [[0, 1, 0, 1, 0, 0, 1, 0, 1]], 13 => [[1, 0, 1, 0, 1, 0, 1, 0, 1]], 15 => [[1, 0, 1, 0, 1, 1, 0, 0, 1]], 2 => [[0, 1, 0, 1, 0, 1, 0, 1, 0]], 10 => [[0, 0, 1, 0, 1, 1, 0, 1, 0], [0, 1, 0, 0, 1, 1, 0, 1, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[5 => [[1, 0, 0, 1, 0, 0, 1, 0, 1], [1, 0, 1, 0, 0, 0, 1, 0, 1]], 12 => [[0, 1, 0, 0, 1, 0, 1, 0, 1], [0, 0, 1, 0, 1, 0, 1, 0, 1]], 8 => [[0, 1, 0, 0, 1, 0, 0, 1, 0], [0, 0, 1, 0, 1, 0, 0, 1, 0], [0, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 1, 0, 1, 0, 0]], 1 => [[1, 0, 0, 1, 0, 0, 0, 1, 0], [1, 0, 1, 0, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 1, 0, 0]], 0 => [[0, 1, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0]], 6 => [[0, 1, 0, 1, 0, 1, 0, 0, 1]], 11 => [[1, 0, 1, 0, 1, 1, 0, 1, 0]], 9 => [[1, 0, 1, 0, 1, 0, 0, 1, 0], [1, 0, 1, 0, 1, 0, 1, 0, 0]], 14 => [[0, 1, 0, 0, 1, 1, 0, 0, 1], [0, 0, 1, 0, 1, 1, 0, 0, 1]], 3 => [[1, 0, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 0, 1, 0, 1, 0]], 7 => [[1, 0, 0, 1, 0, 1, 0, 0, 1], [1, 0, 1, 0, 0, 1, 0, 0, 1]], 4 => [[0, 1, 0, 1, 0, 0, 1, 0, 1]], 13 => [[1, 0, 1, 0, 1, 0, 1, 0, 1]], 15 => [[1, 0, 1, 0, 1, 1, 0, 0, 1]], 2 => [[0, 1, 0, 1, 0, 1, 0, 1, 0]], 10 => [[0, 1, 0, 0, 1, 1, 0, 1, 0], [0, 0, 1, 0, 1, 1, 0, 1, 0]]])
end

mis_overhead(::Cross{false}) = -1
Expand All @@ -27,7 +27,7 @@ function mapped_entry_to_compact(::Turn)
end

function source_entry_to_configs(::Turn)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 1, 0]], 2 => [[0, 0, 1, 0, 1], [0, 1, 0, 0, 1]], 3 => [[1, 0, 1, 0, 1]], 1 => [[1, 0, 1, 0, 0], [1, 0, 0, 1, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 1, 0]], 2 => [[0, 1, 0, 0, 1], [0, 0, 1, 0, 1]], 3 => [[1, 0, 1, 0, 1]], 1 => [[1, 0, 0, 1, 0], [1, 0, 1, 0, 0]]])
end

mis_overhead(::Turn) = -1
Expand All @@ -38,7 +38,7 @@ function mapped_entry_to_compact(::WTurn)
end

function source_entry_to_configs(::WTurn)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[1, 0, 1, 0, 0]], 2 => [[0, 0, 0, 1, 1], [1, 0, 0, 0, 1]], 3 => [[0, 1, 0, 1, 1]], 1 => [[0, 1, 1, 0, 0], [0, 1, 0, 1, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[1, 0, 1, 0, 0]], 2 => [[1, 0, 0, 0, 1], [0, 0, 0, 1, 1]], 3 => [[0, 1, 0, 1, 1]], 1 => [[0, 1, 0, 1, 0], [0, 1, 1, 0, 0]]])
end

mis_overhead(::WTurn) = -1
Expand All @@ -49,7 +49,7 @@ function mapped_entry_to_compact(::Branch)
end

function source_entry_to_configs(::Branch)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 1, 0, 0, 1, 0]], 4 => [[0, 0, 1, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 1, 0, 1], [0, 1, 0, 1, 0, 0, 0, 1]], 5 => [[1, 0, 1, 0, 0, 1, 0, 1]], 6 => [[0, 0, 1, 0, 1, 1, 0, 1], [0, 1, 0, 0, 1, 1, 0, 1]], 2 => [[0, 0, 1, 0, 1, 0, 1, 0], [0, 1, 0, 0, 1, 0, 1, 0], [0, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 1, 0, 0]], 7 => [[1, 0, 1, 0, 1, 1, 0, 1]], 3 => [[1, 0, 1, 0, 1, 0, 1, 0], [1, 0, 1, 0, 1, 1, 0, 0]], 1 => [[1, 0, 1, 0, 0, 0, 1, 0], [1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 0, 1, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 1, 0, 0, 1, 0]], 4 => [[0, 1, 0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 0, 1], [0, 1, 0, 1, 0, 0, 0, 1]], 5 => [[1, 0, 1, 0, 0, 1, 0, 1]], 6 => [[0, 1, 0, 0, 1, 1, 0, 1], [0, 0, 1, 0, 1, 1, 0, 1]], 2 => [[0, 1, 0, 0, 1, 1, 0, 0], [0, 0, 1, 0, 1, 1, 0, 0], [0, 1, 0, 0, 1, 0, 1, 0], [0, 0, 1, 0, 1, 0, 1, 0]], 7 => [[1, 0, 1, 0, 1, 1, 0, 1]], 3 => [[1, 0, 1, 0, 1, 1, 0, 0], [1, 0, 1, 0, 1, 0, 1, 0]], 1 => [[1, 0, 1, 0, 0, 1, 0, 0], [1, 0, 1, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0, 1, 0]]])
end

mis_overhead(::Branch) = -1
Expand All @@ -60,7 +60,7 @@ function mapped_entry_to_compact(::BranchFix)
end

function source_entry_to_configs(::BranchFix)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 0, 1, 0, 1, 0], [0, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0]], 2 => [[0, 1, 0, 1, 0, 1]], 3 => [[1, 0, 1, 0, 0, 1], [1, 0, 0, 1, 0, 1]], 1 => [[1, 0, 1, 0, 1, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 1, 0]], 2 => [[0, 1, 0, 1, 0, 1]], 3 => [[1, 0, 0, 1, 0, 1], [1, 0, 1, 0, 0, 1]], 1 => [[1, 0, 1, 0, 1, 0]]])
end

mis_overhead(::BranchFix) = -1
Expand Down Expand Up @@ -93,7 +93,7 @@ function mapped_entry_to_compact(::BranchFixB)
end

function source_entry_to_configs(::BranchFixB)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 0, 1, 0], [0, 1, 0, 0]], 2 => [[0, 0, 1, 1]], 3 => [[1, 0, 0, 1]], 1 => [[1, 1, 0, 0]]])
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 0], [0, 0, 1, 0]], 2 => [[0, 0, 1, 1]], 3 => [[1, 0, 0, 1]], 1 => [[1, 1, 0, 0]]])
end

mis_overhead(::BranchFixB) = -1
Expand All @@ -119,3 +119,47 @@ function source_entry_to_configs(::UnitDiskMapping.DanglingLeg)
end

mis_overhead(::UnitDiskMapping.DanglingLeg) = -1


function mapped_entry_to_compact(::UnitDiskMapping.Square)
return Dict([0 => 0, 2 => 2, 3 => 3, 1 => 1])
end

function source_entry_to_configs(::UnitDiskMapping.Square)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 0, 1, 0], [0, 0, 0, 1]], 2 => [[0, 1, 1, 0]], 3 => [], 1 => [[1, 0, 0, 1]]])
end

mis_overhead(::UnitDiskMapping.Square) = -1


function mapped_entry_to_compact(::UnitDiskMapping.EndCrossing_with_Edge)
return Dict([0 => 0, 4 => 4, 5 => 1, 6 => 6, 2 => 2, 7 => 7, 3 => 3, 1 => 1])
end

function source_entry_to_configs(::UnitDiskMapping.EndCrossing_with_Edge)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0]], 4 => [[0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1]], 5 => [[1, 0, 0, 0, 0, 1]], 6 => [[0, 1, 0, 1, 0, 1]], 2 => [[0, 1, 0, 1, 0, 0]], 7 => [], 3 => [], 1 => [[1, 0, 0, 0, 1, 0]]])
end

mis_overhead(::UnitDiskMapping.EndCrossing_with_Edge) = 0


function mapped_entry_to_compact(::UnitDiskMapping.Cane)
return Dict([0 => 0, 2 => 0, 3 => 3, 1 => 0])
end

function source_entry_to_configs(::UnitDiskMapping.Cane)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 0, 1, 0]], 2 => [[0, 0, 1, 0, 1], [0, 1, 0, 0, 1]], 3 => [[1, 0, 1, 0, 1]], 1 => [[1, 0, 0, 1, 0], [1, 0, 1, 0, 0]]])
end

mis_overhead(::UnitDiskMapping.Cane) = -1


function mapped_entry_to_compact(::UnitDiskMapping.CLoop)
return Dict([0 => 0, 2 => 0, 3 => 3, 1 => 0])
end

function source_entry_to_configs(::UnitDiskMapping.CLoop)
return Dict(Pair{Int64, Vector{BitVector}}[0 => [[0, 1, 1, 0, 0]], 2 => [[0, 1, 0, 0, 1], [1, 0, 0, 0, 1]], 3 => [[1, 0, 0, 1, 1]], 1 => [[1, 0, 0, 1, 0], [0, 0, 1, 1, 0]]])
end

mis_overhead(::UnitDiskMapping.CLoop) = -1
8 changes: 6 additions & 2 deletions src/mapping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function mis_overhead_copylines(ug::UGrid{WC,W}) where {WC,W}
end

##### Interfaces ######
export MappingResult, map_graph, map_configs_back
export MappingResult, map_graph, map_configs_back, apply_simplifiers_unweighted

struct MappingResult{CT,WT}
grid_graph::UGrid{CT,WT}
Expand Down Expand Up @@ -386,6 +386,10 @@ function map_graph(mode, g::SimpleGraph; vertex_order=Greedy(), ruleset=default_
return MappingResult(ug, vcat(tape, tape2) , mis_overhead0 + mis_overhead1 + mis_overhead2)
end

function apply_simplifiers_unweighted(ug::UGrid)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted an estimate of overhead scaling, can delete/modify function

return apply_simplifier_gadgets!(ug; ruleset=default_simplifier_ruleset(UnWeighted()))
end

map_configs_back(r::MappingResult{<:Cell}, configs::AbstractVector) = unapply_gadgets!(copy(r.grid_graph), r.mapping_history, copy.(configs))[2]
default_simplifier_ruleset(::UnWeighted) = vcat([rotated_and_reflected(rule) for rule in simplifier_ruleset]...)
default_simplifier_ruleset(::Weighted) = weighted.(default_simplifier_ruleset(UnWeighted()))
default_simplifier_ruleset(::Weighted) = weighted.(default_simplifier_ruleset(UnWeighted()))
124 changes: 35 additions & 89 deletions src/shrinking/shrinking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end
# find UDNode given a position; return nothing if no node at that position
function get_UNode_from_pos(pos::Tuple{Int, Int}, node_list::Vector{UNode})
for u in node_list
(u.pos == pos) && return u
(u.pos == pos) && return u
end
return nothing
end
Expand All @@ -50,36 +50,15 @@ function find_boundaries(node_list::Vector{UNode})
end

# find points on the boundary that can be moved
# divide region into 4 and move nodes greedily closer to center
function find_boundary_points(node_list::Vector{UNode}, x_min, x_max, y_min, y_max)
half_x = (x_max - x_min)/2 + x_min
half_y = (y_max - y_min)/2 + y_min

pts_xmin_upper = UNode[]
pts_xmax_upper = Vector{UNode}()
pts_xmin_lower = Vector{UNode}()
pts_xmax_lower = Vector{UNode}()

pts_ymin_left = Vector{UNode}()
pts_ymax_left = Vector{UNode}()
pts_ymin_right = Vector{UNode}()
pts_ymax_right = Vector{UNode}()
pts_boundary = Vector{UNode}()

for u in node_list
p_x, p_y = u.pos

(p_x == x_min && p_y >= half_y) && push!(pts_xmin_upper, u)
(p_x == x_min && p_y < half_y) && push!(pts_xmin_lower, u)
(p_x == x_max && p_y >= half_y) && push!(pts_xmax_upper, u)
(p_x == x_max && p_y < half_y) && push!(pts_xmax_lower, u)
(p_x >= half_x && p_y == y_min) && push!(pts_ymin_right, u)
(p_x < half_x && p_y == y_min) && push!(pts_ymin_left, u)
(p_x >= half_x && p_y == y_max) && push!(pts_ymax_right, u)
(p_x < half_x && p_y == y_max) && push!(pts_ymax_left, u)
(p_x == x_min || p_x == x_max || p_y == y_min || p_y == y_max) && push!(pts_boundary, u)
end

return pts_xmin_upper, pts_xmin_lower, pts_xmax_upper, pts_xmax_lower,
pts_ymin_right, pts_ymin_left, pts_ymax_right, pts_ymax_left
return pts_boundary
end


Expand All @@ -100,7 +79,7 @@ function check_UDG_criteria(n::UNode, new_pos::Tuple{Int, Int},
end
end

(issetequal(new_neighbors, n.neighbors) == true) & return true
(issetequal(new_neighbors, n.neighbors) == true) && return true
return false
end

Expand All @@ -115,87 +94,53 @@ function move_node(n::UNode, node_list::Vector{UNode}, candidates::Vector{Tuple{
return node_list
end

# determine candidates
function candidates_xmin_upper(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x + 1, p_y), (p_x + 1, p_y - 1), (p_x, p_y - 1)]
end

function candidates_xmin_lower(pos::Tuple{Int, Int})
# determine candidates to move
function determine_candidates(pos::Tuple{Int, Int}, x_min, x_max, y_min, y_max)
p_x, p_y = pos
return [(p_x + 1, p_y), (p_x + 1, p_y + 1), (p_x, p_y + 1)]
end

halfx = (x_max - x_min)/2 + x_min
halfy = (y_max - y_min)/2 + y_min

function candidates_xmax_upper(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x - 1, p_y), (p_x - 1, p_y - 1), (p_x, p_y - 1)]
end
# move boundary vertices such that we can shrink graph from four quadrants
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! Now it is much easier to read. If possible, you should try to lessen the number of branches - otherwise you need to write tests for every branch to ensure the test coverage is good.

(p_x == x_min && p_y >= halfy) && return [(p_x + 1, p_y), (p_x + 1, p_y - 1), (p_x, p_y - 1)]
(p_x == x_min && p_y < halfy) && return [(p_x + 1, p_y), (p_x + 1, p_y + 1), (p_x, p_y + 1)]
(p_x == x_max && p_y >= halfy) && return [(p_x - 1, p_y), (p_x - 1, p_y - 1), (p_x, p_y - 1)]
(p_x == x_max && p_y < halfy) && return [(p_x - 1, p_y), (p_x - 1, p_y + 1), (p_x, p_y + 1)]

(p_x < halfx && p_y == y_min) && return [(p_x, p_y + 1), (p_x + 1, p_y + 1), (p_x + 1, p_y)]
(p_x >= halfx && p_y == y_min) && return [(p_x, p_y + 1), (p_x - 1, p_y + 1), (p_x - 1, p_y)]
(p_x < halfx && p_y == y_max) && return [(p_x, p_y - 1), (p_x + 1, p_y - 1), (p_x + 1, p_y)]
(p_x >= halfx && p_y == y_max) && return [(p_x, p_y - 1), (p_x - 1, p_y - 1), (p_x - 1, p_y)]

function candidates_xmax_lower(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x - 1, p_y), (p_x - 1, p_y + 1), (p_x, p_y + 1)]
end


function candidates_ymin_left(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x, p_y + 1), (p_x + 1, p_y + 1), (p_x + 1, p_y)]
end

function candidates_ymin_right(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x, p_y + 1), (p_x - 1, p_y + 1), (p_x - 1, p_y)]
end

function candidates_ymax_left(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x, p_y - 1), (p_x + 1, p_y - 1), (p_x + 1, p_y)]
end

function candidates_ymax_right(pos::Tuple{Int, Int})
p_x, p_y = pos
return [(p_x, p_y - 1), (p_x - 1, p_y - 1), (p_x - 1, p_y)]
end

# one shrinking step
function greedy_step(node_list::Vector{UNode}, min_x::Int, max_x::Int,
min_y::Int, max_y::Int)

xmin_upper, xmin_lower, xmax_upper, xmax_lower, ymin_right, ymin_left,
ymax_right, ymax_left = find_boundary_points(node_list, min_x, max_x,
boundary_pts = find_boundary_points(node_list, min_x, max_x,
min_y, max_y)

for p in xmin_upper
node_list = move_node(p, node_list, candidates_xmin_upper(p.pos))
end
for p in xmin_lower
node_list = move_node(p, node_list, candidates_xmin_lower(p.pos))
end
for p in xmax_upper
node_list = move_node(p, node_list, candidates_xmax_upper(p.pos))
end
for p in xmax_lower
node_list = move_node(p, node_list, candidates_xmax_lower(p.pos))
end

for p in ymin_left
node_list = move_node(p, node_list, candidates_ymin_left(p.pos))
end
for p in ymin_right
node_list = move_node(p, node_list, candidates_ymin_right(p.pos))
end
for p in ymax_left
node_list = move_node(p, node_list, candidates_ymax_left(p.pos))
end
for p in ymax_right
node_list = move_node(p, node_list, candidates_ymax_right(p.pos))
for p in boundary_pts
node_list = move_node(p, node_list, determine_candidates(p.pos, min_x, max_x,
min_y, max_y))
end

return node_list
end

function unitdisk_graph(locs::AbstractVector, unit::Real)
minhthin1028 marked this conversation as resolved.
Show resolved Hide resolved
n = length(locs)
g = SimpleGraph(n)
for i=1:n, j=i+1:n
if sum(abs2, locs[i] .- locs[j]) < unit ^ 2
add_edge!(g, i, j)
end
end
return g
end

# interfaces
abstract type CompressUDGMethod end

Expand All @@ -216,6 +161,7 @@ function contract_graph(node_positions::Vector{Tuple{Int, Int}})

xmin, ymin, xmax, ymax = find_boundaries(n_list)


while (xmax - xmin > 1) && (ymax - ymin > 1)
n_list = greedy_step(n_list, xmin, xmax, ymin, ymax)

Expand All @@ -228,6 +174,7 @@ function contract_graph(node_positions::Vector{Tuple{Int, Int}})
ymin += 1
ymax -= 1
end

end

locs_new = Vector{Tuple{Int, Int}}(undef, size(node_positions)[1])
Expand All @@ -240,6 +187,5 @@ end

end


using .CompressUDG
export UNode, contract_graph, CompressUDGMethod
Loading