Skip to content

Commit e7cba47

Browse files
authored
fix done (#26)
1 parent a8d7ec1 commit e7cba47

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mapping.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,13 @@ The `vertex_order` can be a vector or one of the following inputs
329329
embed_graph(g::SimpleGraph; vertex_order=Branching()) = embed_graph(UnWeighted(), g; vertex_order)
330330
function embed_graph(mode, g::SimpleGraph; vertex_order=Branching())
331331
if vertex_order isa AbstractVector
332-
L = PathDecomposition.Layout(g, collect(vertex_order))
332+
L = PathDecomposition.Layout(g, collect(vertex_order[end:-1:1]))
333333
else
334334
L = pathwidth(g, vertex_order)
335335
end
336-
ug = ugrid(mode, g, L.vertices; padding=2, nrow=L.vsep+1)
336+
# we reverse the vertex order of the pathwidth result,
337+
# because this order corresponds to the vertex-seperation.
338+
ug = ugrid(mode, g, L.vertices[end:-1:1]; padding=2, nrow=L.vsep+1)
337339
return ug
338340
end
339341

0 commit comments

Comments
 (0)