Skip to content

Commit

Permalink
Fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
reiniscirpons authored and james-d-mitchell committed Aug 30, 2024
1 parent 328e4c6 commit d56638c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions gap/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1528,22 +1528,22 @@ end);

# Compute all undirected simple circuits by filtering the output
# of DigraphAllSimpleCircuits
InstallMethod(DigraphAllUndirectedSimpleCircuits, "for a digraph",
[IsDigraph], function(D)
local digraph, cycles, keep, cycle, cycleRev;
digraph := DigraphSymmetricClosure(
DigraphRemoveAllMultipleEdges(DigraphMutableCopyIfMutable(D)));
cycles := Filtered(DigraphAllSimpleCircuits(digraph),
c -> Length(c) > 2 or Length(c) = 1);
keep := HashSet();
for cycle in cycles do
cycleRev := [cycle[1]];
Append(cycleRev, Reversed(cycle{[2 .. Length(cycle)]}));
if (not cycle in keep and not cycleRev in keep) or Length(cycle) = 1 then
AddSet(keep, cycle);
fi;
od;
return Set(keep);
InstallMethod(DigraphAllUndirectedSimpleCircuits, "for a digraph", [IsDigraph],
function(D)
local digraph, cycles, keep, cycle, cycleRev;
digraph := DigraphSymmetricClosure(
DigraphRemoveAllMultipleEdges(DigraphMutableCopyIfMutable(D)));
cycles := Filtered(DigraphAllSimpleCircuits(digraph),
c -> Length(c) > 2 or Length(c) = 1);
keep := HashSet();
for cycle in cycles do
cycleRev := [cycle[1]];
Append(cycleRev, Reversed(cycle{[2 .. Length(cycle)]}));
if (not cycle in keep and not cycleRev in keep) or Length(cycle) = 1 then
AddSet(keep, cycle);
fi;
od;
return Set(keep);
end);

# Compute all chordless cycles for a given symmetric digraph
Expand Down

0 comments on commit d56638c

Please sign in to comment.