Skip to content

Commit

Permalink
Simplify function
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPointon committed Feb 13, 2024
1 parent e5d512b commit a0851c1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions gap/oper.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2068,19 +2068,11 @@ function(D, roots)
fi;

N := Length(roots);
vertex_in_subset := BlistList([1 .. N], []);
vertex_in_subset := BlistList([1 .. N], roots);
reachable_vertices := VerticesReachableFrom(D, roots);
for i in roots do
vertex_in_subset[i] := true;
od;

for i in reachable_vertices do
if not vertex_in_subset[i] then
return false;
fi;
od;
return Length(reachable_vertices) = Length(roots) and not ForAny(reachable_vertices, x -> vertex_in_subset[x]);

return Length(reachable_vertices) = Length(roots);
end);

InstallMethod(DominatorTree, "for a digraph and a vertex",
Expand Down

0 comments on commit a0851c1

Please sign in to comment.