Commit 70545896 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

get_hierarchy_tree(): fix empty branches pruning

parent 9f538563
......@@ -892,12 +892,16 @@ def get_hierarchy_tree(state, empty_branches=False):
if not empty_branches:
vmask = t.new_vertex_property("bool", True)
for vi in range(state.g.num_vertices(ignore_filter=True),
t.num_vertices(ignore_filter=True)):
v = t.vertex(vi)
t = GraphView(t, vfilt=vmask)
vmask = t.get_vertex_filter()[0]
N = t.num_vertices()
for vi, v in enumerate(list(t.vertices())):
if vi < state.g.num_vertices():
continue
if v.out_degree() == 0:
vmask[v] = False
t = GraphView(t, vfilt=vmask)
label = t.own_property(label)
order = t.own_property(order)
return t, label, order
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment